Skip to content

[Aikido] Fix IPv4-mapped IPv6 SSRF bypass in IP matcher fallback - #743

Closed
aikido-autofix[bot] wants to merge 1 commit into
mainfrom
fix/code-audit-137918674-2ydn
Closed

aikido-autofix[bot] wants to merge 1 commit into
mainfrom
fix/code-audit-137918674-2ydn

Conversation

@aikido-autofix

@aikido-autofix aikido-autofix Bot commented Oct 8, 2026

Copy link
Copy Markdown

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
Issue Severity           Description
CodeAudit#811707812
HIGH
The optimized matcher applies preparse() and converts IPv4-mapped IPv6 values to their embedded IPv4 form, but the fallback directly calls parse_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 where pytricia is omitted.

@hansott hansott closed this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant