T09 · Insecure Skill Coding Practices
- Location
scripts/restaurant_inspection.py:264- Finding
Application Secret Exposed Through Command-Line Arguments
- Content
View full analysis
Vulnerability Details
File Location:
scripts/restaurant_inspection.py:264-269
Vulnerability Type: Sensitive credential exposure through process arguments
Risk Level: MediumComplete Code Snippet
python if len(sys.argv) >= 4: app_key = sys.argv[1] app_secret = sys.argv[2] device_serial = sys.argv[3] if len(sys.argv) >= 5: channel_no = sys.argv[4]Technical Analysis
The script accepts the Ezviz application secret as a positional command-line argument. Command-line arguments can be exposed through shell history, process inspection utilities, endpoint monitoring systems, CI/CD job metadata, diagnostic reports, and command logging.
Accepting the secret this way is unnecessary because the implementation already supports the
EZVIZ_APP_SECRETenvironment variable. The project documentation also explicitly advertises the insecure command-line invocation method.Attack Path
- A user starts the Skill with the documented positional arguments, including the Ezviz application secret.
- The secret becomes part of the process command line and may also be stored in shell history or execution logs.
- A local user, monitoring agent, log reader, or other process with permission to inspect process metadata obtains the secret.
- The attacker combines the secret with the associated application key.
- The attacker requests an access token from the Ezviz API and invokes APIs allowed by the compromised credentials.
Impact Assessment
Disclosure can allow unauthorized use of the Ezviz application identity. The resulting access is bounded by the permissions assigned to the application credentials, but may include token acquisition, camera image capture, device identifier access, intelligent-agent management, and image analysis. This may expose restaurant surveillance imagery and permit consumption of account quotas or creation of unwanted intelligent agents.
- Remediation
View remediation
Remediation Suggestions
- Remove support for passing
app_secretas a positional command-line argument. - Require secrets to be supplied through a protected secret manager or environment variable.
- For interactive use, optionally obtain the secret with Python's
getpassmodule so it is not echoed or placed in shell history. - Update
SKILL.mdto remove command examples containing secrets as positional arguments. - Ensure CI/CD systems inject credentials through masked secret variables.
- Recommend narrowly scoped Ezviz credentials and regular credential rotation.
- Document an incident-response procedure for revoking credentials that may already have appeared in process logs or shell history.
- Remove support for passing
