[LAUNCH-E F2, High] Redact step-outcome results before JSON serialization: escaped credentials reach the terminal and worker logs
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
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
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).
- 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
- 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 iceboundrock/AutoForge
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
iceboundrock/AutoForge#304 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
iceboundrock/AutoForge#333 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
iceboundrock/AutoForge#332 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 1/100
iceboundrock/AutoForge#331 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
iceboundrock/AutoForge#329 · 1 comment ·
Maintainers usually reply within 1 day
All issues in iceboundrock/AutoForge
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
NVIDIA/flare-local-inference#90 ·
Maintainers usually reply within 1 day
-
area/streaming comp/gateway P2 platform/telegram type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#144897 ·
Maintainers usually reply within 1 day
-
request-theme
Difficulty 1/5 Under an hour Newbie friendliness 66/100
LizardByte/ThemerrDB#9575 ·
Maintainers usually reply within 1 day
-
author-page correction
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
acl-org/acl-anthology#10599 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
zilliztech/memsearch#818 ·
Maintainers usually reply within 1 day