Repository navigation
fix: harden redirects, trace redaction, and custom-policy limits - #869
Merged
Merged
Conversation
ewhauser
enabled auto-merge (squash)
October 19, 2026 17:53
Merged
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 five verified findings from the security review in
network/,policy/,internal/runtime/, and the top-level package.User-visible behavior
network): matches curl. A301/302/303rewrites any method other thanGET/HEADinto a body-lessGET(droppingContent-*headers);307/308keep method and body.Authorization,Proxy-Authorization,Cookie, andCookie2are only sent to hops on the initial request's origin (scheme + host + port, default ports normalized). Previously a 303 to another allowed origin leaked the bearer token and POST body.TraceRedacted): now strips URL userinfo (https://[REDACTED]@host/); handles attached-uuser:pass/-H…, short-flag groups ending in a value flag (-su user:pass,-sH …), and--proxy-user/-U; matches secret-looking header/query/form names broadly (containstoken,secret,passw,auth,cookie,session, …, or akey/sigcomponent, e.g.PRIVATE-TOKEN,X-Goog-Api-Key); redacts secretkey=valuepairs and JSON string members in-d/--data*/-F/--jsonbodies.PolicywhoseLimitsfields are zero used to disable every cap (including the stdout capture cap). Zero fields now inherit the runtime defaults; the newpolicy.Unlimited(-1) explicitly disables a single limit (custom policies andLimitOverrides), reported as0bySession.Limits(). The merge is reflection-based so newpolicy.Limitsfields are picked up automatically, and a test asserts every field has a default.1instead of the realunix.Getpgrp()(whichbash -iprinted on Linux without a tty). Onlyhost.NewSystem()exposes the host value.StdoutSpillTruncated/StderrSpillTruncatedongbash.ExecutionResult, the runtime result, andcommands.ExecutionResult, set when a spill file is cut short atMaxSpillBytes.SPEC updates
Small localized edits: redirect semantics (§12 network), default-limit inheritance and
policy.Unlimited(§12), redaction coverage (§13), virtual host metadata, and spill truncation reporting.Testing
httptest-server redirect tests, table-drivenredactArgvtests plus an end-to-end trace test, custom-policy limit tests, process-group tests through the public API, spill truncation tests at buffer/runtime/public levels).go test ./network/... ./internal/runtime/... . ./policy/...passes;make lintclean (0 issues).