Back to skill

Security audit

携程笔记全自动发布

Security checks for vulnerabilities and agentic risk

Overview

This skill is an account-affecting Ctrip publishing automation with under-scoped browser control, unsafe script generation, and install-time dependency downloads that users should review before installing.

Install only if you are comfortable with a skill controlling your logged-in Chrome session for Ctrip publishing. Review all generated text and images yourself, avoid using untrusted input as post content, do not rely on it to publish safely without confirmation, and prefer running it in an isolated browser profile after dependencies are pinned or preinstalled.

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

T08 · Insecure Dependencies

Warning
Location
scripts/publish.sh:13
Finding

Unpinned Runtime Installation of Playwright and Chromium

Content
View full analysis
/dev/null; then echo "Installing Playwright..." pip3 install playwright playwright install chromium fi ``` ### Technical Analysis The launcher installs the latest available Playwright package and downloads Chromium during normal execution. Neither component is pinned to a reviewed version or validated with cryptographic hashes. There is also no lockfile, isolated virtual environment, or trusted package-index enforcement. Consequently, the code executed by this Skill can change without any corresponding change to the reviewed project. The installation also relies on the user's current `pip3` and Playwright configuration, including any configured package mirrors, proxies, or environment variables. ### Attack Path 1. A user runs `scripts/publish.sh` on a system where the `playwright` Python module is unavailable. 2. The script invokes `pip3 install playwright` against the currently configured package source. 3. It then invokes `playwright install chromium`, causing additional browser artifacts to be downloaded. 4. If the package source, configured mirror, dependency release, downloaded browser artifact, or network path is compromised, attacker-controlled installation or package code may execute. 5. That code executes with the privileges of the user who launched the Skill. ### Impact Assessment Successful supply-chain exploitation could provide arbitrary local code execution with the invoking user's privileges. This may expose files, browser data, environment variables, and account information accessible to that user. The script does not itself request privilege elevation, so the direct scope is limited to the launcher's existing permissions. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/auto_fill.py:22
Finding

Nested JavaScript and AppleScript Injection Through Publishing Content

Content
View full analysis
20) {{ titleInput = input; }} }} if (titleInput) {{ titleInput.value = '{title_escaped}'; titleInput.dispatchEvent(new Event('input', {{ bubbles: true }})); titleInput.dispatchEvent(new Event('change', {{ bubbles: true }})); return '标题已填写: ' + titleInput.value; }} return '未找到标题输入框'; }})(); " delay 1 execute javascript " (function() {{ const editor = document.querySelector('[contenteditable=\"true\"]') || document.querySelector('.editor') || document.querySelector('textarea'); if (editor) {{ editor.innerHTML = '{c ...[truncated 3108 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ctrip_auto_publish.py:68
Finding

JavaScript Injection in Chrome Automation Fields

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate_script.py:7
Finding

JavaScript Injection in Generated Browser Console Script

Content
View full analysis
{{ const editor = document.querySelector('[contenteditable="true"]') || document.querySelector('.editor') || document.querySelector('textarea'); if (editor) {{ editor.innerHTML = "{content_js}"; editor.dispatchEvent(new Event('input', {{ bubbles: true }})); console.log("Content filled"); }} }}, 500); setTimeout(() => {{ const destInput = document.querySelector('input[placeholder*="目的地"]') || document.querySelector('.destination-input'); if (destInput) {{ destInput.value = "{dest_js}"; destInput.dispatchEvent(new Event('input', {{ bubbles: true }})); console.log ...[truncated 2186 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (26)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This mismatch is security-relevant because the skill omits a key behavior: controlling a local browser/host environment. Undisclosed host/browser control changes the user's trust and consent model, and can lead to unexpected automation against an authenticated account.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This mismatch is security-relevant because the skill omits a key behavior: controlling a local browser/host environment. Undisclosed host/browser control changes the user's trust and consent model, and can lead to unexpected automation against an authenticated account.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This mismatch is security-relevant because the skill omits a key behavior: controlling a local browser/host environment. Undisclosed host/browser control changes the user's trust and consent model, and can lead to unexpected automation against an authenticated account.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This mismatch is security-relevant because the skill omits a key behavior: controlling a local browser/host environment. Undisclosed host/browser control changes the user's trust and consent model, and can lead to unexpected automation against an authenticated account.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill advertises high-impact actions including downloading external images, uploading files, and clicking the final publish button, but provides no explicit warning, review gate, or confirmation requirement. In an authenticated creator account, this can cause unintended public posting, copyright/compliance issues from externally sourced media, and irreversible account-side actions.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill describes capabilities that require network access, file writes, and browser/CDP-style automation, but it declares no explicit tool scope or permissions boundaries. That creates an authorization ambiguity where an agent may invoke broader-than-expected capabilities, increasing the chance of unintended file/network actions during an automated publishing workflow.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad and action-oriented, making accidental invocation plausible in normal conversation. In this skill's context, accidental activation is more dangerous because the workflow can navigate to a live publishing page, manipulate authenticated content, download files, and potentially submit a post.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This file contains natural-language descriptions and user-facing output entirely in Chinese, including the module docstring and runtime messages, with no indication that the skill is intentionally limited to Chinese-speaking users or a China-specific environment. That creates a language/locale policy concern because the skill effectively forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

技能清单描述该技能可从 Bing Images 搜索图片、自动上传图片、自动选择目的地并自动点击发布,属于完整发布流水线。但此文件实际只通过 AppleScript/JavaScript 向当前 Chrome 页面填写标题、正文和可选目的地,且通知与控制台输出还明确要求用户“检查并上传图片后点击发布”,说明并未实现自动上传图片或自动发布。

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
88% confidence
Finding

The code constructs an AppleScript string containing untrusted title/content/destination data and executes it via osascript. The escaping is incomplete for multi-layered AppleScript-to-JavaScript contexts, so crafted input can break out of the intended JavaScript string and potentially execute unintended script in the browser context or disrupt the automation flow.

Content

Scanner excerpt · scripts/auto_fill.py (reported line 103)May include surrounding context.

python
'''
    
    # 执行 AppleScript
    result = subprocess.run(['osascript', '-e', script], 
                          capture_output=True, text=True)
    
    if result.returncode == 0:

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The top-level docstring and publish method description frame the tool as an automatic publisher, which implies the note will be posted automatically. However, the code's actual user-facing completion steps explicitly require manual image upload and manual publication, contradicting the stated intent rather than merely omitting detail.

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 · scripts/ctrip_auto_publish.py (reported line 23)May include surrounding context.

python
def check_chrome_running(self):
        """检查 Chrome 是否运行"""
        result = subprocess.run(
            ['pgrep', '-x', 'Google Chrome'],
            capture_output=True
        )

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 · scripts/ctrip_auto_publish.py (reported line 32)May include surrounding context.

python
def open_chrome(self):
        """打开 Chrome 浏览器"""
        print("🌐 正在打开 Chrome...")
        subprocess.Popen(['open', '-a', 'Google Chrome'])
        time.sleep(3)
        
    def ensure_chrome_window(self):

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script silently takes control of the user's existing Chrome session and executes AppleScript/JavaScript without a consent gate, warning, or isolation boundary. In skill context this is more dangerous because it reuses the user's authenticated browser state, enabling unintended form submission, content manipulation, or access to sensitive pages if the controlled tab/session is not what the user expects.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
91% confidence
Finding

This call executes AppleScript against the user's Chrome instance, giving the script UI-control capability over an already-authenticated browser session without explicit runtime consent. In the context of an automation skill, controlling a live browser can trigger unintended navigation or actions on behalf of the user if the script is modified, reused, or pointed at a different page.

Content

Scanner excerpt · scripts/ctrip_auto_publish.py (reported line 46)May include surrounding context.

python
activate
        end tell
        '''
        subprocess.run(['osascript', '-e', script])
        time.sleep(2)
        
    def navigate_to_publish_page(self):

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
93% confidence
Finding

This AppleScript invocation navigates the user's active Chrome tab to a target URL, which is a privileged UI action against the user's live browser context. While the URL is hardcoded here, the pattern is dangerous because it enables silent session reuse and browser steering without an approval step, especially risky if the user is logged into sensitive sites in the same browser.

Content

Scanner excerpt · scripts/ctrip_auto_publish.py (reported line 62)May include surrounding context.

python
end tell
        end tell
        '''
        result = subprocess.run(['osascript', '-e', script], capture_output=True, text=True)
        if result.returncode != 0:
            print(f"⚠️ 导航警告: {result.stderr}")
        print("🚀 已导航到携程发布页面")

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
96% confidence
Finding

This function executes arbitrary JavaScript in the active Chrome tab via AppleScript. Even though current call sites are aimed at form filling, the capability is broadly powerful: any later change or injected input could manipulate page content, extract DOM data, or perform authenticated actions in the user's browser session.

Content

Scanner excerpt · scripts/ctrip_auto_publish.py (reported line 80)May include surrounding context.

python
end tell
        end tell
        '''
        result = subprocess.run(['osascript', '-e', script], capture_output=True, text=True)
        return result.stdout.strip()
        
    def fill_title(self, title):

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes a much broader end-to-end capability: searching Bing Images, uploading images, selecting destination, and automatically clicking publish. In the actual publish method, the code only ensures Chrome is open, navigates to the page, fills title/content/destination, then explicitly instructs the user to manually upload images and click publish; click_publish exists but is never called from the flow.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation and console messaging frame the script as part of automatic publishing, while the actual generated JavaScript performs only form-filling for title, content, and destination. This is an active intent mismatch because the wording suggests broader publishing automation than the code actually carries out.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module description and user-facing instructions indicate the skill is presented in Chinese only. Per the policy, forcing a specific language without offering user choice or documenting a justified locale constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest describes a fully automatic Ctrip publishing skill that searches Bing Images, uploads images, selects destinations, and clicks publish. In this file, the implemented behavior is limited to generating JavaScript that fills title/body/destination fields and instructs the user to manually paste it into Chrome; there is no image search, no upload automation, and no publish action in code.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The manifest describes a skill that searches Bing Images, fills in title/body, uploads images, selects destinations, and clicks publish automatically. In this file, the implemented behavior is limited to listing a few Ctrip URLs and opening the homepage in a browser, with no automation of content creation or publishing steps.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module docstring, function docstring, and all user-facing print messages are written only in Chinese, which imposes a specific language on users without offering any locale choice. This matches the policy category for language or locale constraints that are not opt-in or otherwise justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

文件整体以中文命名、中文描述并围绕中文站点交互展开,但没有说明这是面向特定语言用户的限定场景,也未提供语言或地区选择机制。若该技能在通用环境中分发,可能构成默认强制特定语言/locale 的自然语言策略问题。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The docstring states the function is to '打开携程发布页面,准备发布内容', which implies content preparation as part of the script's behavior. However, the code does not prepare any content; it merely opens the page and prompts the user to tell it what to publish after login.

Content

No source excerpt is available for this finding.