[LAUNCH-E F3, High] Recognise Google API keys (AIza...) in redaction and the published-content check
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #336 by @iceboundrock — merged
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start with the pattern table in src/autoforge/redaction.py and trace how redact and credential_classes apply patterns; then read the published-content and commit-message checks in src/autoforge/result_parser.py. Add coverage in tests/test_redaction.py and tests/test_result_parser.py, and update docs/security.md and docs/agent-guides/secrets-and-logging.md. Done means the dummy key is redacted and refused across the listed checks, the growth-bound tests hold, and make check passes.
Written by the indexing model from the issue text.
Description
Artifact: implementation-ready security issue, finding F3 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
Google API keys (the AIza prefix followed by 35 URL-safe characters) are recognised neither by redaction.py nor by the published-content check that is built on credential_classes. OpenCode launches inherit GEMINI_* and GOOGLE_* by default, so in a documented configuration an agent that prints its environment puts the key into the launch's stdout.log or stderr.log in clear, and agent-authored text carrying such a key passes the check and can be published on GitHub under the operator's identity.
Evidence (at 388ecb3)
src/autoforge/redaction.py(pattern table near lines 44-104): no pattern for theAIzashape; independently re-checked with a dummy value, whichredactreturns unchanged.src/autoforge/providers.py:1466:OpenCodeProvider.environment_namesincludesGEMINI_*andGOOGLE_*.src/autoforge/result_parser.py:680-765,:804-830: the published-content and commit-message checks refuse only the classescredential_classesreports.docs/usage.md: the OpenCode environment names. PR #279 discloses the gap indocs/security.md; disclosure does not resolve this issue (#257 acceptance criterion 2).
Required remediation
- Add a Google API key class to
redaction.py(shape:AIzaplus 35 characters of[0-9A-Za-z_-]), so thatredactandcredential_classesboth recognise it, and therefore the published-content check, the payload and Markdown checks and the commit-message check refuse it. - Preserve the bounded-redaction invariants:
MAX_GROWTH_FACTORand the tests that depend on it, idempotence, and no catastrophic backtracking. - Make sure the new class is also matched where F2's word-boundary problem applies once F2 is fixed (do not reintroduce a boundary that an escape defeats).
- Update
docs/security.mdanddocs/agent-guides/secrets-and-logging.mdto list the class.
Acceptance criteria
- A dummy
AIzakey is redacted in run logs,stdout.log/stderr.log, state and CLI output, and is reported bycredential_classes. - Agent text carrying one is refused by every published-content check and by the commit-message check (refused, not rewritten, as for the other classes).
- The redaction growth bound and its tests still hold.
-
make checkpasses.
Tests
tests/test_redaction.py: the shape alone, in an assignment (GEMINI_API_KEY=...,GOOGLE_API_KEY=...), in JSON, in a URL query string, and at the start and end of a line; a near-miss (wrong length, wrong prefix) is not redacted.tests/test_result_parser.py:published_text_problem,published_payload_problem,published_markdown_problemandcommit_message_problemrefuse a dummy key.- Use dummy values only; no real credential in any test.
Out of scope
- The other unrecognised shapes listed under audit M4 (AWS, PEM blocks,
gsk_,xai-,npm_,glpat-,hf_); they are the M4 follow-up, #285. - Narrowing OpenCode's inherited
GOOGLE_*names (audit L2).
- 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
-
link-rot
Difficulty 1/5 Under an hour Newbie friendliness 67/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
developmentseed/titiler-cmr#265 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Insecure Brotli version <1.2.1Possibly taken @jamescw19 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
stac-utils/stac-fastapi-pgstac#438 · 1 reaction ·
-
bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day