-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix open redirect check for more cases #25143
Conversation
How about a regex like |
I would avoid regex for this use case |
Hmm, not easy. |
As this part (context package) of code has no unit tests that would allow creating test context etc to test on this is not easy one to add one, especially for such small change |
There could be separate function like |
This still is not perfect solution as this would need to be actually context aware (like redirecting only to valid Gitea URLs etc) like stated in this FIXME comment: gitea/routers/web/user/profile.go Lines 365 to 366 in 263ed09
In future this should be fixed so I would avoid making changes just to be able to test small portion of this |
I was unable to create a backport for 1.19. @lafriks, please send one manually. 🍵
|
If redirect_to parameter has set value starting with `\\example.com` redirect will be created with header `Location: /\\example.com` that will redirect to example.com domain.
If redirect_to parameter has set value starting with `\\example.com` redirect will be created with header `Location: /\\example.com` that will redirect to example.com domain.
* main: Modify OAuth login ui and fix display name, iconurl related logic (go-gitea#25030) Fix open redirect check for more cases (go-gitea#25143) Update js dependencies (go-gitea#25137) Remove duplicated functions when deleting a branch (go-gitea#25128) Add codeowners feature (go-gitea#24910) Fix strange UI behavior of cancelling dismiss review modal (go-gitea#25133) Fix `MilestoneIDs` when querying issues (go-gitea#25125) Fix incorrect git ignore rule and add missing license files (go-gitea#25135) Change branch name from master to main in some documents' links (go-gitea#25126) Remove incorrect element ID on "post-install" page (go-gitea#25104) [skip ci] Updated translations via Crowdin Improve notification icon and navbar (go-gitea#25111) fix swagger documentation for multiple files API endpoint (go-gitea#25110)
* upstream/main: [skip ci] Updated translations via Crowdin Modify OAuth login ui and fix display name, iconurl related logic (go-gitea#25030) Fix open redirect check for more cases (go-gitea#25143) Update js dependencies (go-gitea#25137) Remove duplicated functions when deleting a branch (go-gitea#25128) Add codeowners feature (go-gitea#24910) Fix strange UI behavior of cancelling dismiss review modal (go-gitea#25133) Fix `MilestoneIDs` when querying issues (go-gitea#25125) Fix incorrect git ignore rule and add missing license files (go-gitea#25135) Change branch name from master to main in some documents' links (go-gitea#25126) Remove incorrect element ID on "post-install" page (go-gitea#25104) [skip ci] Updated translations via Crowdin Improve notification icon and navbar (go-gitea#25111) fix swagger documentation for multiple files API endpoint (go-gitea#25110) Fix webauthn regression and improve code (go-gitea#25113) Add details summary for vertical menus in settings to allow toggling (go-gitea#25098) Fix 500 error caused by notifications without an issue such as repo transfers (go-gitea#25101)
Backport go-gitea#25143 If redirect_to parameter has set value starting with \\example.com redirect will be created with header Location: /\\example.com that will redirect to example.com domain. (cherry picked from commit a903005)
If redirect_to parameter has set value starting with
\\example.com
redirect will be created with headerLocation: /\\example.com
that will redirect to example.com domain.