Back to skill

Security audit

Xqueue

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its stated purpose, but it has a real queue-isolation weakness that could let symlinked files outside the queue be posted to X under the user's account.

Review this skill before installing. Use it only with a private queue directory that untrusted users and processes cannot write to, avoid symlinks in the queue, keep backups if deleteAfterPost is enabled, and make sure you are comfortable with scheduled content and media being posted to X using your account credentials.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
xqueue-post.py:149
Finding

Symlink Traversal Allows Files Outside the Queue to Be Published

Content
View full analysis
str: """Upload media to X and return media_id string. Uses v1.1 chunked upload.""" consumer_key = get_credential("x-consumer-key", "X_CONSUMER_KEY") consumer_secret = get_credential("x-consumer-secret", "X_CONSUMER_SECRET") access_token = get_credential("x-access-token", "X_ACCESS_TOKEN") access_secret = get_credential("x-access-token-secret", "X_ACCESS_TOKEN_SECRET") media_data = file_path.read_bytes() media_b64 = base64.b64encode(media_data).decode() ``` ```python def parse_tweet_file(file_path: Path, separator: str) -> list[dict]: """Parse a tweet file into a list of {text, community} dicts.""" content = file_path.read_text().strip() if not content: return [] ``` ```python def find_media(time_dir: Path) -> list[Path]: """Find media files in the time directory.""" media = [] for f in sorted(time_dir.iterdir()): if f.suffix.lower() in SUPPORTED_MEDIA: size = f.stat().st_size max_size = MAX_GIF_BYTES if f.suffix.lower() == ".gif" else MAX_IMAGE_BYTES if size <= max_size: media.append(f) else: print(f"WARN: {f.name} too large ({size} bytes), skipping", file=sys.stderr) return media[:4] ``` ```python # Find tweet files tweet_files = sorted([ f for f in time_dir.iterdir() if f.suffix.lower() in (".md", ".txt") and f.is_file() ]) ``` ### Technical Analysis The scheduler treats directory entries with accepted filename extensions as trusted queue files. It does not reject symbolic links or resolve each candidate path and verify that the resolved target remains under the configure ...[truncated 2308 chars]
Remediation
View remediation
bool: try: if path.is_symlink(): return False resolved_path = path.resolve(strict=True) resolved_root = queue_dir.resolve(strict=True) resolved_path.relative_to(resolved_root) return resolved_path.is_file() except (ValueError, OSError): return False ``` 3. Apply this check before `stat()`, `read_text()`, `read_bytes()`, and `unlink()`. 4. Where the platform supports it, open files with no-follow semantics such as `O_NOFOLLOW`, then validate the opened file descriptor. This reduces symlink-swap race conditions. 5. Ensure every day and time directory is also a real directory beneath the queue root rather than a symlink. 6. Run the scheduler under a dedicated operating-system account with access only to the queue and required executable/runtime files. 7. Restrict queue-directory write permissions so untrusted users and processes cannot insert scheduled content. 8. Consider moving successfully posted files into a controlled archive rather than immediately deleting them, preserving an audit trail without retaining sensitive content indefinitely. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
xqueue-post.py:300
Finding

Actual X API Endpoint Is Missing from the Declared Network Permission

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (13)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · xqueue-post.py (reported line 7)May include surrounding context.

python
Run via cron every 15 minutes.

Reads credentials from environment variables (X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN,
X_ACCESS_TOKEN_SECRET). Optional macOS Keychain fallback if XQUEUE_KEYCHAIN_ACCOUNT is set.
Fallback: env vars X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN, X_ACCESS_TOKEN_SECRET
"""

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · xqueue-post.py (reported line 66)May include surrounding context.

python
Run via cron every 15 minutes.

Reads credentials from environment variables (X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN,
X_ACCESS_TOKEN_SECRET). Optional macOS Keychain fallback if XQUEUE_KEYCHAIN_ACCOUNT is set.
Fallback: env vars X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN, X_ACCESS_TOKEN_SECRET
"""

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · xqueue-post.py (reported line 70)May include surrounding context.

python
Run via cron every 15 minutes.

Reads credentials from environment variables (X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN,
X_ACCESS_TOKEN_SECRET). Optional macOS Keychain fallback if XQUEUE_KEYCHAIN_ACCOUNT is set.
Fallback: env vars X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN, X_ACCESS_TOKEN_SECRET
"""

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · xqueue-post.py (reported line 7)May include surrounding context.

python
Run via cron every 15 minutes.

Reads credentials from environment variables (X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN,
X_ACCESS_TOKEN_SECRET). Optional macOS Keychain fallback if XQUEUE_KEYCHAIN_ACCOUNT is set.
Fallback: env vars X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN, X_ACCESS_TOKEN_SECRET
"""

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · xqueue-post.py (reported line 66)May include surrounding context.

python
Run via cron every 15 minutes.

Reads credentials from environment variables (X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN,
X_ACCESS_TOKEN_SECRET). Optional macOS Keychain fallback if XQUEUE_KEYCHAIN_ACCOUNT is set.
Fallback: env vars X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN, X_ACCESS_TOKEN_SECRET
"""

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · xqueue-post.py (reported line 71)May include surrounding context.

python
Run via cron every 15 minutes.

Reads credentials from environment variables (X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN,
X_ACCESS_TOKEN_SECRET). Optional macOS Keychain fallback if XQUEUE_KEYCHAIN_ACCOUNT is set.
Fallback: env vars X_CONSUMER_KEY, X_CONSUMER_SECRET, X_ACCESS_TOKEN, X_ACCESS_TOKEN_SECRET
"""

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The markdown explains that files are deleted after posting, but it presents this as a feature rather than a caution and does not warn users about potential data loss or the need to retain backups. Because the skill affects user data on disk, the description should explicitly disclose this behavior and its consequences.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The setup and usage sections describe scheduling and posting to X, but they do not explicitly warn that tweet text, media, and optional community targets are sent to an external service. For a skill that transmits user content and uses account credentials, the markdown should disclose the privacy and account-impact implications.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · xqueue-post.py (reported line 75)May include surrounding context.

python
if account:
        import subprocess
        try:
            result = subprocess.run(
                ["security", "find-generic-password", "-a", account, "-s", service, "-w"],
                capture_output=True, text=True, timeout=5
            )

Tainted flow: 'account' from os.environ.get (line 71, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · xqueue-post.py (reported line 75)May include surrounding context.

python
if account:
        import subprocess
        try:
            result = subprocess.run(
                ["security", "find-generic-password", "-a", account, "-s", service, "-w"],
                capture_output=True, text=True, timeout=5
            )

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · xqueue-post.py (reported line 300)May include surrounding context.

python
results.append({"dry_run": True, "text": text[:50], "reply_to": reply_to})
            reply_to = f"DRY_RUN_{i}"
        else:
            result = oauth_request("POST", "https://api.x.com/2/tweets", body)
            if "data" in result:
                tweet_id = result["data"]["id"]
                reply_to = tweet_id

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code deletes the source tweet file and associated media after successful posting when deleteAfterPost is enabled. Although the behavior is configurable in code, there is no confirmation prompt or explicit user-facing warning at the point of deletion, making a destructive operation easy to miss during execution.

Content

No source excerpt is available for this finding.