Repository navigation
[Aikido] Add StoredSSRFScanner to libcurl HTTP clients to prevent SSRF bypasses - #438
Closed
aikido-autofix[bot] wants to merge 1 commit into
Closed
aikido-autofix[bot] wants to merge 1 commit into
aikido-autofix[bot] wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
This patch mitigates stored Server-Side Request Forgery (SSRF) vulnerabilities in libcurl-based HTTP clients by registering the StoredSSRFScanner across the curb, patron, and typhoeus sinks. The scanner performs explicit DNS resolution before outgoing HTTP requests to enable detection of IMDS (Instance Metadata Service) addresses and other internal network targets that could be exploited through stored SSRF attacks. The fix was applied to lib/aikido/zen/sinks/curb.rb, lib/aikido/zen/sinks/patron.rb, and lib/aikido/zen/sinks/typhoeus.rb.
✅ 1 issue fixed by this PR
performhook scans with a sink containing onlyScanners::SSRFScanner. That scanner requires a current request context and reports only when the destination matches a payload in that request.StoredSSRFScanner, which independently checks resolved addresses against IMDS ranges and is designed to operate without request context, is registered only on the Resolv and TCPSocket sinks. Curb then invokes the native libcurl operation, bypassing those Ruby resolution/socket hooks. Consequently, an application that uses Curb to fetch a URL obtained from persisted or otherwise non-request-derived data can request an IMDS address without the stored-SSRF protection running. The optional outbound-domain policy is a separate deployment control and is not an inherent prevention for applications using a permissive policy.