Skip to content

trace2: redact signatures from HTTP(S) URLs - #79

Open
ttaylorr-oai wants to merge 3 commits into
codexfrom
dr/codex/trace2-redact-url-signatures
Open

trace2: redact signatures from HTTP(S) URLs#79
ttaylorr-oai wants to merge 3 commits into
codexfrom
dr/codex/trace2-redact-url-signatures

Conversation

@ttaylorr-oai

@ttaylorr-oai ttaylorr-oai commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Trace2 removes HTTP(S) URL passwords but leaves signed query parameters in several trace paths. Redact sig, signature, and names ending in -signature in URL arguments, error events, and alias events. Keep command arguments, stderr, and GIT_TRACE2_REDACT=0 working as before.

Keep the existing error callback and va_list contract. Each target redacts its formatted payload; JSON retains separate msg and fmt fields. Query names use Git's parameter decoder and ASCII case folding. Error redaction covers complete signature values and adjacent or nested URLs.

Validation: t0212-trace2-event.sh passes with a developer build on macOS.

The three commits are based on master at b8242b0. The PR targets codex for stable-topic review; the action pins are separate in #80.

Supersedes #72 on dr/codex/trace2-redact-url-signatures.

@ttaylorr-oai ttaylorr-oai added kind:review-only Reviewed topic; do not merge this pull request build:codex-stable Production Codex Git build labels Sep 2, 2026
@ttaylorr-oai
ttaylorr-oai force-pushed the dr/codex/trace2-redact-url-signatures branch 3 times, most recently from 042b556 to 7249010 Compare September 2, 2026 18:01
@ttaylorr-oai
ttaylorr-oai force-pushed the dr/codex/trace2-redact-url-signatures branch from 7249010 to 3c52d45 Compare September 2, 2026 18:14
@ttaylorr-oai
ttaylorr-oai force-pushed the codex branch 3 times, most recently from 809b7da to 777246e Compare September 9, 2026 00:14
dreynaud-oai and others added 3 commits September 9, 2026 18:18
Trace2 removes passwords from HTTP(S) URL arguments, but leaves query
signatures in the trace. A signed URL can therefore disclose an access
credential even when password redaction is enabled.

Redact nonempty values whose decoded parameter names are "sig",
"signature", or end in "-signature". Use the query-parameter decoder and
Git's ASCII case folding, while preserving the spelling of the URL and
unrelated query fields. Recognize HTTP(S) schemes case-insensitively,
and keep user information, the query, and the fragment separate.

Signed-off-by: Daniel Reynaud <dreynaud@openai.com>
Signed-off-by: Taylor Blau <ttaylorr@openai.com>
Transport errors can include a signed URL in the message passed to
error() or die(). Argument redaction does not cover these messages, so
a failed request can still record its password or signature in Trace2.

Have each target redact its formatted error payload. Keep the existing
va_list callback contract, including each target's use of va_copy(), so
the caller can still use the arguments when writing to stderr. Redact
the JSON target's separate format field as well, accounting for doubled
percent signs in literal query parameter names.

Use whitespace, double quotes, and angle brackets to delimit URLs in
error messages. Keep a trailing quote for a single-quoted token, but
treat other punctuation as part of the URL: an apostrophe inside a
signature is not a reliable delimiter. Continue scanning for adjacent
or nested URLs after redacting each match.

Signed-off-by: Daniel Reynaud <dreynaud@openai.com>
Signed-off-by: Taylor Blau <ttaylorr@openai.com>
trace2_cmd_alias_fl() passes its argument array directly to the targets.
A URL embedded in an ordinary alias definition, or passed through a
shell alias, can therefore appear in an alias event without the
redaction used for start, child_start, and exec events.

Redact the arguments before alias-event dispatch and release the
temporary array afterward.

Signed-off-by: Taylor Blau <ttaylorr@openai.com>
@ttaylorr-oai
ttaylorr-oai force-pushed the dr/codex/trace2-redact-url-signatures branch from 3c52d45 to 764f047 Compare September 9, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build:codex-stable Production Codex Git build kind:review-only Reviewed topic; do not merge this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants