security: extend credential redaction to mysql -p<password> and PG* env-var idioms
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- mysql, postgresql, typescript
Research direction
Start in packages/opencode/src/session/compaction.ts and read how redactLedgerDetail and maskString use the existing credential-flag catalog, especially the #1246-style patterns. Find the existing regression tests for credential redaction and add cases for mysql -psecret, mysqldump -uroot -psecret, and PGPASSWORD=secret psql. Done means those idioms are masked without regressing the existing redaction cases.
Written by the indexing model from the issue text.
Description
Summary
#1246 closed a specific credential leak in ledger text: curl -u <user> <password> (space-separated) surviving redactLedgerDetail/maskString and getting persisted into a model prompt across session compaction. The fix is correct and well-tested for that exact idiom, but scoped narrowly to USER_FLAG_RE (curl-specific -u/--user) plus generic name=value / --flag=value / colon-shaped patterns.
Two sibling credential idioms in the same risk class are not caught by the current catalog in packages/opencode/src/session/compaction.ts:
- MySQL client unseparated flag+value:
mysql -psecret/mysqldump -uroot -psecret— no=, no space, no colon between flag and value. NeitherUSER_FLAG_REnor the generic patterns match this shape. - Env-var-assigned credentials with no separator character before the sensitive name:
PGPASSWORD=secret psql ...is not flagged as sensitive becauseSENSITIVE_NAME's boundary requirement ((?:^|[_-])password(?:$|[_-])) requires a_/-immediately before "password" —PGPASSWORDhas neither.
Neither is new in this release; #1246 just closed one specific case, and its commit message framed it as closing "a curl -u credential leak" rather than the broader class.
Proposed fix
Sweep the full redactLedgerDetail/maskString credential-flag catalog for common CLI credential idioms (mysql, psql/PG* env vars, and any other unseparated -X<value> or unconventional env-var-name patterns) and extend the regex catalog + add regression tests per idiom, following the same pattern as the #1246 fix.
Provenance
Found during the v0.11.0 stable release's Chaos Gremlin (privacy/compliance) persona review, verified by reading packages/opencode/src/session/compaction.ts.
- Dominant language
- TypeScript
- Stars
- 813
- Forks
- 134
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 65
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AltimateAI/altimate-code
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
AltimateAI/altimate-code#1359 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AltimateAI/altimate-code#1323 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
AltimateAI/altimate-code#1288 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
AltimateAI/altimate-code#1285 ·
-
privacy: Altimate Base consent dialog no longer discloses persistent per-installation identifier Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
AltimateAI/altimate-code#1284 ·
All issues in AltimateAI/altimate-code
Similar issues
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Crush Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ElementsProject/cln-application#167 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Quantco/pnpm-licenses#17 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100