Back to skill

Security audit

Keruyun Api Fetcher

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a Keruyun API reference skill, not malware, but its high-impact business API metadata has confirmed accuracy and packaging issues users should review.

Install only if you need this Keruyun API reference, and treat it as documentation rather than an automation authority. Verify payment, withdrawal, transfer, employee-management, coupon, CRM asset, and inventory endpoints against official Keruyun docs before use, and require explicit human approval before any real write or money-moving call. Do not run scripts/scrape.py unless you trust the external scraper-template dependency it imports.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
scripts/scrape.py:11
Finding

Untrusted External Python Module Loaded Through Runtime Path Modification

Content
View full analysis

Vulnerability Details

File Location: scripts/scrape.py, lines 11–14
Vulnerability Type: Unpinned and unaudited external executable dependency
Risk Level: Medium

Vulnerable Code

python
# 添加模板路径
TEMPLATE_DIR = Path(__file__).parent.parent.parent / "scraper-template" / "scripts"
sys.path.insert(0, str(TEMPLATE_DIR))
from scrape_base import OpenPlatformScraper

Technical Analysis

The script constructs a path outside the project directory, prepends that path to Python's module search path, and imports scrape_base. The referenced scraper-template/scripts/scrape_base.py module is not included in the audited artifact and therefore could not be reviewed or integrity-verified.

Because Python executes top-level module code during import, any code in scrape_base.py runs immediately with the privileges of the user invoking the scraper. Prepending the external directory with sys.path.insert(0, ...) gives that location priority during module resolution.

The dependency is neither bundled nor pinned to a version or cryptographic hash. Consequently, the effective runtime behavior of the scraper depends on executable code outside the audited project.

Attack Path

  1. An attacker obtains write access to the expected sibling path scraper-template/scripts, or compromises the process that populates that dependency.
  2. The attacker creates or modifies scrape_base.py and adds malicious top-level Python code.
  3. A user runs python3 scripts/scrape.py.
  4. The script prepends the attacker-influenced directory to sys.path.
  5. Python imports scrape_base.py and executes its top-level code before the scraper's main workflow begins.
  6. The malicious module operates with the same OS identity and permissions as the user running the Skill.

This path requires the attacker to control or modify the external dependency location; the audited code does not itself download that module.

Impact Assessment

Successful exploitation permits arbi ...[truncated 501 chars]

Remediation
View remediation

Remediation Suggestions

  1. Bundle the required scraper base module inside the project so that all executable code can be audited together.
  2. Import it through a normal package-relative import rather than modifying sys.path, for example:
python
from .scrape_base import OpenPlatformScraper
  1. If the component must remain a third-party dependency, distribute it through a trusted package repository and pin an exact version and cryptographic hashes in a lock file.
  2. Verify the dependency's integrity before loading it, particularly in automated build or execution environments.
  3. Ensure the dependency directory is not writable by untrusted users or lower-privileged processes.
  4. Run the scraper under a least-privileged account or sandbox with only the filesystem and network access required for scraping the declared Keruyun documentation site.
  5. Add automated checks that reject imports resolved from locations outside the project or its controlled virtual environment.
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • 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
Findings (67)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
cat references/_all_apis_complete.json

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
with open('references/_modules_organized.json') as f:

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Several store-employee APIs are documented with the unrelated description "门店商品信息分页查询" while the actual endpoints create, update, enable, disable, and query employees. In an agent skill that may autonomously select APIs from metadata, this semantic mismatch can cause the agent to invoke sensitive employee-management operations under a misleading label, resulting in unintended account lifecycle changes or personnel data exposure.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The entry labeled "储值" points to /open/standard/crm/listLevelRules, which is a membership level-rules query endpoint rather than a stored-value operation. This kind of mislabeled financial capability is dangerous in an agent context because downstream logic may believe it is handling balance-affecting actions while actually querying unrelated data, leading to faulty workflows, wrong trust assumptions, and possible misuse of privileged CRM functions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The entry labeled "积分" also points to the membership level-rules query endpoint instead of a points-related API. In an agent-controlled integration, this can misroute loyalty operations and cause the model or automation to make incorrect decisions about customer balances, rewards, or eligibility based on mislabeled metadata.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The entry labeled "券模板" is wired to the membership level-rules endpoint rather than a coupon-template API. Because coupon issuance and template selection are sensitive business actions, misleading metadata can cause an agent to query or act on the wrong resource class, producing authorization mistakes, logic errors, or broken promotional workflows.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The entry labeled "券实例" again targets the membership level-rules query endpoint, not a coupon-instance API. Reusing a wrong endpoint for multiple unrelated business functions increases the chance that an agent will make incorrect calls under false assumptions, which is especially risky where coupon instance operations may involve customer entitlements and redemption state.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Supply-chain and finance endpoints involving payments, withdrawals, transfers, and inventory mutations are described with unrelated low-risk text, masking high-impact side effects. This is particularly dangerous in an agent skill because it can trick orchestration logic into initiating money movement or irreversible stock operations without proper safeguards.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Third-party coupon redemption and reversal operations are mapped to a query API, directly contradicting the write semantics of核销/反核销. This is more dangerous than a simple naming error because security-sensitive financial/benefit operations may be implemented or authorized incorrectly, leading to failed redemption controls, double-spend conditions, or misuse of coupon balances.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s natural-language instructions and descriptions are entirely in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This JSON file uses Chinese titles, descriptions, status text, and field explanations end-to-end, including user-facing strings like 请求成功 and numerous Chinese API names. Under the policy rule, forcing a specific language without opt-in or an explicit justified regional constraint is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 1207)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 1241)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 1257)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 2075)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 2085)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 2090)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 2100)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 2123)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 2935)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 2960)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 2987)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 3163)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 3188)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/_all_apis_complete.json (reported line 3215)May include surrounding context.

json
"weight": 99999,
            "unitName": "份",
            "helpCode": "hsr1",
            "comboGroupList": [
              {
                "groupName": "3选2",
                "maxChoose": 3,

Static analysis

No suspicious patterns detected.