[LAUNCH-E F2, High] Redact step-outcome results before JSON serialization: escaped credentials reach the terminal and worker logs
I maintainer di solito rispondono entro 1 giorno
Una pull request collegata è già stata integrata.
- #334 di @iceboundrock — integrata
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Start with src/autoforge/cli.py at print_step_outcome and inspect the structured redaction helper, then trace the worker log path in src/autoforge/worker.py and src/autoforge/scheduler.py. Add focused tests for escaped characters, nested values, captured output, and persisted logs using dummy credentials; audit the other serialized-text call sites listed in the issue. Done means recognized credentials are redacted before serialization at applicable call sites and make check passes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Artifact: implementation-ready security issue, finding F2 of the LAUNCH-E security audit (#257, PR #279). This issue body is the authoritative copy; it was drafted from the audit report in the PR #279 description and is not kept elsewhere. Audited commit: 388ecb3b9d6376f8914054cc06ea5e5caab164da (main); line numbers below are at that commit.
Parent: #255 · Audit: #257 · Audit PR: #279 · Priority: P0 · Gate: 5 (Security) · Blocks: the Public Alpha launch (#255 Gate 5) · Blocked by: nothing
Proposed severity: High (the audit's proposal under #257's rubric; the maintainer's confirmation or change is recorded on #257, not here).
Summary
cli.print_step_outcome redacts the agent result after serializing it to JSON: redact(f" result={json.dumps(o.result, sort_keys=True)}"). JSON escaping places a word character directly before a value that follows a newline, tab or non-ASCII character (\n, \t, é), so credential patterns anchored on a word boundary no longer match, and a recognised token is printed in clear. The line goes to the terminal and to the scheduler worker's persisted log. This contradicts docs/agent-guides/secrets-and-logging.md (#206): structures are redacted string by string, never as serialized text.
Evidence (at 388ecb3)
src/autoforge/cli.py:2825:print_step_outcomeredacts the serialized JSON.src/autoforge/worker.py:46-48,288-291andsrc/autoforge/scheduler.py:1061-1063: the worker's output, including these lines, is persisted to its log.- Reproduced by the audit with a dummy
ghp_token and with aGH_TOKEN=assignment, and re-checked independently with dummy values: a dummy token preceded by a newline, a tab or a non-ASCII character in a result string survivesredact(json.dumps(...)); the same token after a space is redacted.
Required remediation
- Redact structured values before serialization: render
json.dumps(redact_obj(o.result), sort_keys=True)(or the repository's existing structured redaction helper), so each string is redacted on its own. - Audit the other places that redact serialized JSON or other escaped text (for example the dry-run plan,
status --json, scheduler/worker state and log lines) and fix any that share the defect; list what was checked in the PR. - Keep the redaction invariants (
MAX_GROWTH_FACTOR, idempotence) intact.
Acceptance criteria
- No credential of a recognised class in an agent result reaches the terminal or a persisted worker or scheduler log, whatever characters precede it inside a string.
- Every call site found in remediation step 2 redacts before serializing, or is shown not to carry agent or state text.
-
docs/agent-guides/secrets-and-logging.mdstays accurate. -
make checkpasses.
Tests
print_step_outcomewith a result whose strings contain a dummy token directly after\n,\t,\r, a quote, a backslash, and a non-ASCII character (whichjson.dumpsturns into a\uXXXXescape): the dummy token is absent from captured stdout.- The same through a scheduler worker: the dummy token is absent from the persisted worker log file.
- Nested structures (lists in dicts) and non-string values are preserved apart from redaction.
- Use dummy values only; no real credential in any test.
Out of scope
- New credential classes (F3 covers Google API keys; the remaining shapes are the Medium follow-up for audit M4, #285; a recognised token after an ANSI escape is F5, #284).
- Lingua principale
- Python
- Stelle
- 0
- Fork
- 0
- Merge medio
- 5h 57m
- PR unite (30g)
- 71
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di iceboundrock/AutoForge
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
iceboundrock/AutoForge#304 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
iceboundrock/AutoForge#333 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
iceboundrock/AutoForge#332 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 1/100
iceboundrock/AutoForge#331 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
iceboundrock/AutoForge#329 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di iceboundrock/AutoForge
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sylvainmetayer/homelab#851 ·
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Add `ty-pre-commit` hookAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
kubeflow/docs-agent#279 ·
I maintainer di solito rispondono entro 3 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
Qiskit/qiskit-ibm-runtime#3523 ·
I maintainer di solito rispondono entro 1 giorno