T09 · Insecure Skill Coding Practices
- Location
cli.py:22- Finding
TOTP Secret Exposure Through Command-Line Arguments
- Content
View full analysis
--issuer --digits 6 --period 30` ``` ### Technical Analysis The application accepts a TOTP seed as a positional command-line argument. Command-line arguments are not an appropriate channel for authentication secrets because they may be exposed through: - Shell history files. - Process inspection utilities while the command is running. - Operating-system process accounting or auditing. - Terminal session recording and command telemetry. - Diagnostic logs that capture executed command lines. A TOTP seed is a long-lived credential rather than a single-use code. Anyone who obtains it can generate future valid codes for the associated account, subject only to the configured time period and clock synchronization. ### Attack Path 1. A user follows the documented command and runs `python3 cli.py add account BASE32_SECRET`. 2. The shell records the complete command in its history, or a local process-monitoring facility captures the process arguments. 3. An attacker with access to that history, telemetry, or process information extracts the Base32 seed. 4. The attacker imports the seed into another TOTP implementation. 5. The attacker generates valid current and future TOTP codes and uses them with separately obtained account credentials. ### Impact Assessment Successful exploitation discloses the second-factor seed for the account being added. The a ...[truncated 316 chars]- Remediation
View remediation
