Back to skill

Security audit

Yunlv Compliance Check

Security checks for vulnerabilities and agentic risk

Overview

This trade-compliance skill is broadly relevant to its purpose, but it overstates screening capabilities and can produce unsafe low-risk compliance advice from incomplete static data.

Review this skill carefully before installing. Treat its output only as a preliminary heuristic, not a legal or regulatory clearance. Do not rely on it for sanctions, embargo, HS-code tariff, export-control, or counterparty decisions unless you independently verify against current authoritative sources and understand what data may be sent to the declared external API or stored locally.

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/compliance-scanner.py:422
Finding

Unsupported countries fail open during sanctions and embargo assessment

Content
View full analysis

Vulnerability Details

File Location: scripts/compliance-scanner.py, lines 422-484
Vulnerability Type: Fail-open input validation and unsafe compliance defaults
Risk Level: High

Complete Code Snippet

python
def _evaluate_sanctions_risk(country: str) -> Dict:
    """评估制裁风险"""
    country_info = COUNTRY_DATA.get(country, {})
    sanctions = country_info.get("sanctions", "无")
    
    if "广泛" in sanctions or "严格" in sanctions:
        level = "极高"
        score = 100
    elif "部分" in sanctions or "独立" in sanctions:
        level = "中"
        score = 50
    else:
        level = "低"
        score = 20
    
    return {
        "dimension": "制裁",
        "level": level,
        "score": score,
        "details": [
            f"目标市场: {country}",
            f"制裁情况: {sanctions}"
        ],
        "recommendations": _get_sanctions_recommendations(level)
    }

def _get_sanctions_recommendations(level: str) -> List[str]:
    """获取制裁建议"""
    if level == "极高":
        return [
            "建议暂缓该市场业务",
            "如确需开展,建议进行专业法律评估",
            "考虑通过第三方合规渠道"
        ]
    elif level == "中":
        return [
            "建议定期关注制裁名单更新",
            "保持与专业合规机构的咨询",
            "确保交易对手不在制裁名单"
        ]
    else:
        return ["制裁风险较低,保持常规合规即可"]

def _evaluate_embargo_risk(country: str) -> Dict:
    """评估禁运风险"""
    country_info = COUNTRY_DATA.get(country, {})
    is_embargo = country_info.get("embargo", False)
    
    if is_embargo:
        level = "极高"
        score = 100
    else:
        level = "低"
        score = 10
    
    return {
        "dimension": "禁运",
        "level": level,
        "score": score,
        "details": [
            f"目标市场: {country}",
            f"禁运状态: {'是' if is_embargo else '否'}"
        ],
        "recommendations": ["该市场可正常开展贸易业务"] if not is_embargo else ["建议避免该市场业务"]
    }

Technical Analysis

The scanner retrieves country information with COUNTRY_DATA.get(country, {}). When a country is unsupporte ...[truncated 2744 chars]

Remediation
View remediation

Remediation Suggestions

  1. Reject unsupported countries before calculating any risk score:
python
def require_country(country: str) -> Dict:
    normalized = normalize_country(country)
    if normalized not in COUNTRY_DATA:
        raise ValueError(
            f"No compliance data is available for country: {country}"
        )
    return COUNTRY_DATA[normalized]
  1. Replace safe defaults with explicit unknown states. Missing sanctions or embargo information should produce:
json
{
  "level": "REVIEW_REQUIRED",
  "score": null,
  "status": "UNKNOWN",
  "recommendations": [
    "Do not proceed until the jurisdiction is verified against current authoritative sources."
  ]
}
  1. Normalize input before lookup:

    • Trim leading and trailing whitespace.
    • Apply consistent case handling.
    • Support reviewed country aliases and ISO 3166 codes.
    • Reject ambiguous names rather than guessing.
  2. Apply the same country validation to scan, country-risk, and report so all entry points have consistent behavior.

  3. Do not calculate an overall score when a mandatory dimension is unknown. Propagate REVIEW_REQUIRED to the final result.

  4. Use current authoritative sanctions and embargo sources instead of treating static bundled data as conclusive. Include the source, retrieval time, list version, and freshness status in every result.

  5. Add automated tests for:

    • Unsupported countries.
    • Misspellings.
    • Alternate country names.
    • Leading and trailing whitespace.
    • Empty country values.
    • Missing sanctions or embargo fields.
    • Stale source data.
  6. Clearly state in generated reports that the static scanner is an estimator and cannot establish legal clearance.

other

Warning
Location
SKILL.md:90
Finding

Documented compliance capabilities materially exceed the bundled implementation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 90-99 and 134-141
Vulnerability Type: Misleading security and compliance capability declaration
Risk Level: Medium

Complete Documentation Snippet

markdown
1. **关税税率查询**:查询目标国HS编码税率,识别是否有特惠税率
2. **产品认证确认**:确认目标市场所需认证及豁免条件
3. **制裁名单筛查**:对客户公司/法定代表人/关联公司进行OFAC/欧盟/联合国筛查
4. **出口管制筛查**:核查是否涉及美国EAR/欧盟dual-use管制
5. **禁运判断**:判断目的地是否为禁运国家
6. **付款风险**:评估付款方式合规性(LC/T/T及银行合规要求)
7. **综合评分**:整合以上维度输出风险等级和处置建议
markdown
{
  "dimension": "制裁名单",
  "result": "PASS",
  "details": "RobotTech LLC不在OFAC/欧盟/联合国制裁名单"
}

Relevant Implementation Snippet

python
def scan_compliance_risk(
    product: str,
    country: str,
    hs_code: str = None
) -> Dict:
    """进出口合规风险扫描"""
    
    risks = []
    total_risk_score = 0
    
    cert_risk = _evaluate_certification_risk(product, country)
    risks.append(cert_risk)
    total_risk_score += cert_risk["score"] * 0.30
    
    tariff_risk = _evaluate_tariff_risk(product, country)
    risks.append(tariff_risk)
    total_risk_score += tariff_risk["score"] * 0.25
    
    sanctions_risk = _evaluate_sanctions_risk(country)
    risks.append(sanctions_risk)
    total_risk_score += sanctions_risk["score"] * 0.25
    
    embargo_risk = _evaluate_embargo_risk(country)
    risks.append(embargo_risk)
    total_risk_score += embargo_risk["score"] * 0.20

Technical Analysis

The Skill documentation states that the system performs entity-level OFAC, European Union, and United Nations screening; HS-code tariff lookup; export-control classification; payment-risk review; API-backed analysis; and compliance-record storage.

The bundled scanner does not implement those capabilities. It:

  • Performs no network requests.
  • Does not read TRADEGPT_API_KEY.
  • Does not query OFAC, European Union, United Nations, or other authoritative lists.
  • Accepts an HS code but does not use it to determine tariffs.
  • Does not accept or screen customer names, representativ ...[truncated 2050 chars]
Remediation
View remediation

Remediation Suggestions

  1. Align the documentation with actual behavior. Clearly state that the bundled script is an offline heuristic estimator based on static sample data.

  2. Remove claims of entity-level OFAC, European Union, and United Nations screening unless those checks are implemented and verifiable.

  3. If live screening is intended:

    • Implement authenticated API calls using the declared credential.
    • Validate TLS certificates.
    • Define timeouts and safe retry limits.
    • Avoid logging bearer tokens or sensitive entity data.
    • Record the data source, query time, list version, and match confidence.
    • Require human review for fuzzy matches and ownership-rule analysis.
  4. Implement actual HS-code tariff handling or remove the --hs-code option and tariff-lookup claims.

  5. Add explicit NOT_PERFORMED, UNKNOWN, and REVIEW_REQUIRED states for checks that were not completed. Never represent an unperformed check as PASS.

  6. Separate country-risk estimation from entity sanctions screening in both the CLI and reports.

  7. Add report provenance showing:

    • Checks performed.
    • Checks omitted.
    • Data sources.
    • Data freshness.
    • Input normalization.
    • Limitations and required manual review.
  8. Reconcile package versions across _meta.json, SKILL.md, and clawhub.yaml to improve traceability and ensure users know which implementation was audited.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (15)

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.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The code is broadly related to trade compliance, so the domain matches at a high level. It evaluates country-level certifications, tariff ranges, sanctions status, embargo flags, and produces risk summaries/reports. However, several declared capabilities are materially overstated. Most notably, the description says it can screen business partners against sanctions or embargo lists, but the code has no party/entity input, no list matching, and no external data access. The scan function also accepts an HS code, and the trigger list includes HS编码, but the HS code is never used. More generally, the implementation is a heuristic advisory/risk-scoring tool over a fixed COUNTRY_DATA table, not a true verifier of specific import/export compliance requirements for particular products and countries. Therefore the description does not accurately represent the actual behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

"清关" can appear in many routine shipping or customs-clearance conversations that are not requests for a full compliance-risk assessment. The file does not provide negative examples or constraints clarifying when mention of this term should versus should not invoke the skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest lists "compliance" as a standalone trigger without narrowing it to import/export trade context. Because the term is generic and used across legal, HR, cybersecurity, and internal policy discussions, it could cause unintended activation outside this skill's intended domain.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly permits writing screening records, reports, alerts, and logs to disk while processing company names, legal representatives, and related-company data, but it does not clearly obtain informed user consent or prominently warn that submitted business and personal data may be stored locally. In a compliance-screening context, this data can be commercially sensitive and may include personal information, creating privacy, retention, and unauthorized-disclosure risk if users do not expect persistent storage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest advertises sanctions screening and business-partner checks but does not clearly disclose that user-supplied company, customer, shipment, or partner data may be transmitted to https://api.yunlvai.com. In the compliance context, that data can be commercially sensitive or regulated, so silent third-party transmission creates privacy, confidentiality, and potential legal/compliance risks.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger list is broad enough to match common discussion about customs, compliance, tariffs, or HS codes, which can cause the skill to activate in routine conversations where the user did not intend to invoke an external compliance service. In this skill’s context, accidental activation is more concerning because it may steer users into regulatory guidance workflows and potentially send business-sensitive details to a third-party API.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code file contains user-facing natural-language text such as the module docstring and command descriptions entirely in Chinese. The policy requires avoiding forced language or locale constraints unless the skill offers user choice or clearly documents and justifies the restriction, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The argparse descriptions and help messages shown to end users are all in Chinese, which imposes a specific language on all users of the tool. There is no mechanism to select another language and no documented business or regional justification for the constraint.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
70% confidence
Finding

Overly Broad Trigger: '清关' is too short and may match unintended inputs

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
70% confidence
Finding

Overly Broad Trigger: '禁运' is too short and may match unintended inputs

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

Most invocation phrases and descriptive content are fixed in Chinese, with only a minimal English term included, and there is no indication that users may choose their preferred language or locale. This can violate a language-choice policy when the skill is presented to a broader user base without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This markdown file uses Chinese as the sole language from the title onward, and nowhere indicates that users may choose another language or that the content is region-specific. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The entire template is written in Chinese and provides no indication that users may choose another language or that the template is restricted to a China-specific or Chinese-language workflow. Under the policy rule for language/locale, a forced locale without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document presents all operational guidance in Chinese and does not indicate that the user can choose another language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.