Repository navigation
fix(plugin): block SSRF to private and metadata hosts in tool HTTP calls - #2758
Open
BetterAndBetterII wants to merge 1 commit into
Open
BetterAndBetterII wants to merge 1 commit into
BetterAndBetterII wants to merge 1 commit into
Conversation
Plugin tool execution built requests from attacker-controlled server URLs with no scheme or destination checks. Restrict to http/https, reject loopback/private/link-local/CGNAT/metadata addresses, and re-validate at dial and redirect time. Fixes coze-dev#2711
BetterAndBetterII
requested review from
N3kox,
fanlv,
hi-pender,
junwen-lee,
liuyunchao-1998,
lvxinyu-1117,
mrh997 and
shentongmartin
as code owners
August 31, 2026 00:30
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.
Summary
Plugin tool HTTP invocation built requests from attacker-controlled server/path values with no scheme check and no private/metadata IP blocking, so any authenticated user could reach internal-only hosts (loopback, RFC1918, link-local metadata, CGNAT) and non-HTTP schemes via tool execution / Test Run.
This change:
http/https100.64.0.0/10) addresses (including IPv4-mapped forms)Fixes #2711
Test plan
cd backend && go test ./domain/plugin/service/tool/ -count=1