T09 · Insecure Skill Coding Practices
- Location
SKILL.md:42- Finding
Shell Command Injection Through User-Controlled Tweet Content
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent Twitter/X posting tool, but it needs review because its shell-based usage can turn tweet text into command execution if handled unsafely.
Install only if you are comfortable giving this skill read/write Twitter/X API credentials. Use dry-run first, require confirmation before every post, and invoke the script with a non-shell argument API or structured stdin/JSON input rather than interpolating tweet text into an exec shell string. Keep HTTPS_PROXY unset unless you control and trust the proxy.
SKILL.md:42Shell Command Injection Through User-Controlled Tweet Content
Referenced artifact was not completely inspected
All commands via `exec`. Script path: `scripts/tweet.js` (relative to this skill directory).
Referenced artifact was not completely inspected
All commands via `exec`. Script path: `scripts/tweet.js` (relative to this skill directory).
Referenced artifact was not completely inspected
All commands via `exec`. Script path: `scripts/tweet.js` (relative to this skill directory).
Referenced artifact was not completely inspected
All commands via `exec`. Script path: `scripts/tweet.js` (relative to this skill directory).
Referenced artifact was not completely inspected
All commands via `exec`. Script path: `scripts/tweet.js` (relative to this skill directory).
Referenced artifact was not completely inspected
All commands via `exec`. Script path: `scripts/tweet.js` (relative to this skill directory).
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
* Environment variables (required):
* TWITTER_CONSUMER_KEY - OAuth 1.0a Consumer Key (API Key)
* TWITTER_CONSUMER_SECRET - OAuth 1.0a Consumer Secret (API Key Secret)
* TWITTER_ACCESS_TOKEN - OAuth 1.0a Access Token
* TWITTER_ACCESS_TOKEN_SECRET - OAuth 1.0a Access Token Secret
*
* Optional:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
* Environment variables (required):
* TWITTER_CONSUMER_KEY - OAuth 1.0a Consumer Key (API Key)
* TWITTER_CONSUMER_SECRET - OAuth 1.0a Consumer Secret (API Key Secret)
* TWITTER_ACCESS_TOKEN - OAuth 1.0a Access Token
* TWITTER_ACCESS_TOKEN_SECRET - OAuth 1.0a Access Token Secret
*
* Optional:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
* Environment variables (required):
* TWITTER_CONSUMER_KEY - OAuth 1.0a Consumer Key (API Key)
* TWITTER_CONSUMER_SECRET - OAuth 1.0a Consumer Secret (API Key Secret)
* TWITTER_ACCESS_TOKEN - OAuth 1.0a Access Token
* TWITTER_ACCESS_TOKEN_SECRET - OAuth 1.0a Access Token Secret
*
* Optional:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
* Environment variables (required):
* TWITTER_CONSUMER_KEY - OAuth 1.0a Consumer Key (API Key)
* TWITTER_CONSUMER_SECRET - OAuth 1.0a Consumer Secret (API Key Secret)
* TWITTER_ACCESS_TOKEN - OAuth 1.0a Access Token
* TWITTER_ACCESS_TOKEN_SECRET - OAuth 1.0a Access Token Secret
*
* Optional:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
* Environment variables (required):
* TWITTER_CONSUMER_KEY - OAuth 1.0a Consumer Key (API Key)
* TWITTER_CONSUMER_SECRET - OAuth 1.0a Consumer Secret (API Key Secret)
* TWITTER_ACCESS_TOKEN - OAuth 1.0a Access Token
* TWITTER_ACCESS_TOKEN_SECRET - OAuth 1.0a Access Token Secret
*
* Optional:
The skill explicitly relies on environment variables and execution of a script, but it does not declare any tool scope such as permissions or allowed-tools. In an agent environment, that omission can let the skill run with broader-than-expected capabilities, making credential use and posting actions less transparent and harder to constrain.
This skill performs an irreversible external side effect by publishing content to the user's Twitter/X account, but the description does not clearly warn that use will post publicly. That increases the risk of users invoking it without informed consent, leading to accidental public disclosure, reputational harm, or unintended account activity.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
5. Generate Access Token and Access Token Secret (ensure Read+Write scope)
6. If the portal only shows Read, use PIN-based OAuth flow:
- Call `POST /oauth/request_token` with `oauth_callback=oob`
- User opens `https://api.twitter.com/oauth/authorize?oauth_token=<token>`
- User provides the PIN code
- Call `POST /oauth/access_token` with the PIN as `oauth_verifier`
This code transmits user-provided content to an external third-party service (Twitter/X) over the network, which is exactly the skill's purpose. While not inherently malicious, it is a real data-exfiltration boundary because any text passed to the script is sent off-host, and the optional proxy support can further route that traffic through another system.
if (opts.replyTo) body.reply = { in_reply_to_tweet_id: opts.replyTo };
if (opts.quoteTweetId) body.quote_tweet_id = opts.quoteTweetId;
const r = await request('POST', 'https://api.twitter.com/2/tweets', body);
if (r.status === 201) {
const id = r.data.data.id;
return {
Detected: suspicious.env_credential_access