Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL] Fix SSRF bypass via IPv4-mapped IPv6 addresses#56

Merged
manupawickramasinghe merged 1 commit into
mainfrom
sentinel/fix-ssrf-bypass-ipv4-mapped-1602020334448431204
Apr 17, 2026
Merged

πŸ›‘οΈ Sentinel: [CRITICAL] Fix SSRF bypass via IPv4-mapped IPv6 addresses#56
manupawickramasinghe merged 1 commit into
mainfrom
sentinel/fix-ssrf-bypass-ipv4-mapped-1602020334448431204

Conversation

@ManupaKDU
Copy link
Copy Markdown
Contributor

🚨 Severity: CRITICAL
πŸ’‘ Vulnerability: Attackers could bypass SSRF IP blocklists (e.g., checking is_link_local to block AWS metadata endpoints like 169.254.169.254) by passing the equivalent IPv4-mapped IPv6 address (e.g., ::ffff:169.254.169.254). Python's ipaddress module evaluates is_link_local and is_unspecified as False for these mapped addresses, allowing them past validation logic. The underlying OS networking stack then natively routes the IPv6 mapped packet to the IPv4 target, resulting in SSRF.
🎯 Impact: An attacker could use this network scanning utility to probe internal cloud infrastructure metadata endpoints or loopback services, gaining unauthorized access or mapping internal architecture.
πŸ”§ Fix: Explicitly unwrapped the mapped IPv4 address using getattr(ip_obj, 'ipv4_mapped', None) and applied the security validation blocklist directly to the underlying IPv4Address object if it exists.
βœ… Verification: Added a comprehensive unit test suite in test_testping1.py validating that IPv4-mapped loops, link-locals, multicasters, unspecifieds, and reserved addresses are strictly rejected. Tests pass with python3 -m unittest test_testping1.py.


PR created automatically by Jules for task 1602020334448431204 started by @ManupaKDU

- Add check to unwrap `ipv4_mapped` IPv6 addresses before evaluating SSRF protection properties.
- Add unit tests for IPv4-mapped loopback, link-local, unspecified, multicast, and reserved addresses to prevent regressions.

Co-authored-by: ManupaKDU <95234271+ManupaKDU@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@manupawickramasinghe manupawickramasinghe merged commit b20f6e5 into main Apr 17, 2026
1 check passed
@manupawickramasinghe manupawickramasinghe deleted the sentinel/fix-ssrf-bypass-ipv4-mapped-1602020334448431204 branch April 22, 2026 09:38
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.

2 participants