Back to skill

Security audit

公开社交账号分析

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly supports public social-account analysis, but it includes unsafe credential handling and an exposed signing server that need review before use.

Review before installing. Use it only for public-account analysis you are authorized to perform, avoid supplying session cookies on shared or monitored machines, clear cached cookies after use, and do not run scripts/sign_server.py unless it is restricted to loopback and protected by authentication; the Bilibili cookie path should be fixed before using real account cookies.

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

Error
Location
scripts/collectors/bilibili.py:265
Finding

Bilibili session cookies exposed in subprocess command-line arguments

Content
View full analysis

Vulnerability Details

File Location: scripts/collectors/bilibili.py:265-284
Vulnerability Type: Plaintext credential exposure through process arguments
Risk Level: High
Classification: T09: Insecure Skill Coding Practices

Vulnerable Code

python
def _curl(self, url: str, referer: str) -> str:
    """Use curl to obtain the response body."""
    self._throttle()
    cookie = "; ".join(f"{k}={v}" for k, v in self.cookies.items())
    cmd = [
        "curl", "-sS", "--compressed",
        "--max-time", str(self.timeout),
        "-A", UA,
        "-H", f"Referer: {referer}",
        "-H", "Accept: application/json, text/plain, */*",
        "-H", "Accept-Language: zh-CN,zh;q=0.9",
        "-H", "Origin: https://space.bilibili.com",
        "-H", "Sec-Fetch-Dest: empty",
        "-H", "Sec-Fetch-Mode: cors",
        "-H", "Sec-Fetch-Site: cross-site",
    ]
    if cookie:
        cmd += ["-b", cookie]
    cmd.append(url)
    try:
        proc = subprocess.run(
            cmd, capture_output=True, text=True, timeout=self.timeout + 10
        )

Technical Analysis

The collector converts all user-authorized Bilibili cookies into a plaintext HTTP cookie string and supplies that string to curl using the -b command-line option. Although the subprocess is launched without a shell, which mitigates shell injection, sensitive arguments can still be exposed through operating-system process inspection, audit infrastructure, endpoint monitoring, debugging tools, or crash diagnostics.

This behavior also conflicts with the security declaration in SKILL.md, which states that cookies do not enter command-line arguments. The network request itself is necessary for authenticated collection, but placing the credential in argv is not necessary and exceeds the minimum safe exposure required for that operation.

Attack Path

  1. A user explicitly supplies an authorized ...[truncated 1242 chars]
Remediation
View remediation

Remediation Suggestions

  • Replace the curl subprocess with an in-process HTTP client so cookies can remain in process memory and be attached directly to request headers.
  • If curl must be retained, provide sensitive configuration through a protected file descriptor or a temporary configuration file rather than through argv.
  • Create any temporary credential file with mode 0600, reject symlinks and ownership mismatches, and remove it immediately after the request.
  • Avoid placing credentials in environment variables because those may also be inspectable or captured by diagnostics.
  • Add an automated test that launches the Bilibili transport with a sentinel cookie and verifies that the sentinel does not appear in the subprocess argument vector, logs, exceptions, or artifacts.
  • Update the implementation so it conforms to the stated SKILL.md guarantee that cookies never enter command-line arguments.
  • Recommend session revocation and cookie rotation if the affected collector has already been used on a shared or monitored host.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/sign_server.py:683
Finding

Unauthenticated signing service listens on all network interfaces

Content
View full analysis

Vulnerability Details

File Location: scripts/sign_server.py:683-750
Vulnerability Type: Exposed unauthenticated signing oracle and plaintext credential-processing endpoint
Risk Level: High
Classification: T09: Insecure Skill Coding Practices

Vulnerable Code

python
@app.post("/sign", response_model=SignResponse, tags=["sign"])
async def sign(req: SignRequest) -> SignResponse:
    """Sign a single request."""
    try:
        signer = REGISTRY.get(req.platform)
    except HTTPException:
        raise
    result = await asyncio.to_thread(
        signer.sign,
        req.url,
        req.params,
        req.headers,
        method=req.method,
        body=req.body,
        cookie=req.cookie,
    )

    # Merge caller headers with signed headers.
    merged_headers: Dict[str, str] = dict(req.headers)
    for k, v in (result.get("headers") or {}).items():
        merged_headers[k] = v

    notes_parts: list[str] = []
    if signer.platform in REGISTRY._failed:
        notes_parts.append("signer previously failed to initialize")

    return SignResponse(
        platform=signer.platform,
        url=req.url,
        headers=merged_headers,
        cookies=result.get("cookies", {}) or {},
        signed_params=result.get("signed_params", {}) or {},
        drift_days=signer.drift_days,
        notes="; ".join(notes_parts) or None,
    )


def main() -> None:
    """Run uvicorn on 0.0.0.0:8000 (override with PORT/HOST)."""
    if uvicorn is None:
        raise SystemExit("uvicorn is required: `pip install uvicorn`")
    host = os.getenv("SIGN_SERVER_HOST", "0.0.0.0")
    port = int(os.getenv("SIGN_SERVER_PORT", "8000"))
    uvicorn.run(
        "sign_server:app",
        host=host,
        port=port,
        log_level=os.getenv("SIGN_SERVER_LOG_LEVEL", "info").lower(),
        reload=os.getenv("SIGN_SERVER_RELOAD", "0") == "1",
    )
``
...[truncated 3543 chars]
Remediation
View remediation

Remediation Suggestions

  • Change the default bind address from 0.0.0.0 to 127.0.0.1.
  • Require explicit configuration before permitting a non-loopback bind.
  • Add strong endpoint authentication, such as a randomly generated bearer token delivered through a protected local channel.
  • Use TLS whenever requests may cross a network boundary.
  • Remove support for arbitrary cookie and authorization headers unless a specific signer requires them.
  • Never return caller-provided credentials in the response. Return only the minimum generated signature fields.
  • Add platform-specific URL allowlists and reject unsupported schemes, authorities, embedded credentials, ports, and redirects.
  • Enforce bounded request-body and field sizes, per-client rate limits, concurrency limits, and signer execution timeouts.
  • Ensure signer subprocesses are terminated cleanly and cannot accumulate under repeated requests.
  • Disable or restrict interactive API documentation in production deployments if it unnecessarily exposes endpoint structure.
  • Align SKILL.md with the actual four-platform service, or remove sign_server.py from the packaged runtime if the collection pipeline does not require it.
  • Add tests confirming that the default service is loopback-only, unauthenticated requests are rejected, and sensitive input headers are never reflected.
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (131)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a public-account analysis tool, but the documented behavior includes scraping infrastructure, browser automation, subprocess signing, cookie ingestion/persistence, and authenticated OAuth collection. This mismatch is dangerous because operators may authorize or run the skill under a lower-risk assumption than its actual behavior warrants, leading to unexpected secret handling, authenticated access, or network activity.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.