fix(security): redact tool-command intel and reject non-http gbrain URLs - #1302
Open
siliangchen-amd wants to merge 2 commits into
Open
fix(security): redact tool-command intel and reject non-http gbrain URLs#1302siliangchen-amd wants to merge 2 commits into
siliangchen-amd wants to merge 2 commits into
Conversation
Specialist Bash summaries were clipped into the intel ledger without redact_secret_values, so bearer tokens and KEY= assignments landed in specialist_intel.jsonl. GbrainPageClient claimed to check the URL scheme before urlopen but never did. Redact before clipping. Construct-time require_http_url rejects file://; a bad GBRAIN_BASE_URL logs and returns None so explore still degrades. Co-authored-by: Cursor <cursoragent@cursor.com>
The Bearer redaction case used `curl -H 'Authorization: ...'`, which matches gitleaks curl-auth-header. Keep the same Bearer string without the curl wrapper so secret-scan can pass. Co-authored-by: Cursor <cursoragent@cursor.com>
CI E2E report — ✅ Succeeded
|
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.
Description
Two independent fixes.
API_KEY=assignments were stored verbatim._summarize_tool_input()now runsredact_secret_values()on the full string and then clips. Claude and Codex both go through this helper.GbrainPageClientdocumented thaturlopenwas only reached after a scheme check, but the check was never called.__init__now uses the existingrequire_http_url(). A badGBRAIN_BASE_URL(file://,ftp://) is logged and explore skips GBrain (the env builder returnsNone); constructing the client directly still raises.Linked issue(s)
None.
Tests
OPENAI_API_KEY=values are redacted in tool summaries, and redaction runs before clippingNoneforfile://201 passed on the targeted tests.
ruff check/ruff format --checkon the changed files passed.Breaking changes
No. Intel
querystrings may now contain[REDACTED]in place of credential values. A non-httpGBRAIN_BASE_URLskips GBrain instead of callingurlopen.