Repository navigation
[Aikido] Fix IPv4-mapped IPv6 SSRF bypass in IP matcher fallback - #743
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
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 addresses a Server-Side Request Forgery (SSRF) vulnerability in the IP matcher fallback module where IPv4-mapped IPv6 addresses could bypass configured IP filtering rules. The fix implements address canonicalization to convert IPv4-mapped IPv6 addresses (e.g., ::ffff:192.168.1.1) to their standard IPv4 form before matching against configured rules. The changes were made to aikido_zen/helpers/ip_matcher_fallback/init.py to ensure consistent IP address normalization and prevent attackers from circumventing SSRF protections through IPv6 address format manipulation.
✅ 1 issue fixed by this PR
preparse()and converts IPv4-mapped IPv6 values to their embedded IPv4 form, but the fallback directly callsparse_base_network()for both configured networks and lookup values. Consequently, a mapped IPv6 candidate cannot match an equivalent IPv4 rule. In the SSRF path, this can suppress both private-IP and IMDS detections before blocking is performed. The same shared defect can also cause IPv4 blocklists to miss a client address when it reaches policy evaluation in mapped form. The fallback is a supported path, including the documented Windows configuration wherepytriciais omitted.