Repository navigation
Python: fix(security): block link-local and RFC1918 SSRF targets in OpenAPI p… - #14775
Closed
Nguyễn Xuân Thịnh (thinhnx128) wants to merge 1 commit into
Closed
Nguyễn Xuân Thịnh (thinhnx128) wants to merge 1 commit into
Nguyễn Xuân Thịnh (thinhnx128) wants to merge 1 commit into
Conversation
…lugin server_url override (CWE-918)
Nguyễn Xuân Thịnh (thinhnx128)
requested a review
from a team
as a code owner
November 10, 2026 13:22
Nguyễn Xuân Thịnh (thinhnx128)
deployed
to
github-app-auth
November 10, 2026 13:23 — with
GitHub Actions
Active
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The SSRF test exercises only a local validator, so it cannot detect removed or bypassed production checks; it needs runner-level HTTPS cases asserting FunctionExecutionException and no HTTP request.
1 open issue
What changed in this PR
This PR aims to protect OpenAPI plugin server URL overrides from server-side request forgery (SSRF). The changes add test-local validation and assertions; production validation is unchanged.
Changes:
- Adds a local validator for URL schemes, internal hosts, and non-public IP addresses.
- Adds rejection checks for metadata and loopback addresses, plus an acceptance check for a public hostname.
| File | Description |
|---|---|
python/tests/unit/connectors/openapi_plugin/test_openapi_server_url_ssrf_guard.py |
Adds a standalone URL validator and SSRF-focused test assertions. |
Review effort: Balanced
Comment on lines
+30
to
+34
| def test_blocks_aws_azure_imds_link_local_and_private_cidr(): | ||
| with pytest.raises(ValueError, match="Blocked non-public IP"): | ||
| validate_openapi_server_url("http://169.254.169.254/latest/meta-data/") | ||
| with pytest.raises(ValueError, match="Blocked non-public IP"): | ||
| validate_openapi_server_url("http://127.0.0.1:8080/admin") |
Nguyễn Xuân Thịnh (thinhnx128)
deleted the
fix/cwe-918-openapi-server-url-allowlist
branch
November 10, 2026 14:28
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

…lugin server_url override (CWE-918)
Motivation and Context
Description
Contribution Checklist