Back to skill

Security audit

paper-rewrite

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real paid paper-rewrite integration, but it sends full paper text to an external service over HTTPS with certificate and hostname checks disabled.

Review this carefully before installing. It is not showing destructive or persistent behavior, but it sends the submitted paper text to a paid external endpoint and currently disables normal HTTPS identity checks. Do not use it for confidential, unpublished, regulated, or proprietary writing unless the publisher fixes TLS verification and provides clear privacy, retention, and payment-consent terms.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/rewrite.py:17
Finding
TLS Certificate and Hostname Verification Disabled## Vulnerability Details **File Location**: `scripts/rewrite.py`, lines 17–20 and line 40 **Vulnerability Type**: Improper TLS certificate validation **Risk Level**: High ### Vulnerable Code ```python # Skip self-signed certificate verification (temporary workaround) SSL_CONTEXT = ssl.create_default_context() SSL_CONTEXT.check_hostname = False SSL_CONTEXT.verify_mode = ssl.CERT_NONE ``` The insecure context is subsequently used for the request: ```python resp = urllib.request.urlopen(req, context=SSL_CONTEXT, timeout=200) ``` ### Technical Analysis The script explicitly disables both certificate-chain validation and hostname verification. Consequently, TLS encrypts the connection but does not authenticate the remote service at `https://192.144.154.90/demo/a2m/resource`. Because `ssl.CERT_NONE` accepts an arbitrary server certificate and `check_hostname = False` prevents endpoint identity validation, an attacker capable of intercepting network traffic can present any certificate and impersonate the configured service. The client will then transmit the user-supplied paper to the attacker's endpoint. The same weakness also allows the attacker to forge service responses. This includes ordinary rewrite results and HTTP 402 responses containing attacker-controlled `Payment-Needed` headers and JSON details. Although the local script does not execute payment itself, downstream agents or integrations could rely on this unauthenticated payment metadata. ### Attack Path 1. A user submits paper content through the skill. 2. The script creates a POST request containing the content as JSON. 3. An attacker with a network interception position redirects or intercepts traffic to the configured IP address. 4. The attacker presents a self-signed or otherwise untrusted TLS certificate. 5. The script accepts that certificate because certificate and hostname verification are disabled. 6. The attacker receives the submitted p ...[truncated 796 chars]
Remediation
## Remediation Suggestions 1. Deploy the service under a stable DNS hostname with a certificate issued by a trusted certificate authority. 2. Remove the custom context that disables verification and use Python's secure defaults: ```python SSL_CONTEXT = ssl.create_default_context() resp = urllib.request.urlopen( req, context=SSL_CONTEXT, timeout=200, ) ``` Alternatively, omit the `context` argument so `urlopen` uses the default validated TLS context. 3. Do not set `verify_mode` to `ssl.CERT_NONE` or disable `check_hostname` in production. 4. If a private certificate authority is required, install its CA certificate explicitly and configure the context with `cafile`; do not disable validation globally. 5. If connecting by IP is unavoidable, use a certificate whose subject alternative name includes that IP address and retain full certificate verification. 6. Treat all HTTP response bodies and payment-related headers as untrusted input. Validate their schema, expected issuer, destination, amount, and transaction context before downstream processing. 7. Consider certificate or public-key pinning only as an additional control with a documented key-rotation process, not as a substitute for standard TLS validation.
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 (6)

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill invokes an external network service but does not declare permissions or clearly surface that capability in a permission model. This can cause users or hosting platforms to underestimate that submitted paper contents will be transmitted off-platform to a third-party endpoint, creating privacy and data-governance risk for potentially sensitive academic material.

Context-Inappropriate Capability

Medium
Confidence
98% confidence
Finding
The code explicitly disables both certificate validation and hostname verification for HTTPS requests, which makes the TLS channel unauthenticated. An attacker positioned on the network can impersonate the remote rewrite service, read the full paper text in transit, and tamper with responses such as payment instructions or returned content.

Intent-Code Divergence

Low
Confidence
90% confidence
Finding
The comment frames disabled certificate verification as a temporary workaround, but the implementation applies it unconditionally to all requests. This creates a persistent insecure deployment state that is easy to forget, normalizes unsafe transport, and leaves confidential paper content exposed to interception.

Vague Triggers

Medium
Confidence
88% confidence
Finding
The trigger phrases are generic conversational requests like '帮我改写一下' and '论文降重', which can match ordinary user intent without making it clear that a paid external service will be activated. This increases the chance of unintended invocation, resulting in surprise billing and unintentional disclosure of paper text to the remote service.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill description presents the feature as a simple rewrite function without an upfront warning that user paper text will be transmitted to an external paid service. In this context, the submitted content may include unpublished research, student work, or proprietary material, so lack of prominent disclosure materially raises privacy, confidentiality, and consent risks.

Missing User Warnings

High
Confidence
93% confidence
Finding
The function sends the user's full paper text to an external service endpoint without any user-facing disclosure, consent flow, or privacy notice. Because papers may contain unpublished research, personal data, or proprietary material, silent exfiltration to a third party creates a meaningful confidentiality and compliance risk.

Static analysis

Detected: suspicious.insecure_tls_verification

HTTPS certificate verification is disabled.

Warn
Code
suspicious.insecure_tls_verification
Location
scripts/rewrite.py:18