Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[LAUNCH-E F2, High] Redact step-outcome results before JSON serialization: escaped credentials reach the terminal and worker logs

Chiusa
#281 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
cli, security, testing

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

bug

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_outcome redacts the serialized JSON.
  • src/autoforge/worker.py:46-48,288-291 and src/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 a GH_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 survives redact(json.dumps(...)); the same token after a space is redacted.

Required remediation

  1. 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.
  2. 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.
  3. 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.md stays accurate.
  • make check passes.

Tests

  • print_step_outcome with a result whose strings contain a dummy token directly after \n, \t, \r, a quote, a backslash, and a non-ASCII character (which json.dumps turns into a \uXXXX escape): 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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di iceboundrock/AutoForge

Tutte le issue di iceboundrock/AutoForge

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.