T09 · Insecure Skill Coding Practices
- Location
scripts/sentry_issues.py:27- Finding
Sentry API Token Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/sentry_issues.py:27-30,159; documented inSKILL.md:18-19,42
Vulnerability Type: Command-line credential exposure
Risk Level: MediumThe Skill allows users to provide a Sentry authentication token directly through the
--tokencommand-line option.python def get_auth_token(token_arg): """Get auth token from argument or environment.""" if token_arg: return token_arg token = os.environ.get("SENTRY_AUTH_TOKEN")python parser.add_argument("--token", help="Auth token (or set SENTRY_AUTH_TOKEN)")The insecure option is also explicitly documented:
markdown Set the `SENTRY_AUTH_TOKEN` environment variable, or pass `--token` to the script.markdown - `--token`: Auth token (defaults to `SENTRY_AUTH_TOKEN` env var)Technical Analysis
Command-line arguments may be exposed through process-inspection facilities, shell history, command auditing, terminal capture, orchestration metadata, diagnostic tooling, and wrapper-script logs. Consequently, invoking the script as
--token TOKEN_VALUEcan disclose the Sentry Bearer token to other local principals or monitoring systems that can observe process arguments or execution records.Once obtained, the token can be replayed directly against the Sentry API. The script correctly sends the credential only to the fixed HTTPS endpoint
https://sentry.io/api/0; no transmission to an unrelated host was identified. The vulnerability is therefore the command-line secret input mechanism rather than the authenticated Sentry network request itself.Attack Path
- A user follows the documented interface and invokes the script with
--token TOKEN_VALUE. - The plaintext token becomes part of the process command line and may also be retained in shell history or execution logs.
- A local user, administrator, monitoring service, or log reader with access to those ...[truncated 915 chars]
- A user follows the documented interface and invokes the script with
- Remediation
View remediation
Remediation Suggestions
- Remove the value-bearing
--tokenargument so credentials cannot be supplied in the process command line. - Prefer
SENTRY_AUTH_TOKENsupplied through a trusted secret manager or protected runtime environment. - If interactive credential entry is required, use a non-echoing prompt such as Python's
getpass.getpass()or accept the token through standard input with clear protections against logging. - For automated use, support a credential file whose permissions are restricted to the owning user, validate those permissions before reading it, and avoid including its contents in errors.
- Update
SKILL.mdto remove the recommendation to pass tokens through--tokenand document the safer credential-loading procedure. - Continue using narrowly scoped Sentry tokens. Retain only the documented
project:readandevent:readpermissions unless additional permissions are strictly necessary. - Revoke and rotate any token previously supplied through command-line arguments if command histories, process telemetry, or execution logs may have retained it.
- Ensure exceptions and diagnostic logs never print request headers or token values.
- Remove the value-bearing
