-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
URL redirect may cause security problem #5627
Comments
It would probably be of more usefulness if your config (the relevant parts) was included |
Hmm... This doesn't happen on try.gitea.io which is on master.
I'll check out a 1.6 version tomorrow. Could you check from your end too and take a look at the git log between since 1.6 to see if there's an obvious commit that would fix this. In any case, Version 1.6.3 is the now the mainline version for gitea 1.6 and I'd really recommend updating to it - especially if you allow auto sign-up and repository creation. As an aside I'm not sure that it's really normal practice to put links in http 302s though - so that might need to be changed. |
Giving a link in a 302 response is the required behaviour according to the RFC |
I meant that the body of the response contains an HTML link - rather than being empty or containing the word Found |
Oh right, does not seems good indeed. |
OK, running v1.6.1 on my box I can't replicate this issue immediately OOTB. What are your settings in app.ini ? Are you running over ssl? Are you using REDIRECT_OTHER_PORT? |
this is my log of version info:
request log:
I try this request in Google Chrome, IE, Edge, it finally redirect to EDIT:
|
I just tested your original
Edit: |
@0x5c |
I also tried with the dots, which got the server to respond according to the standards: |
I just downloaded the latest release from https://github.com/go-gitea/gitea/releases/download/v1.6.3/gitea-1.6.3-windows-4.0-amd64.exe, and run in empty folder. I tested in three machine. Window 10 Professional is OK, but Windows 7 and Windows Server 20008 R2 still exist. |
That's weird |
Ok. Two things come to mind:
I guess we just need to look at the redirects in the code and check em |
Okay, I was finally able to reproduce it in linux, using |
I test again, after installation and creating an admin user. the problem still not solved. Maybe the only solution is migrating to linux. - -b, with 50GB repositories 😭 |
My linux install displays the same behaviour |
We just need to find out which redirect is causing the problem. Do the v1.7 RCs have the redirect issue you've found? I'd check myself but I'm not at a dev box today. |
…te.com Fix go-gitea#5627 Signed-off-by: Andrew Thornton <[email protected]>
OK, I've found where the redirect is being sent. |
…te.com (#5669) Fix #5627 Signed-off-by: Andrew Thornton <[email protected]>
…te.com (go-gitea#5669) Fix go-gitea#5627 Signed-off-by: Andrew Thornton <[email protected]>
…te.com (#5669) (#5679) Fix #5627 Signed-off-by: Andrew Thornton <[email protected]>
…te.com (go-gitea#5669) Fix go-gitea#5627 Signed-off-by: Andrew Thornton <[email protected]>
…te.com (#5669) (#5703) Fix #5627 Signed-off-by: Andrew Thornton <[email protected]>
[x]
):Description
try this url:
curl -I http://mygitserver:3000//google.com/..
HTTP response header:
response body:
<a href="//google.com/../">Found</a>.
I can redirect to google.com through mygitserver:3000. This is dangerous!
Can any configuration prohibit this problem?
Screenshots
The text was updated successfully, but these errors were encountered: