-
-
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
server-side request forgery (SSRF) vulnerability in webhooks #4624
Comments
Probably there should be IP/subnet blacklist which could be configured in ini file or via admin panel. |
webhook URLs should never be allowed to point to localhost, 127.0.0.1, ::1, server name, server IP address, etc (one might consider an isAdmin() exception tho) |
The code that needs to get changed is here: https://github.com/go-gitea/gitea/blob/master/modules/httplib/httplib.go#L315-L339 Some similar code can be found here: https://github.com/hakobe/paranoidhttp/blob/master/client.go#L109 A note that |
Default IP black list should block the local network, and admin can change this by hand. |
I think it needs some kind of admin setting in app.ini to disable that |
I love the idea to limit webhooks using internal ip address range to admin permission since the admin has knowledge about internal server infrastructure / services. |
@daviian : still non-Admin User sind should probably not be allowed to create Webhooks pointing to the local server, or is there some use case where this seems useful (and harmless?)? |
@Siesh1oo yes you're right. non-admin users shouldn't be allowed to add such webhooks. if they need to, for whatever reason, they should be required to ask an admin to do so. |
I have fixed it by introducing allow list |
[x]
):Description
Due to shared code base, gitea is affected by issue gogs/gogs#5366 (server-side request forgery (SSRF) vulnerability in webhooks).
To reproduce:
Screenshots
See gogs/gogs#5366.
The text was updated successfully, but these errors were encountered: