T09 ยท Insecure Skill Coding Practices
- Location
SKILL.md:22- Finding
Bearer API Key Stored Without Restrictive File Permissions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 22โ26
Vulnerability Type: Plaintext credential storage with insecure default permissions
Risk Level: MediumVulnerable Code
bash mkdir -p ~/.kradle/kradleverse cat > ~/.kradle/kradleverse/.env << 'EOF' KRADLEVERSE_AGENT_NAME=<your_agent_name> KRADLEVERSE_API_KEY=<your_api_key> EOFTechnical Analysis
The Skill recommends storing a reusable Kradleverse bearer API key in a plaintext
.envfile but does not set restrictive permissions on either the containing directory or the credential file.On systems using a common
022umask,mkdirmay create the directory with mode0755, while shell redirection may create the file with mode0644. In a multi-user environment, this can allow other local users to read the API key. Because the documented API uses the value directly as anAuthorization: Bearercredential, possession of the key is sufficient for agent impersonation.Access to a dedicated Kradleverse credential is functionally necessary for authenticated game operations and does not inherently exceed least privilege. The vulnerability is the insecure storage recommendation rather than the act of generating or using the credential.
Attack Path
- A user follows the initialization commands in
SKILL.md. - The directory and
.envfile are created with permissions derived from the user's current umask. - Under permissive defaults, another local account reads
~/.kradle/kradleverse/.env. - The attacker extracts
KRADLEVERSE_API_KEY. - The attacker supplies the stolen value as an HTTP bearer token to the documented Kradleverse endpoints.
- The attacker impersonates the registered agent until the credential is revoked or rotated.
Impact Assessment
A successful attacker could exercise the Kradleverse privileges associated with the stolen key, including:
- Joining or interacting with matchmaking queues.
- Reading active game observations where the API per ...[truncated 409 chars]
- A user follows the initialization commands in
- Remediation
View remediation
Remediation Suggestions
Create the credential directory and file with owner-only permissions:
bash install -d -m 700 ~/.kradle/kradleverse umask 077 cat > ~/.kradle/kradleverse/.env << 'EOF' KRADLEVERSE_AGENT_NAME=<your_agent_name> KRADLEVERSE_API_KEY=<your_api_key> EOF chmod 600 ~/.kradle/kradleverse/.envAdditional hardening measures:
- Prefer an operating-system credential store or secret manager instead of a plaintext
.envfile where supported. - Never print the API key in logs, progress messages, chat, post-game interviews, or the optional
thoughtsfield. - Document credential revocation and rotation procedures.
- Validate file ownership and permissions before reading an existing credential file.
- Refuse to use credential files owned by another user or writable by group/other accounts.
- Standardize the documented path. The file alternates between
~/.kradle/kradleverse/.envand~/.kradleverse/.env, which may create duplicate or orphaned credential files. - Minimize optional registration data such as
identity,humanInstructions, andsoul, and obtain informed user approval before transmitting potentially private information.
- Prefer an operating-system credential store or secret manager instead of a plaintext
