Repository navigation
Python: .NET/Python: Share HTTP request validation utilities - #14546
SergeyMenshykh merged 8 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Both validators permit the non-public IPv6 site-local range fec0::/10, leaving an SSRF bypass.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Introduces shared public-network validation utilities across .NET and Python and applies them to HTTP plugins.
Changes:
- Extracts shared DNS and non-public IP validation.
- Adds explicit private-network opt-ins to HTTP plugins.
- Expands validation and plugin tests.
| File | Description |
|---|---|
python/tests/unit/core_plugins/test_http_plugin.py |
Tests DNS, IP, IDNA, and opt-in behavior. |
python/tests/unit/connectors/openapi_plugin/test_server_url_validator.py |
Tests explicit hostname allowlisting. |
python/semantic_kernel/utils/public_network_address_validator.py |
Adds shared Python network validation. |
python/semantic_kernel/core_plugins/http_plugin.py |
Applies validation to HTTP requests. |
python/semantic_kernel/connectors/openapi_plugin/server_url_validator.py |
Reuses the shared Python validator. |
dotnet/src/Plugins/Plugins.UnitTests/Core/HttpPluginTests.cs |
Tests .NET plugin network restrictions. |
dotnet/src/Plugins/Plugins.Core/HttpPlugin.cs |
Adds private-network controls and validation. |
dotnet/src/InternalUtilities/src/Http/PublicNetworkAddressValidator.cs |
Adds shared .NET network validation. |
dotnet/src/Functions/Functions.UnitTests/OpenApi/ServerUrlValidatorTests.cs |
Expands shared-validator coverage. |
dotnet/src/Functions/Functions.OpenApi/ServerUrlValidator.cs |
Reuses the shared .NET validator. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): eabe49f57c4c
Model: gpt-5.6-sol
Overview
The PR consolidates destination validation across .NET and Python and adds fail-closed DNS/address checks to the HTTP plugins, backed by domain gates, redirect controls, all-answer validation, and broad unit coverage. Two Medium residual risks remain: the approved DNS result is not bound to the actual connection, and deprecated site-local IPv6 destinations fall through as public in both implementations.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
2 verified findings remained after source verification (2 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: dotnet/src/InternalUtilities/src/Http/PublicNetworkAddressValidator.cs
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Eduard van Valkenburg (eavanvalkenburg)
left a comment
There was a problem hiding this comment.
Small nit, but python side approved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
cc0430e

Motivation and Context
Improve consistency and maintainability of HTTP request validation in the .NET and Python SDKs.
Description
Contribution Checklist