fix: prevent SSRF in URL upload by blocking private/internal IPs#276
Open
tranquac wants to merge 1 commit intoandreimarcu:masterfrom
Open
fix: prevent SSRF in URL upload by blocking private/internal IPs#276tranquac wants to merge 1 commit intoandreimarcu:masterfrom
tranquac wants to merge 1 commit intoandreimarcu:masterfrom
Conversation
Signed-off-by: tranquac <tranquac@users.noreply.github.com>
Contributor
|
This does not prevent SSRF in all cases; there are still plenty of things you can do if you can make arbitrary web requests to non-internal URLs. If you wish to prevent SSRF, you should disable the remote uploads feature; it is intentionally disabled by default. Perhaps the risks of enabling this feature should be better documented. Additionally, please review the readme of this repository. I suggest you submit your changes to one of the forks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevent SSRF in the URL upload handler by validating that the target URL doesn't resolve to private or internal IP addresses.
Problem
The URL upload handler fetches user-supplied URLs without any SSRF protection:
An attacker can use this to:
http://169.254.169.254/latest/meta-data/→ leaks IAM credentialsFix
http/https)IsLoopback(),IsPrivate(),IsLinkLocalUnicast()_)Impact