Python: server_url_validator allows Azure WireServer (168.63.129.16) and IPv6-embedded IPv4 forms (NAT64/6to4/Teredo)
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
semantic_kernel.connectors.openapi_plugin.server_url_validator の validate_server_url から始め、次に try_categorize_non_public_address と IPv4/IPv6 分類ヘルパーを調べてください。issue にある再現用アドレスと期待される動作を確認項目として使ってください。Azure WireServer がブロックされ、NAT64、6to4、Teredo の形式が分類前にデコードされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
server_url_validator is the default SSRF guard for OpenAPI plugin calls (allow_private_network_access defaults to False), and it classifies IPv4 by explicit octet ranges and IPv6 by a short list of properties. Two categories fall outside both:
168.63.129.16— Azure's WireServer / platform channel, reachable from every Azure VM. It's a publicly routable address, so none of the_try_classify_ipv4branches match it.- IPv6 addresses that carry an IPv4 target inside them.
_try_classify_ipv6unwraps::ffff:viaipv4_mapped, but NAT64, 6to4 and Teredo encodings aren't decoded.
The URL an OpenAPI plugin ends up calling is influenced by the model (server variables, path parameters), which is what makes this the SSRF surface the module exists for.
To Reproduce
import asyncio
from semantic_kernel.connectors.openapi_plugin.server_url_validator import validate_server_url
asyncio.run(validate_server_url("https://168.63.129.16/machine/")) # returns
asyncio.run(validate_server_url("https://[64:ff9b::169.254.169.254]/latest/meta-data/")) # returns
Full sweep on main @ 7d885dd:
| address | result | category reported |
|---|---|---|
169.254.169.254 (AWS/GCP/Azure/OCI/DO IMDS) |
blocked | link-local |
169.254.170.2 (AWS ECS task creds) |
blocked | link-local |
169.254.170.23 (AWS EKS Pod Identity) |
blocked | link-local |
169.254.42.42 (Scaleway) |
blocked | link-local |
100.100.100.200 (Alibaba) |
blocked | carrier-grade NAT |
192.0.0.192 (Oracle Cloud Classic) |
blocked | reserved |
168.63.129.16 (Azure WireServer) |
allowed | — |
| IPv6 form | result |
|---|---|
::ffff:169.254.169.254 (IPv4-mapped) |
blocked |
::1, fd00:ec2::254 |
blocked |
64:ff9b::169.254.169.254 (NAT64 well-known, RFC 6052) |
allowed |
2002:a9fe:a9fe:: (6to4, RFC 3056) |
allowed |
2001:0:4136:e378:8000:63bf:3fff:fdd2 (Teredo, RFC 4380) |
allowed |
Expected behavior
168.63.129.16 blocked regardless of the private-range classification, and IPv6 forms carrying an embedded IPv4 decoded to that IPv4 before classification.
The Azure one can't be caught by range logic — it needs an explicit metadata denylist, checked before allow_private_network_access returns early, since "let me reach my own network" and "let me reach the host agent's credential endpoint" aren't the same request.
NAT64 needs the 64:ff9b::/96 and 64:ff9b:1::/48 prefixes decoded per RFC 6052 §2.2; 6to4 takes the IPv4 from bits 16–47; Teredo's is the low 32 bits XOR'd with all-ones.
Platform
- OS: Linux
- Python: 3.10.12
- Semantic Kernel:
main@ 7d885dd (python)
Additional context
Reachability varies by deployment — NAT64 needs a gateway on the path, and 6to4/Teredo relays are largely retired, so those three are defence-in-depth rather than universally exploitable. 168.63.129.16 is different: it is directly reachable on any Azure VM with no special network setup, which is where this repo's users are most likely to be running.
The IPv4-mapped unwrapping in try_categorize_non_public_address is already the right shape for the IPv6 side; the other encodings would slot in next to it.
- 主要言語
- C#
- スター
- 28.6k
- フォーク
- 4.8k
- 平均マージ
- 13時間 24分
- マージ済み PR(30日)
- 11
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/semantic-kernel のほかの issue
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microsoft/semantic-kernel#14491 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/semantic-kernel#14490 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Python: [Python] structured_outputs_transform reuses ChatHistory across calls (prompt pollution)オープンpython triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
microsoft/semantic-kernel#14483 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
.NET python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
microsoft/semantic-kernel#14482 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
python triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
microsoft/semantic-kernel#14481 ·
メンテナーはふだん 2 日以内に返信
microsoft/semantic-kernel の issue をすべて見る
似ている issue
-
[Simple] NavigationBar primary commands do not render AppBarButton.Content when it is a UIElementオープンcontrol/navigationbar kind/bug triage/untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
unoplatform/uno.toolkit.ui#1652 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
microsoft/copilot-camp#1053 ·
メンテナーはふだん 1 日以内に返信
-
bug effort:S P3
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nightscout/nocturne#1861 ·
メンテナーはふだん 1 日以内に返信
-
agentic-workflows area/Docs partner/agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/fluentui-blazor#5364 ·
メンテナーはふだん 1 日以内に返信