Validate proxy baseUrl against server security policy - #861
Open
lirenjie95 wants to merge 4 commits into
Open
lirenjie95 wants to merge 4 commits into
lirenjie95 wants to merge 4 commits into
Conversation
lirenjie95
force-pushed
the
fix/proxy-base-url-validation
branch
from
August 21, 2026 03:18
9bf355c to
d6a33a8
Compare
- Delegate to scriptutils.ValidateScriptFolderURL instead of re-implementing the parse+scheme+ValidateURLHost sequence - Restore TestNoServer intent: whitelist loopback and use a real closed port so it exercises connection-refused again - Add TestProcessRejectsForbiddenBaseUrl pinning that Process rejects a forbidden baseUrl with BadConfig before any request
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.
Fixes #849
Validate the proxy stage provider's baseUrl before issuing any request:
This is a defense-in-depth measure aligned with the discussion in the issue.
Note: redirect re-validation is not included in this change to avoid broad modifications to the shared callRestAPI/auth path; it can be added as a follow-up if needed.
Review follow-ups (loop-code-review, commit 2bbebde)
Addressed all review nits from independent agent review passes (final score 10/10):
validateProxyBaseUrlnow delegates to the existingscriptutils.ValidateScriptFolderURLinstead of re-implementing the parse + scheme +ValidateURLHostsequence (behavior-identical: same http/https-only scheme rules,BadConfigstate preserved).TestNoServerintent restored: whitelists loopback and dials a real closed port, so it exercises the connection-refused path again instead of short-circuiting at host validation.TestProcessRejectsForbiddenBaseUrl: pins the wiring —Processrejects a forbidden baseUrl (127.0.0.1, nil policy) withBadConfigbefore any HTTP request is issued.Verification (Go 1.27): build + vet clean; full proxy/http test suite PASS including an independent rerun of every touched test with log-level confirmation.
Known deferrals (unchanged): redirect re-validation and CRD-side validation remain follow-ups; issue #849 should stay open until those land.