Plaintext Forgejo API token committed to .env in workspace #1
Labels
No labels
shellcheck
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
bc1bb/claude-code-audit#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The
.envfile contains a real, production Forgejo API token in plaintext:FORGEJO_ACCESS_TOKEN=.... While.gitignoreuses the*exclusion pattern to prevent this file from being committed to git, the secret is stored unprotected on disk in plaintext and is readable by any process or user with filesystem access to the workspace.Location
.env, line 3Risk
Any process running on the host or any user with read access to
$HOME/audit-workspace/can read the token. Since this token is used to create/list issues and interact with the Forgejo API withdontAskpermissions enabled in the audit, a leaked token grants an attacker full API access to the Forgejo instance — including reading private repos, creating/deleting issues, and modifying content. The risk is amplified by the fact that the.gitignoreprotection can be bypassed with a singlegit add -f .env.Suggested fix direction
Store the token using a secrets manager (e.g.,
pass,age, OS keychain) or inject it at runtime via a systemd credential or environment variable from a secrets vault rather than writing it to a plaintext file. At minimum, restrict file permissions to600(chmod 600 .env) and document this requirement explicitly.Severity
critical
Found by
Automated audit by Claude Code
adressed