Back to skill

Security audit

Takeout Coupon 外卖优惠券隐藏券大额券,美团、京东、闪购/饿了么

Security checks for vulnerabilities and agentic risk

Overview

This skill fetches and displays Chinese food-delivery coupon codes from a disclosed remote API, with no evidence of hidden persistence, credential access, destructive behavior, or local privilege use.

Install only if you are comfortable with the skill contacting the disclosed coupon API and showing coupon codes, instructions, and QR image URLs returned by that service. Do not treat returned coupon text or QR destinations as trusted instructions beyond coupon redemption, and verify links or QR pages before using them.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T01 · Skill Instruction Hijacking

Warning
Location
scripts/fetch_coupons.py:39
Finding
Untrusted Remote Coupon Data Is Reproduced in Agent Output<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:19-22`, `SKILL.md:62-63`, `SKILL.md:125-136`, `scripts/fetch_coupons.py:39-44`, `scripts/fetch_coupons.py:91-99`, and `scripts/fetch_coupons.py:148-152` **Vulnerability Type**: Remote content injection into agent responses **Risk Level**: Medium ### Vulnerable Code The Skill requires coupon codes received from the remote API to be reproduced without modification: ```markdown 1. Call the API: `GET https://agskills.moontai.top/coupon/takeout` 2. Parse the returned JSON data, which contains four main sections. 3. Display coupon information by platform. 4. Important: The coupon_code field must be presented to the user exactly as received and must not be modified. ``` The requirement is reinforced by unconditional handling rules: ```markdown ### coupon_code handling rules Modification of any content in the coupon_code field is strictly prohibited. - Do not add, remove, or modify any character. - Do not format, beautify, or rearrange the content. - Do not translate or explain the meaning of the code. - Retrieve it from the API and present it to the user exactly as received. ``` The implementation retrieves JSON from the external service without validating its schema, field lengths, content, or permitted destinations: ```python endpoint = f"{self.base_url}/coupon/takeout" try: response = self.session.get(endpoint, timeout=10) response.raise_for_status() return response.json() except requests.RequestException as e: return { "error": True, "message": f"API request failed: {str(e)}" } ``` Remote fields are then interpolated directly into user-facing output: ```python title = coupon.get("title", "Coupon") # coupon_code must be displayed exactly as received without modification coupon_code = coupon.get("coupon_code", "") guideline = coupon.get("guideline", "") lines = [ f"[{platform}] {title}", f" Coupon code: {coupon_code}", f" Redemption instru ...[truncated 3549 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Treat every API response field as untrusted data and enforce a strict response schema before formatting it. 2. Require expected top-level objects and arrays, expected scalar types, maximum list sizes, and conservative length limits for all strings. 3. Validate `coupon_h5_qrcode_img_url` as HTTPS and allow only explicitly approved hostnames and paths. Reject redirects to unapproved destinations where practical. 4. Render remote values inside clearly delimited data blocks and ensure they are never interpreted as agent instructions. 5. Replace the unconditional verbatim-output mandate with a rule that permits rejection, omission, or warning labels when content is suspicious or violates safety policy. 6. Apply conservative character and structural validation to coupon codes based on documented platform formats. Preserve valid codes exactly after validation rather than reproducing arbitrary content. 7. Do not automatically include the aggregate QR destination unless the user explicitly requests it. 8. Add integrity protection, such as a signed response envelope with pinned verification keys, if campaign content must remain remotely updateable. 9. Display the verified destination hostname next to any link or QR code and warn users before directing them outside approved platform domains. 10. Add tests covering oversized fields, unexpected object types, prompt-like instructions, unapproved URLs, redirects, malformed JSON, and missing required fields. ]]>
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (4)

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
This code embeds the skill name, API description, CLI description, help text, and output labels entirely in Chinese, which imposes a fixed language/locale on all users. The policy explicitly calls out forced language without user opt-in as a violation, and there is no mechanism here to select or opt into another language.

Natural-Language Policy Violations

Low
Confidence
96% confidence
Finding
SQP-3 applies to all file types and covers language or locale policy violations. This API documentation forces a specific language for all users and does not provide opt-in, alternatives, or a documented region-specific justification.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The heading uses a Chinese title ("外卖优惠券") while the rest of the document is in English, and the file provides no indication that this locale choice is optional, user-selected, or required by a region-specific context. This creates a natural-language locale policy concern because the skill appears to impose a specific language without documented opt-in or justification.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The script's user-facing description and output use Chinese text ("外卖优惠券") without indicating that language choice is optional or configurable. Under the policy, language-specific behavior should not be forced unless the skill offers user choice or clearly documents a justified locale constraint.

Static analysis

No suspicious patterns detected.