Back to skill

Security audit

Schedule and publish posts to X and Threads from your AI agent

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed PostStash integration for scheduling, listing, and checking social posts, with some usage cautions but no evidence of hidden or malicious behavior.

Install only if you are comfortable giving the skill a PostStash API key that can schedule or draft posts and read post status/analytics for that account. Review agent-generated content before invoking scheduling tools, prefer Draft for unreviewed content, and avoid running the example npx commands with production credentials unless dependencies are pinned or already installed locally.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
src/tools/get-post.ts:41
Finding

Unvalidated Post Identifier Allows Authenticated API Path Manipulation

Content
View full analysis
=> { const data = await poststashFetch(`/posts/${input.post_id}`) as { post: PostObject; analytics: PostAnalytics[]; }; return { post: data.post, analytics: data.analytics, }; }, }; ``` The resulting path is passed to the authenticated network client in `src/client.ts`: ```ts const res = await fetch(`${BASE}${path}`, { ...init, headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json", ...init.headers, }, }); ``` ### Technical Analysis The tool declares `post_id` as an unrestricted string even though its description states that it must be a UUID. It then interpolates that value directly into the request path without strict UUID validation or path-component encoding. An attacker who can influence tool arguments may supply path-control characters or traversal segments such as `/`, `..`, `?`, or `#`. URL parsing and normalization can consequently transform the intended endpoint: ```text https://poststash.com/api/posts/{UUID} ``` into a different same-origin endpoint. For example, a value containing traversal segments can escape the intended `/api/posts/` route. The shared client will still attach `POSTSTASH_API_KEY` as a bearer credential to the resulting request. The destination origin remains fixed to `https://poststash.com`, so this is not a general serv ...[truncated 1926 chars]
Remediation
View remediation
=> { if (!UUID_PATTERN.test(input.post_id)) { throw new Error("post_id must be a valid UUID"); } const encodedPostId = encodeURIComponent(input.post_id); const data = await poststashFetch(`/posts/${encodedPostId}`) as { post: PostObject; analytics: PostAnalytics[]; }; return { post: data.post, analytics: data.analytics, }; }, ``` 3. **Constrain paths in the shared client** Where practical, avoid accepting arbitrary paths in `poststashFetch`. Introduce route-specific helpers or reject paths containing traversal segments, fragments, unexpected query strings, or absolute-URL syntax. 4. **Retain server-side authorization controls** PostStash should independently authorize every endpoint and resource against the bearer credential. Client-side validation reduces attack surface but must not replace server-side access control. 5. **Add negative security tests** Test identifiers containing values such as `../`, encoded traversal characters, `/`, `?`, `#`, absolute URLs, and malformed UUIDs. Confirm that these inputs are rejected before any network request is issued. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose emphasizes scheduling posts and threads to Threads and X, which implies creating or scheduling outbound social content. The actual code chunk does not schedule or publish anything. Instead, it reads from PostStash: listing recent ready posts, listing published posts, retrieving a specific post, and optionally showing analytics. This is a materially different primary behavior from scheduling, so the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description focuses on scheduling posts and threads to Threads and X via PostStash. However, the code exports additional capabilities beyond scheduling: getPost, listPosts, and a general poststashFetch client. These indicate read/access functionality and broader API interaction that are not described in the declared purpose. The scheduling-related exports do align with the description, but the undeclared retrieval and generic client capabilities make the description incomplete and therefore mismatched.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description says the skill is for scheduling posts and threads to Threads and X via PostStash. However, the supplied code chunk implements a read operation: poststash.get_post, which calls /posts/{post_id} to fetch an existing post and its analytics. This is materially different from scheduling content. While both relate to PostStash and social posts, the code's primary purpose is retrieval and analytics inspection, not scheduling or posting.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README promotes scheduling content to Threads and X but does not clearly warn users that submitted text will be transmitted to third-party services and may be publicly published. In an agent context, this omission increases the risk of users or downstream developers unintentionally sending sensitive, proprietary, or personal data to external platforms.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill declares access to an environment variable-based API key and clearly relies on network access, but it does not define an explicit tool scope such as permissions or allowed-tools. That weakens least-privilege controls and makes it harder for a host agent or reviewer to constrain what the skill is allowed to do, increasing the risk of unintended data access or external calls.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

The example instructs users to run the script via npx ts-node without pinning an exact package version. If ts-node is fetched dynamically from the registry or resolved from an unexpected source, a compromised or malicious package version could execute arbitrary code on the user's machine. In this context, the example also expects a live API key in the environment, which increases the sensitivity of the runtime environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

This code performs an outbound HTTP request to an external service and attaches a bearer token from an environment variable, but there is no confirmation prompt, log message, or explanatory comment disclosing that data may be sent off-system. Because the request body and headers can be influenced by the caller through init, the operation may transmit user or system data without any visible warning in this file.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code sends the user's thread content and scheduling metadata to an external service via an HTTP POST, but the file contains no confirmation prompt, logging, comment, or docstring disclosing that user content is transmitted off-system. Because this is a code file, network calls that transmit user data should have some visible warning unless such disclosure is documented elsewhere or obviously covered by the skill description.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.