Back to skill

Security audit

Twitter Article

Security checks for vulnerabilities and agentic risk

Overview

This skill appears purpose-built for syncing Notion content to Twitter/X Articles, but it handles powerful account credentials and remote publishing/deletion with insufficient safeguards.

Review before installing. Use only a dedicated Twitter/X account and a least-privilege Notion integration, avoid pasting secrets into shared shells or scripts, rotate any exposed tokens, use only a trusted local proxy, and treat publish/delete commands as immediate account actions.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
twitter-article.js:514
Finding

Notion integration token exposed through command-line arguments

Content
View full analysis
--page-id ``` ```javascript // twitter-article.js:514-526 async function main() { const args = process.argv.slice(2); const cmd = args[0]; const getArg = (name) => { const i = args.indexOf(`--${name}`); return i >= 0 ? args[i + 1] : null; }; try { switch (cmd) { // ... case 'notion-to-article': await cmdNotionToArticle(getArg('notion-key'), getArg('page-id'), { publish: args.includes('--publish') }); break; ``` ### Technical Analysis The documented interface instructs users to supply the Notion integration secret through the `--notion-key` command-line option. The implementation then retrieves that secret directly from `process.argv`. Command-line arguments are not an appropriate channel for secrets because they may be exposed through: - Shell history files. - Process listings and process-monitoring utilities. - Audit, telemetry, debugging, or orchestration logs that record command lines. - Wrapper scripts, job definitions, or CI logs containing the full invocation. - Error reports or administrative tooling that captures process metadata. The Notion token is legitimately required for the declared Notion-to-Twitter synchronization operation, and the code sends it only to the official Notion API. The vulnerability is therefore not unauthorized network exfiltration; it is insecure local credential handling that unnecessarily broadens access to the token. ### Attack Path 1. A user follows the documented example and runs the Skill with `--notion-key `. 2. The secret becomes part of the process command line and may also be written to shell history. 3. A local user, process-monitoring service, CI logger, o ...[truncated 821 chars]
Remediation
View remediation
" node twitter-article.js notion-to-article --page-id ``` 6. Advise existing users to remove exposed commands from shell history and rotate any token that may have entered logs. 7. Ensure error messages and diagnostic output never print the token or complete authorization headers. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
twitter-article.js:455
Finding

Predictable shared temporary paths permit content disclosure and symlink-based file overwrite

Content
View full analysis
{ fs.writeFileSync(destPath, Buffer.concat(chunks)); resolve(destPath); }); ``` ### Technical Analysis The Skill uses globally predictable paths in the shared `/tmp` directory: - `/tmp/twitter-article-imgs` - `/tmp/twitter-article-imgs/img0.jpg` and similar deterministic names - `/tmp/twitter-article-content.json` Files are written using `fs.writeFileSync` without: - A per-execution random temporary directory. - Exclusive file creation. - Explicit restrictive permissions. - Symlink checks. - Ownership validation. - Cleanup after completion. `fs.writeFileSync` follows symbolic links. An attacker who can pre-create one of the predictable paths as a symbolic link may redirect the write to another file writab ...[truncated 2254 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs users to export live Twitter/X authentication cookies (AUTH_TOKEN and CT0) from their browser and use them directly, but it does not warn that these are highly sensitive session credentials equivalent to account access. In a CLI/integration context, users may paste them into shells, logs, shared terminals, or scripts, creating a realistic risk of session theft and unauthorized posting or account takeover actions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The top-level doc comment presents this file as a Twitter/X Article CLI for creating and managing articles via Twitter GraphQL, listing only Twitter-focused commands. However, the code also implements an end-to-end notion-to-article workflow that fetches content from the Notion API, downloads remote images, writes temporary files, uploads media to Twitter, and can publish automatically, which is a materially broader behavior than the documentation describes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script sends Twitter auth cookies and CSRF token through a user-configurable proxy, and even defaults to a local HTTP proxy. That means a malicious or misconfigured proxy can observe or intercept highly sensitive session credentials, enabling account takeover or unauthorized actions on the user's X/Twitter account; the Notion flow also broadens data exposure by moving third-party content through the same network path.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

cmdDelete directly invokes the ArticleEntityDelete API and only reports success or failure afterward. There is no confirmation prompt, dry-run option, or cautionary message despite this being a destructive operation against the user's remote article data.

Content

No source excerpt is available for this finding.

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 · twitter-article.js (reported line 380)May include surrounding context.

js
const blocks = [];
  let cursor;
  do {
    const url = `https://api.notion.com/v1/blocks/${blockId}/children?page_size=100${cursor ? '&start_cursor=' + cursor : ''}`;
    const res = await fetch(url, {
      headers: { 'Authorization': `Bearer ${notionKey}`, 'Notion-Version': '2022-06-28' },
    });

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 · twitter-article.js (reported line 431)May include surrounding context.

js
const blocks = [];
  let cursor;
  do {
    const url = `https://api.notion.com/v1/blocks/${blockId}/children?page_size=100${cursor ? '&start_cursor=' + cursor : ''}`;
    const res = await fetch(url, {
      headers: { 'Authorization': `Bearer ${notionKey}`, 'Notion-Version': '2022-06-28' },
    });

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The request headers hard-code x-twitter-client-language to 'en', which enforces a specific locale regardless of user preference. The file does not offer an opt-in or configuration mechanism, and no region-specific justification is documented.

Content

No source excerpt is available for this finding.