T09 · Insecure Skill Coding Practices
- Location
SKILL.md:55- Finding
Operator API key stored without restrictive filesystem permissions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:55-60
Vulnerability Type: Insecure storage of bearer credentials
Risk Level: MediumVulnerable Code
bash mkdir -p ~/.operator python3 -c " import json config = {'operatorApiKey': 'THE_KEY', 'operatorAppUrl': 'https://www.operator.io'} with open('$HOME/.operator/config.json', 'w') as f: json.dump(config, f, indent=2)Technical Analysis
The instructions store the Operator bearer API key in a plaintext JSON file but do not set restrictive permissions on either
~/.operatoror~/.operator/config.json.mkdir -pand Python's default file-creation behavior rely on the user's currentumask. With a common022umask, the directory can be created as0755and the configuration file as0644, allowing other local accounts to read the API key. The instructions also do not verify that the path is owned by the current user, is not a symbolic link, and has safe existing permissions.This credential handling is particularly sensitive because the documented API supports instance lifecycle operations, configuration changes, workspace file access, secret grants, automations, and webhooks.
Attack Path
- The user follows the login instructions.
- The commands create
~/.operator/config.jsonunder a permissiveumask. - The plaintext
operatorApiKeybecomes readable by another local account or process. - The attacker copies the bearer token.
- The attacker submits authenticated requests to the Operator API.
- The attacker performs whichever fleet-management operations are authorized to that API key.
An attacker who can prepare an unsafe existing path may also attempt symbolic-link or ownership-based manipulation when the file is written.
Impact Assessment
Theft of the key can provide remote access to the user's Operator account within the key's authorization scope. Potential consequences include:
- Listing, crea ...[truncated 414 chars]
- Remediation
View remediation
Remediation Suggestions
-
Create the credential directory with mode
0700, for example:bash install -d -m 700 "$HOME/.operator" -
Create the credential file atomically with mode
0600. -
Set a restrictive
umask, such as077, before creating credential files. -
Verify that the directory and file are owned by the current user.
-
Refuse to read or overwrite symbolic links and files with unsafe ownership or permissions.
-
Prefer an operating-system credential store or keychain over a plaintext JSON file.
-
If a file must be used, separate sensitive credentials from non-sensitive configuration.
-
Document API-key rotation and immediate revocation procedures for suspected disclosure.
-
