Back to skill

Security audit

QR Code Generation And Recognition - 二维码生成识别

Security checks for vulnerabilities and agentic risk

Overview

This QR-code skill is a straightforward JisuAPI integration, with external processing and API-key use that fit its stated purpose but deserve normal privacy caution.

Install only if you are comfortable sending QR text, QR image URLs, base64 QR images, logo URLs, and your JisuAPI key to JisuAPI. Avoid using it for QR codes that may contain secrets, internal links, credentials, private customer data, or tokens unless that disclosure is acceptable; use a dedicated least-privileged API key and monitor quota usage.

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

Warning
Location
qrcode.py:18
Finding

API Credential Exposed in URL Query String

Content
View full analysis

Vulnerability Details

File Location: qrcode.py, lines 18–23
Vulnerability Type: API credential disclosure through URL query parameters
Risk Level: Medium

python
def _call_api(path: str, appkey: str, params: dict = None):
    if params is None:
        params = {}
    all_params = {"appkey": appkey}
    all_params.update({k: v for k, v in params.items() if v not in (None, "")})

    url = f"{BASE_URL}/{path}"
    try:
        resp = requests.get(url, params=all_params, timeout=10)

Technical Analysis

The _call_api function places JISU_API_KEY into all_params and passes that dictionary to requests.get through the params argument. The requests library serializes these parameters into the URL query string, producing a request resembling:

text
https://api.jisuapi.com/qrcode/generate?appkey=REDACTED&text=...

HTTPS protects the complete URL while it is transmitted over the network, but it does not prevent the URL from being recorded at either endpoint or by trusted infrastructure. Query strings may appear in application diagnostics, reverse-proxy access logs, API gateway logs, monitoring systems, exception reports, or debugging output. A reusable API credential should therefore not be included in a URL when a safer provider-supported transport is available.

Attack Path

  1. A user or automated agent invokes the generate, read, or template command.
  2. The script reads the reusable credential from the JISU_API_KEY environment variable.
  3. _call_api inserts that credential into the GET request's query string.
  4. The complete request URL is recorded by the API provider, a reverse proxy, monitoring infrastructure, or application diagnostics.
  5. An attacker or unauthorized operator with access to those records extracts the appkey value.
  6. The attacker submits requests directly to JisuAPI using the recovered credential.

Exploitation requires access to ...[truncated 671 chars]

Remediation
View remediation

Remediation Suggestions

  1. Consult the provider's current API specification and, if supported, send the credential in an authorization header rather than in the URL:

    python
    headers = {"Authorization": f"Bearer {appkey}"}
    resp = requests.post(url, json=params, headers=headers, timeout=10)
    
  2. If the provider requires the key in a request body, use a POST request and place it in the body instead of the query string.

  3. If JisuAPI only supports query-string authentication, treat this as a provider-imposed residual risk:

    • Disable or redact query-string logging in clients, proxies, API gateways, monitoring tools, and error-reporting systems.
    • Ensure logs are access-controlled, encrypted, and retained only as long as necessary.
    • Never print the prepared request URL or include it in user-visible error messages.
    • Use a dedicated, least-privileged key for this skill and avoid sharing it with unrelated services.
  4. Rotate the currently configured API key if request URLs may already have been logged.

  5. Monitor provider usage for unexpected requests, quota spikes, and calls from unrecognized source addresses.

  6. Where supported, configure provider-side restrictions such as API-level scope, source-IP allowlisting, spending limits, and rate limits.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill requires environment access for an API key and performs network-backed operations, but it does not declare an explicit tool scope such as permissions or allowed-tools. This weakens governance and review because callers may not realize the skill can transmit user data and secrets to an external service.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger guidance is broad enough that the skill may be invoked for generic '二维码 API 问题' requests without clearly signaling that third-party network calls will occur. Overbroad invocation criteria can cause unintended routing of sensitive links, images, or base64 content to an external provider.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill description omits a user-facing warning that QR contents and supplied image URLs/base64 are transmitted to JisuAPI for processing. Users may unknowingly expose sensitive URLs, tokens, internal endpoints, or embedded data in QR codes to a third party.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The skill's QR read operation depends on an external API endpoint, which means submitted QR image URLs or base64 payloads leave the local trust boundary. This is especially relevant because QR codes often encode sensitive links, credentials, internal addresses, or tracking data.

Content

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

bash
python3 skills/qrcode/qrcode.py read '{
  "qrcode": "https://api.jisuapi.com/qrcode/static/images/sample/1.png"
}'

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The module description and command examples include Chinese-language instructional text, which can impose a language preference on users without opt-in. The file does not indicate that the skill is region-specific or provide an alternative language option.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The code is explicitly designed to transmit user data to an external endpoint at api.jisuapi.com. In this skill, that matters because QR text, image URLs, or base64 image contents may contain sensitive information, and there is no minimization, warning, or trust-boundary documentation for users.

Content

Scanner excerpt · qrcode.py (reported line 14)May include surrounding context.

python
import requests


BASE_URL = "https://api.jisuapi.com/qrcode"


def _call_api(path: str, appkey: str, params: dict = None):

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The read/generate functionality sends user-supplied QR payloads or image/base64 data to a third-party service, but the code provides no user-facing notice, consent flow, or privacy warning. In a skill context, users may reasonably assume local processing, so sensitive URLs, tokens, or embedded data could be unintentionally disclosed externally.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · qrcode.py (reported line 90)May include surrounding context.

python
请求 JSON 示例:
    {
        "qrcode": "https://api.jisuapi.com/qrcode/static/images/sample/1.png"
    }
    或 qrcode 为 base64 图片内容。
    """

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · qrcode.py (reported line 114)May include surrounding context.

python
请求 JSON 示例:
    {
        "qrcode": "https://api.jisuapi.com/qrcode/static/images/sample/1.png"
    }
    或 qrcode 为 base64 图片内容。
    """

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The script reads JISU_API_KEY from the environment to authenticate outbound requests. While this is a normal implementation detail, the code provides no user-facing notice that an external credential is required and will be used for third-party API calls.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.