Back to skill

Security audit

X Tweet Fetcher

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches its social-media fetching purpose, but it includes under-disclosed router command queuing and weak URL controls that could reach internal services through the local browser helper.

Install only if you are comfortable with broad outbound scraping/search behavior and a local Camofox browser service. Do not feed it untrusted URLs, avoid using cookies or sensitive queries, and disable or remove the router-agent fallback unless you intentionally operate that external command queue and understand that it can use a home network path.

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)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/fetch_china.py:115
Finding

Weak URL Validation Allows Internal-Network Browsing Through Camofox

Content
View full analysis
Optional[str]: """Auto-detect platform from URL.""" for platform, pattern in PLATFORM_PATTERNS.items(): if re.search(pattern, url, re.IGNORECASE): return platform return None ``` The individual parsers repeat the same validation pattern and then forward the original URL to Camofox: ```python def can_handle(self, url: str) -> bool: return bool(re.search(r'weibo\.(com|cn)', url, re.IGNORECASE)) def fetch(self, url: str, port: int = 9377) -> Dict[str, Any]: session_key = f"weibo-{int(time.time())}" snapshot = camofox_fetch_page(url, session_key, wait=8, port=port) ``` Equivalent substring checks and Camofox fetches are present for Bilibili and CSDN. ### Technical Analysis The platform-validation logic searches the complete user-supplied URL for a recognizable domain substring. It does not parse the URL and verify that the actual destination hostname belongs to the intended platform. Consequently, an unrelated or internal destination can pass validation merely by including a trusted platform name elsewhere in the URL, such as in the path, query string, or user-information component. For example: ```text http://127.0.0.1:8080/?target=weibo.com http://192.168.1.1/csdn.net http://169.254.169.254/latest/meta-data/?bilibili.com ``` After the substring check succeeds, the unmodified URL is passed to `camofox_fetch_page()`. Camofox o ...[truncated 1593 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/fetch_china.py:1286
Finding

Xiaohongshu Fetching Automatically Writes Commands to an External Router-Agent Queue

Content
View full analysis
Optional[str]: """Fetch page HTML via router's home IP (bypasses geo-block).""" import subprocess import shlex cmd_queue = "/root/router-agent/cmd-queue" cmd_output = "/root/router-agent/cmd-output" # Write curl command to router queue curl_cmd = ( f'curl -sL {shlex.quote(url)} ' f'-H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) ' f'AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1" ' f'-H "Accept: text/html" ' f'-H "Accept-Language: zh-CN,zh;q=0.9" ' f'--max-time 15 2>/dev/null' ) try: # Clear old output open(cmd_output, 'w').close() # Queue command with open(cmd_queue, 'w') as f: f.write(curl_cmd) # Wait for router to execute (polls every minute) print("[xiaohongshu] Waiting for router fetch (up to 90 seconds)...", file=sys.stderr) for _ in range(18): time.sleep(5) try: with open(cmd_output, 'r') as f: content = f.read() if content and len(content) > 500: return content except FileNotFoundError: pass ``` The router mechanism is invoked automatically during an ordinary Xiaohongshu fetch: ```python # Method 1: Try router home IP (bypasses geo-block) print("[xiaohongshu] Attempting fetch through router home IP...", file=sys.stderr) html = self._fetch_via_router(canonical) ``` ### Technical Analysis The Xiaohongshu parser automatically ...[truncated 2461 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (61)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

There is a clear description-to-code mismatch. The declared description advertises substantial scraping/search/monitoring capabilities across multiple platforms, but the supplied code chunk contains only an empty package initializer with no functional logic. This is not merely an omitted supporting detail; the actual code shown does not implement or evidence any of the claimed primary behaviors.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents the skill primarily as an X/Twitter data fetcher with additional Chinese-platform support and extra features like Google search and X-Tracker monitoring. The supplied code chunk does not implement the primary claimed purpose at all: it only implements fetching/parsing for Chinese platforms. While some declared Chinese platforms do match (Weibo, Bilibili, CSDN, WeChat), the absence of any Twitter/X functionality is a material mismatch because the advertised core capability is missing from this code. The code also includes additional capabilities not reflected in the description for this chunk, notably Douyin and Xiaohongshu support, proxy/cookie handling, and a router-agent based fetch path that writes shell commands to external files for execution. Therefore the description does not accurately represent this code chunk's actual behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied code is largely consistent with the X/Twitter-fetching portion of the description: it fetches single tweets, replies, user timelines, X articles, and list tweets without direct Twitter API keys, using FxTwitter and Camofox/Nitter. However, the declared description materially overstates capabilities that are not present in this code chunk. There is no code for Weibo/Bilibili/CSDN/WeChat support. There is no implementation of a camofox_search() helper here beyond importing it from another module for mention searching. Most importantly, the 'NEW: X-Tracker for tweet growth monitoring with burst detection' claim does not match the implemented monitor mode, which merely searches Google for mentions of a username, stores seen URLs locally, and reports newly discovered mentions incrementally. That is a meaningful behavior mismatch rather than a minor implementation detail.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The description presents a broad tool centered on fetching X/Twitter content, with additional support for Chinese platforms and Camofox-based search. The supplied code chunk, however, only implements WeChat article discovery through Sogou plus URL resolution. That partial overlap with the declared Chinese-platform support is not enough to make the description accurate for this chunk, because the actual primary behavior here is narrowly scoped to WeChat search and includes specific traffic-routing/evasion mechanisms (SSH proxy, home-router command queue) not mentioned in the declared purpose. There are no Twitter-fetching, reply/timeline retrieval, or X-Tracker monitoring capabilities in this code segment. Therefore this chunk materially differs from the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This code chunk does not implement tweet fetching, replies, timelines, Chinese platform scraping, Google search, or growth monitoring. Instead, its primary purpose is update checking: it spawns a background thread, accesses the GitHub releases API, stores cache data locally, and prints version notices. Those are materially different capabilities and resource accesses from the declared description, so this chunk is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description emphasizes a multi-platform fetcher with direct retrieval capabilities for tweets, replies, timelines, Chinese platforms, and growth monitoring, with Camofox search as an auxiliary feature. The supplied code instead implements a narrow discovery tool that searches the public web for x.com results by keyword, primarily via DuckDuckGo, with Camofox only as fallback. Its primary behavior is search/discovery plus cache-based deduplication, not content fetching or platform-wide support. This is a material description-behavior mismatch for this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a broad multi-platform fetcher with X/Twitter tweet, reply, timeline, and search support, Chinese-platform support, a camofox_search Google-search feature, and X-Tracker growth monitoring. This code chunk instead implements a narrow watcher: it fetches a Nitter search page for @mentions of one username, parses mentions, filters for recent unseen items, stores cache/results locally, and uses exit codes as a notification mechanism. That is materially different from the declared primary purpose and includes behavior not clearly disclosed, especially account-specific mention monitoring and alert signaling. While Nitter scraping is related to X/Twitter retrieval, the implemented functionality in this chunk does not match the broad declared feature set and omits the advertised capabilities.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 82)May include surrounding context.

md
python3 scripts/fetch_china.py --url "https://weibo.com/..." # Weibo

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 83)May include surrounding context.

md
python3 scripts/fetch_china.py --url "https://weibo.com/..." # Weibo

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 84)May include surrounding context.

md
python3 scripts/fetch_china.py --url "https://weibo.com/..." # Weibo

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 85)May include surrounding context.

md
python3 scripts/fetch_china.py --url "https://weibo.com/..." # Weibo

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The Xiaohongshu fetch path exceeds normal content retrieval by writing a shell command into local router-agent IPC files and waiting for another component to execute it. That creates a command-orchestration primitive tied to user-controlled URLs, and also intentionally bypasses geographic access controls, making the skill materially more dangerous than its stated purpose of fetching public posts.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code performs local file IPC with fixed paths under /root/router-agent to trigger out-of-process command execution, which is not expected for a scraper skill. Even though the URL is shell-quoted, the dangerous behavior is the hidden delegation of command execution to another privileged subsystem, expanding trust boundaries and enabling misuse if the queue consumer or path permissions are weak.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

The code constructs a shell command string and places it into a router-executed queue, delegating execution to another system outside the current process. Even though the URL component is shell-quoted, this still constitutes tool-parameter abuse because a content-search skill is generating executable commands for an external agent, creating an indirect command-execution pathway and trust-boundary violation.

Content

Scanner excerpt · scripts/sogou_wechat.py (reported line 56)May include surrounding context.

python
except FileNotFoundError:
        before_len = 0
    
    # Queue the curl command — router will fetch raw HTML
    encoded_kw = quote(keyword)
    search_url = f'https://weixin.sogou.com/weixin?type=2&query={encoded_kw}'
    cmd = f'curl -s {shlex.quote(search_url)} -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"'

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README prominently promotes scraping-like fetching, monitoring, search, and cross-platform data collection 'without login or API keys' while omitting clear warnings about external requests, privacy implications, and potential terms-of-service issues. In an agent context, this can encourage operators to deploy unattended monitoring and data collection without understanding what third parties are contacted or what personal data may be processed.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill is presented as a tweet/content fetcher for X/Twitter and related platforms, but the documented 'User profile analysis' feature adds MBTI, Big Five, and topic-graph inference. Personality analysis is a distinct profiling capability that is not a direct or obvious requirement of fetching tweets, timelines, replies, or search results.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises and documents capabilities that imply network, shell, file, and environment access, but it does not declare any explicit tool scope or permission boundaries. In an agent ecosystem, missing least-privilege declarations increases the chance the agent can invoke more powerful tools than users expect, enabling unintended file access, command execution, or outbound requests.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill promotes Google searching through an anti-detection browser but does not warn users that their search terms will be transmitted to external services and potentially to the local Camofox service. Search queries often contain sensitive investigation topics, credentials by mistake, or proprietary data, so omission of this disclosure can cause unintended data exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The Camofox setup and REST API sections describe opening arbitrary URLs and retrieving page snapshots from a local browser service without warning that visited URLs, cookies/session context, and page contents may be processed, stored, or exposed by that service. In a security-sensitive agent context, this can leak sensitive targets or content to an auxiliary component users may not realize is in the data path.

Content

No source excerpt is available for this finding.

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · scripts/camofox_client.py (reported line 21)May include surrounding context.

python
def check_camofox(port: int = 9377) -> bool:
    """Return True if Camofox is reachable."""
    try:
        req = urllib.request.Request(f"http://localhost:{port}/tabs", method="GET")
        with urllib.request.urlopen(req, timeout=3) as resp:
            resp.read()
        return True

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · scripts/fetch_tweet.py (reported line 205)May include surrounding context.

python
def check_camofox(port: int = 9377) -> bool:
    """Return True if Camofox is reachable."""
    try:
        req = urllib.request.Request(f"http://localhost:{port}/tabs", method="GET")
        with urllib.request.urlopen(req, timeout=3) as resp:
            resp.read()
        return True

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
84% confidence
Finding

The client sends caller-controlled URLs to a local browser automation service, which will fetch and render those destinations. While the Python code only talks to localhost, it effectively delegates arbitrary outbound browsing to Camofox, enabling access to internal-only resources or sensitive local web apps if untrusted input can reach camofox_open_tab.

Content

Scanner excerpt · scripts/camofox_client.py (reported line 40)May include surrounding context.

python
"sessionKey": session_key,
            "url": url,
        }).encode()
        req = urllib.request.Request(
            f"http://localhost:{port}/tabs",
            data=payload,
            headers={"Content-Type": "application/json"},

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · scripts/camofox_client.py (reported line 69)May include surrounding context.

python
def camofox_close_tab(tab_id: str, port: int = 9377):
    """Close a Camofox tab."""
    try:
        req = urllib.request.Request(
            f"http://localhost:{port}/tabs/{tab_id}",
            method="DELETE",
        )

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · scripts/fetch_tweet.py (reported line 221)May include surrounding context.

python
def camofox_close_tab(tab_id: str, port: int = 9377):
    """Close a Camofox tab."""
    try:
        req = urllib.request.Request(
            f"http://localhost:{port}/tabs/{tab_id}",
            method="DELETE",
        )

Internal Network Request

Medium
Category
Server-Side Request Forgery
Confidence
70% confidence
Finding

Code issues a request to a loopback, link-local, or private-range host. This can reach internal services not meant to be exposed and is a common SSRF pivot.

Content

Scanner excerpt · scripts/fetch_tweet.py (reported line 249)May include surrounding context.

python
def camofox_close_tab(tab_id: str, port: int = 9377):
    """Close a Camofox tab."""
    try:
        req = urllib.request.Request(
            f"http://localhost:{port}/tabs/{tab_id}",
            method="DELETE",
        )

Static analysis

No suspicious patterns detected.