Back to skill

Security audit

toutiaoAutoPublish

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real Toutiao publishing automation tool, but it can post under the active logged-in account while silently changing content and without a final confirmation step.

Install only if you are comfortable with automation using your logged-in Toutiao browser session to make public posts. Review and modify the script first to require explicit confirmation, publish exactly the supplied text, use an isolated browser profile, pin dependencies, and avoid interpolating content into JavaScript.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/toutiao_publish.py:341
Finding

JavaScript Injection Through User-Controlled Post Content

Content
View full analysis
', '>').replace('\n', '
') page.evaluate(f''' () => {{ const editor = document.querySelector('div[contenteditable="true"]'); if (editor) {{ editor.innerHTML = `{js_content}`; editor.dispatchEvent(new Event('input', {{ bubbles: true }})); editor.dispatchEvent(new Event('change', {{ bubbles: true }})); }} }} ''') ``` ### Technical Analysis The post content is controlled through a positional command-line argument or a user-selected file. Although the code replaces HTML metacharacters, it interpolates the resulting value directly into a JavaScript template literal passed to `page.evaluate()`. HTML escaping does not make data safe for a JavaScript template-literal context. In particular, the code does not escape backticks, backslashes, or `${...}` template expressions. An attacker can therefore supply content that terminates the template literal or introduces a template expression, causing arbitrary JavaScript to execute in the authenticated Toutiao page. The injected code executes inside the browser origin rather than as native operating-system code. Nevertheless, it inherits access to the page DOM and the authenticated web session available to scripts executing in that origin. ### Attack Path 1. An attacker convinces the user or calling agent to publish attacker-controlled text, or supplies a post-content file. 2. The content contains a JavaScript template-literal payload using a backtick or `${...}` expression. 3. The script performs HTML escaping, but the JavaScript control characters remain intact. 4. The content is inserted into the Python f-string used to construct the `page.evaluate()` program. 5. Playwr ...[truncated 833 chars]
Remediation
View remediation
{ editor.innerText = content; editor.dispatchEvent(new Event('input', {bubbles: true})); editor.dispatchEvent(new Event('change', {bubbles: true})); }""", { "editor": input_box.element_handle(), "content": content, }, ) ``` Where supported by the editor, prefer `input_box.fill(content)` or `input_box.press_sequentially(content)`. Avoid assigning untrusted data to `innerHTML`; use `innerText` or `textContent` unless HTML formatting is explicitly required. Add regression tests containing backticks, backslashes, `${...}` expressions, HTML tags, Unicode text, and multiline input to verify that all supplied content remains data and cannot affect JavaScript syntax. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:24
Finding

Unpinned Dependency Installation Into a System-Managed Python Environment

Content
View full analysis
Remediation
View remediation

other

Warning
Location
scripts/toutiao_publish.py:238
Finding

Silent Modification of User-Supplied Publication Content

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The description understates the real behavior: it reuses an authenticated Chrome session via remote debugging, reads local files, and performs real account actions beyond a simple 'publisher' description. This mismatch is dangerous because users may invoke it without understanding that it can control a logged-in browser session and publish publicly using existing credentials.

Content

No source excerpt is available for this finding.

Ssd 4

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The default post text explicitly says the agent used the owner's account on its own to explore and publish successfully. That framing normalizes unauthorized account use and, combined with automatic publishing behavior, strongly suggests the code is designed to post under the user's identity without meaningful authorization boundaries.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill does not declare any explicit tool scope or permissions even though its documented behavior includes reading local files for post content and images. Missing scope declarations reduce user and platform visibility into what the skill can access, making accidental overreach or misuse harder to detect and govern.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger conditions are broad enough that normal conversational phrases like '发布头条' or generic requests to publish social content may activate a skill that performs a real external action. Over-broad activation increases the chance of unintended invocation, especially given that the target action is posting to a public account.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill lacks a clear warning that it will make a real public post to the user's already logged-in Toutiao account. In this context, silent use of an authenticated session is especially risky because a mistaken invocation or deceptive input can cause irreversible public publication, reputational harm, or policy/account issues.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

When the supplied content is under 100 characters, the tool silently appends a long AI-generated message, materially changing what will be posted. In a publishing tool, modifying user intent without explicit approval is dangerous because it can cause unwanted statements to be published under the user's identity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The tool reuses an existing logged-in Chrome session to publish on behalf of whichever account is active, without a strong warning or an explicit account-selection step. In the context of a social-media publishing skill, this makes unintended posting significantly more dangerous because the action is taken under the user's real authenticated identity.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script attaches to an existing Chrome instance over the DevTools protocol and then operates inside a reused browser context. That gives the code access not only to the intended Toutiao session but potentially to all cookies, tabs, and authenticated state in that browser profile, expanding the blast radius well beyond simple content publishing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script clicks the final publish button immediately once it finds it, with no last-step confirmation showing the exact account, content, image, and options being posted. Because this acts on a real social-media account, accidental or manipulated invocation can directly create unauthorized public posts.

Content

No source excerpt is available for this finding.