Back to skill

Security audit

Twitter Thread Scheduler

Security checks for vulnerabilities and agentic risk

Overview

The skill is for posting X/Twitter threads, but it documents using an undeclared local OAuth credential store and scheduled posting behavior that users should review carefully.

Install only if you intend this skill to publish or schedule real X/Twitter threads. Before use, verify which account ~/.xurl points to, require explicit confirmation before post/schedule/fire actions, and prefer a single declared credential source rather than ambient local OAuth credentials.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:26
Finding

Undeclared Access to a User-Level OAuth Credential Store

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 26-39
Vulnerability Type: Credential access beyond the declared environment-based authorization boundary
Risk Level: Medium

Vulnerable Code Snippet

markdown
This script uses the `redditech` OAuth2 credentials from `~/.xurl` to:
1. Post tweet [1/N] — get back the tweet ID
2. Post tweet [2/N] as `reply: { in_reply_to_tweet_id: <id> }` — get tweet 2's ID
3. Continue through the queue until all N tweets are posted
4. Log all tweet IDs + URLs to `memory/thread-log.jsonl`

**This is the ONLY way to schedule real X threads.** Always use this script over Buffer for multi-tweet content.

---

## Script

scripts/tweet_thread_scheduler.py

text

Auth: `~/.xurl` → `apps.redditech.users.redditech.access_token` (auto-refreshes on 401)

The skill metadata separately declares TWITTER_ACCESS_TOKEN as its required credential:

yaml
primaryEnv: TWITTER_ACCESS_TOKEN
requires:
  bins:
  - python3
  env:
  - TWITTER_ACCESS_TOKEN

Technical Analysis

The declared authorization model requires the TWITTER_ACCESS_TOKEN environment variable, but the operational instructions direct the agent to read ~/.xurl and extract apps.redditech.users.redditech.access_token. This user-level file may contain credentials belonging to an existing account and is outside the credential source declared in the skill metadata.

Accessing an ambient credential store violates least privilege because installing or invoking the skill could grant it access to credentials that the user did not explicitly provide for that invocation. The documented automatic token refresh on HTTP 401 may also require access to additional OAuth material or authorization capabilities, although the exact behavior cannot be verified because scripts/tweet_thread_scheduler.py is absent from the audited project.

The finding is limited to the documented credential-acce ...[truncated 1611 chars]

Remediation
View remediation

Remediation Suggestions

  1. Make TWITTER_ACCESS_TOKEN the exclusive default credential source and remove implicit access to ~/.xurl.
  2. If file-based authentication is required, declare the exact file access in the skill metadata and require explicit, informed user consent before reading it.
  3. Avoid hardcoding an account-specific path such as apps.redditech.users.redditech.access_token; require the user to select and confirm the intended account.
  4. Validate the authenticated account identity before posting and display that identity in the final confirmation prompt.
  5. Implement token refresh only when explicitly enabled. Document which refresh credentials are read, where renewed tokens are stored, and what file permissions are required.
  6. Enforce restrictive credential-file permissions and never write tokens to queue files, logs, command output, or error messages.
  7. Include scripts/tweet_thread_scheduler.py in the reviewable package so its credential handling, refresh logic, API destinations, logging, and error paths can be audited.
  8. Fail closed when TWITTER_ACCESS_TOKEN is absent rather than silently falling back to ambient credentials.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill metadata declares TWITTER_ACCESS_TOKEN as the required credential, but the body states the script actually reads a different OAuth token from ~/.xurl under a specific account path. This mismatch can cause operators and calling agents to use or expose the wrong secret source, bypass expected secret-governance controls, and unintentionally post using a different identity than intended.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Contradictory authentication documentation creates ambiguity about which credentials will be consumed for a live-posting action. In a skill that performs outbound writes to Twitter/X, this can lead to accidental use of privileged local credentials, unauthorized posting from the wrong account, and weakened auditability of how authentication is handled.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation describes preview, post, schedule, and fire actions but does not give an explicit warning that these actions transmit content to an external platform and can publish live, user-visible messages. Without a clear warning, users or agents may treat the skill like a local formatter rather than a networked publishing tool, increasing the risk of unintended disclosure or reputational harm.

Content

No source excerpt is available for this finding.

Behavior Manipulation

Medium
Category
Prompt Injection
Confidence
88% confidence
Finding

The phrase 'This is the ONLY way' and 'Always use this script' is behavior-shaping language that attempts to steer operators or agents toward one tool without preserving room for safety checks or alternatives. In the context of a live-posting skill with outbound network access and credential ambiguity, such coercive wording makes accidental or premature publication more likely.

Content

Scanner excerpt · SKILL.md (reported line 42)May include surrounding context.

md
3. Continue through the queue until all N tweets are posted
4. Log all tweet IDs + URLs to `memory/thread-log.jsonl`

**This is the ONLY way to schedule real X threads.** Always use this script over Buffer for multi-tweet content.

---

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The directive 'Always use this script' encourages unconditional invocation whenever multi-tweet content appears, instead of requiring a context-specific safety check before performing an external write. For a skill that can post live content and schedule future actions, broad imperative language increases the chance of accidental execution, misuse by automated agents, and bypass of safer alternatives or human review.

Content

No source excerpt is available for this finding.