test(handlers): add SaaS-mode wrapper tests for isSafeURL and validateAgentURL - #2021
Closed
molecule-ai[bot] wants to merge 1 commit into
Closed
test(handlers): add SaaS-mode wrapper tests for isSafeURL and validateAgentURL#2021molecule-ai[bot] wants to merge 1 commit into
molecule-ai[bot] wants to merge 1 commit into
Conversation
…eAgentURL Issue #1786: SSRF test gap — inner helpers (isPrivateOrMetadataIP, validateAgentURL blockedRanges) were tested in isolation but the public wrappers never called saasMode(), allowing the regression to pass unit tests while production returned 502 on every A2A call from Docker/VPC deployments (PR #1785). Adds integration-level wrapper tests for both functions across all saasMode() resolution ladder cases: - SaaS explicit (MOLECULE_DEPLOY_MODE=saas): RFC-1918 + fd00 ULA allowed - Strict mode (MOLECULE_DEPLOY_MODE=self-hosted): RFC-1918 blocked - Legacy org-ID fallback (MOLECULE_ORG_ID set, no DEPLOY_MODE): RFC-1918 + fd00 ULA allowed - Always-blocked ranges (metadata, loopback, TEST-NET, CGNAT, fc00 ULA) stay blocked in every mode Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
molecule-ai
Bot
force-pushed
the
test/ssrf-saas-mode-wrapper-tests
branch
from
April 24, 2026 15:44
1cf974c to
9ad5ca3
Compare
Contributor
Author
|
Closing as superseded — staging already contains every change in this PR:
All changes will reach main via PR #1981 (staging→main promotion). No separate merge needed. |
molecule-ai Bot
pushed a commit
that referenced
this pull request
Apr 24, 2026
PR #2021 follow-up: add TEST-NET reserved ranges and IPv6 documentation prefix to validateAgentURL blocklist in all SaaS/self-hosted modes. RFC 5737 reserves 192.0.2.0/24, 198.51.100.0/24, and 203.0.113.0/24 for documentation and example code — no production agent has a legitimate reason to use them. RFC 3849 designates 2001:db8::/32 as the IPv6 documentation prefix. All are blocked unconditionally. Also adds 8 regression test cases covering each blocked range. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Cherry-picked from PR #1805 (staging).
Adds integration-level wrapper tests that exercise isSafeURL (the public API) rather
than just isPrivateOrMetadataIP (the inner helper). Previously the inner helper's
SaaS-mode tests were green while isSafeURL hardcoded RFC-1918 rejection — causing
502s on every A2A call from Docker-networked / VPC deployments (issue #1785).
Tests added:
Rebased on origin/staging alongside DevMode tests from staging.