Property
Languagerust
Severitymedium
CWECWE-807: Reliance on Untrusted Inputs in a Security Decision
Confidence LevelHigh
Impact LevelLow
Likelihood LevelLow

Description#

Using std::env::args() for security-related decisions is unsafe because command-line arguments can be easily manipulated by users and are not guaranteed to reflect the true executable path or intent. Relying on these values for authentication, authorization, or other security checks can introduce vulnerabilities.

Impact#

If an attacker can control or spoof command-line arguments, they might bypass security checks, gain unauthorized access, or cause the application to behave unexpectedly. This could lead to privilege escalation or unauthorized actions within the system.