T09 · Insecure Skill Coding Practices
- Location
SKILL.md:43- Finding
Long-lived Amazon credentials are stored in a plaintext home-directory file
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:43-47; duplicated inREADME.md:20-27
Vulnerability Type: Plaintext sensitive credential storage
Risk Level: MediumVulnerable Code or Instructions
SKILL.md:43-47:bash ### 3. Credentials speichern ```bash echo 'AMAZON_ACCESS_KEY=AKIA...' >> ~/.env echo 'AMAZON_SECRET_KEY=...' >> ~/.env echo 'AMAZON_PARTNER_TAG=deinname-21' >> ~/.envtext Equivalent instructions appear in `README.md:20-27`: ```markdown ## Setup 1. Bei https://affiliate-program.amazon.de/ anmelden 2. Zu "Produktwerbung-API" navigigieren 3. Credentials generieren 4. In `.env` speichern:AMAZON_ACCESS_KEY=AKIA... AMAZON_SECRET_KEY=... AMAZON_PARTNER_TAG=jensbuermann-21
text Technical Analysis
The installation instructions direct users to append long-lived Amazon access credentials to a plaintext file under the home directory. They do not require restrictive permissions, such as mode
0600, or recommend a protected operating-system credential store.The use of repeated append operations also leaves previous or duplicate credentials in place. Rotation therefore may not reliably remove obsolete secrets. Additionally, the implementation does not load
~/.envitself, meaning the documented storage procedure does not make the variables available unless a separate process sources or exports the file.The exposure depends on local filesystem permissions and the security of the user's account. The instructions do not themselves transmit the credentials over the network.
Attack Path
- A user follows the documented setup procedure.
- The Amazon access key and secret key are written to
~/.envas plaintext. - The file retains default or pre-existing permissions because the instructions do not enforce restrictive access.
- A malicious local process, another account with applicable read access, a compromised backup process, or malware operating as the user reads the file.
- The attacker e ...[truncated 713 chars]
- Remediation
View remediation
Remediation Suggestions
- Store long-lived credentials in an operating-system credential manager or another purpose-built secret store.
- If a file must be used, place it in a dedicated configuration directory and create it with restrictive permissions before writing secrets:
bash umask 077 install -m 600 /dev/null ~/.config/amazon-paapi/credentials.env- Avoid repeated
>>append operations. Use an atomic configuration update that replaces obsolete credentials and preserves restrictive permissions. - Explicitly load the documented credential source or clearly document how variables must be exported.
- Ensure credential files are excluded from source control, logs, diagnostics, backups where inappropriate, and command output.
- Recommend narrowly scoped credentials and provide explicit rotation and revocation procedures.
- Remove real-looking partner identifiers and secret examples from documentation where they could be mistaken for active values.
