T09 · Insecure Skill Coding Practices
- Location
scripts/sync_training_plan.mjs:55- Finding
Garmin Credentials Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/sync_training_plan.mjs:55-59
Additional Location:SKILL.md:123-131
Vulnerability Type: Sensitive credential exposure through process arguments
Risk Level: Mediumjavascript } else if (token === "--garmin-email") { args.garminEmail = argv[++i] ?? null; } else if (token === "--garmin-password") { args.garminPassword = argv[++i] ?? null; }The documented invocation explicitly encourages passing the Garmin password on the command line:
bash node {baseDir}/scripts/sync_training_plan.mjs \ --auth-source credentials \ --garmin-email "user@example.com" \ --garmin-password "***" \ --file garmin_tracking.json \ --writeTechnical Analysis
The script reads the Garmin password directly from
process.argv. Command-line arguments are not an appropriate secret transport mechanism because they may be exposed through:- Process inspection utilities and operating-system process metadata.
- Shell command history.
- Terminal session recording and command telemetry.
- Process supervisors, audit systems, and diagnostic reports.
- Wrapper scripts or automation logs that record the full invocation.
The password remains referenced by the
argsobject throughout the process lifetime. Although the reviewed code does not intentionally write it to the tracking file or standard output, using command-line arguments unnecessarily broadens its exposure.Attack Path
- The user follows the credentials fallback example in
SKILL.md. - The Garmin email and password are included in the shell command.
- The command is retained in shell history, captured by telemetry, or exposed through process inspection while the script runs.
- A local user, monitoring process, compromised extension, or later reader of the command history retrieves the credentials.
- The attacker uses those credentials to attempt access to the vi ...[truncated 522 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the
--garmin-passwordcommand-line option and its documentation. - Prefer the existing authenticated browser-session workflow.
- If credential authentication must remain available, obtain the password through a non-echoing interactive prompt or a protected file descriptor.
- For unattended execution, integrate with an operating-system credential store or approved secret manager rather than environment variables or command arguments.
- Keep the credential in the smallest possible scope and overwrite or release references immediately after the login attempt.
- Document that credentials must never be placed in shell history, configuration files, logs, or tracking data.
- Consider disabling credential-based fallback by default and requiring an explicit operator-controlled policy to enable it.
- Remove the
