Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Closed
#281 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #334 by @iceboundrock — merged

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli, security, testing

Research direction

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.

Written by the indexing model from the issue text.

Description

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).
Dominant language
Python
Stars
0
Forks
0
Avg merge
5h 57m
Merged PRs (30d)
71

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from iceboundrock/AutoForge

All issues in iceboundrock/AutoForge

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.