Skip to content

fix(openapi_plugin): block Azure WireServer and IPv6-embedded private addresses in server URL validation - #14267

Open
Diwak4r wants to merge 1 commit into
microsoft:mainfrom
Diwak4r:fix/ssrf-wireserver-metadata-ipv6
Open

fix(openapi_plugin): block Azure WireServer and IPv6-embedded private addresses in server URL validation#14267
Diwak4r wants to merge 1 commit into
microsoft:mainfrom
Diwak4r:fix/ssrf-wireserver-metadata-ipv6

Conversation

@Diwak4r

@Diwak4r Diwak4r commented Aug 4, 2026

Copy link
Copy Markdown

Description

The OpenAPI plugin server URL validator could be bypassed to reach cloud metadata endpoints in two ways:

  1. Azure WireServer (168.63.129.16) is publicly routable. Unlike the AWS (169.254.169.254) and GCP (metadata.google.internal) endpoints, the Azure WireServer IP falls in no private range, so try_categorize_non_public_address treated it as public and validate_server_url allowed it.
  2. IPv4 addresses embedded in IPv6 were classified purely as IPv6. A link-local or private IPv4 smuggled inside a NAT64 (64:ff9b::/96, 64:ff9b:1::/48), 6to4 (2002::/16), or Teredo (2001::/32) address looked like a benign public IPv6 address and passed validation.

Changes

  • Denylist the Azure WireServer endpoint in _try_classify_ipv4, and enforce it even when allow_private_network_access=True — being allowed to reach your own network is not the same as being allowed to reach the host agent's credential endpoint. The private-mode check only inspects literal IP hosts (private mode deliberately does not resolve hostnames).
  • Decode IPv4 addresses embedded in IPv6 (sixtofour, teredo, and the RFC 6052 NAT64 prefixes) in try_categorize_non_public_address so the embedded address is classified with the IPv4 rules.
  • Add tests covering the WireServer endpoint (literal, DNS-resolved, NAT64- and 6to4-embedded), all three IPv6 embedding forms, and the private-network-access override.

Test plan

pytest tests/unit/connectors/openapi_plugin/test_server_url_validator.py — 62 passed (10 new tests added).

Fixes #14240

… addresses in server URL validation

The server URL validator could be bypassed to reach cloud metadata endpoints: the Azure WireServer IP 168.63.129.16 is publicly routable so it passed the private-address checks, and IPv6 addresses embedding an IPv4 (NAT64, 6to4, Teredo) were classified purely as IPv6, letting link-local and other private IPv4 addresses through.

- Denylist the Azure WireServer metadata endpoint in _try_classify_ipv4 and enforce it even when allow_private_network_access is enabled.
- Decode IPv4 addresses embedded in IPv6 (6to4 via sixtofour, Teredo via teredo, NAT64 64:ff9b::/96 and 64:ff9b:1::/48) before classification so embedded private addresses are blocked.
- Add tests covering the WireServer endpoint, all three IPv6 embedding forms, and the private-network-access override.
Copilot AI lite review requested due to automatic review settings August 4, 2026 08:35
@Diwak4r
Diwak4r requested a review from a team as a code owner August 4, 2026 08:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Code Review

Reviewers: 5 | Confidence: 74% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Failure Modes, Design Approach


Automated review by Diwak4r's agents

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.

Python: server_url_validator allows Azure WireServer (168.63.129.16) and IPv6-embedded IPv4 forms (NAT64/6to4/Teredo)

2 participants