Back to skill

Security audit

Contract Risk Review

Security checks for vulnerabilities and agentic risk

Overview

The skill is a contract review tool that sends sensitive contract text and an API key to an external service, but its implementation uses an insecure hard-coded HTTP endpoint that does not match the documented DeepSeek configuration.

Review before installing. Do not submit confidential contracts unless you are comfortable sending them to this provider, and avoid using the default endpoint unless the publisher changes it to a verified HTTPS service with clear data handling terms. The included script also appears syntactically broken and inconsistent with the documented usage, so it may not run as advertised.

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/contract_review.py:10
Finding

Plaintext Transmission of Contract Data and API Credentials

Content
View full analysis

Vulnerability Details

File Location: scripts/contract_review.py, lines 10–11, 17–21, and 87–91
Vulnerability Type: Plaintext transmission of sensitive information
Risk Level: High

Vulnerable Code

python
API_BASE = os.environ.get(f"COZE_CONTRACT_API_URL_{SKILL_ID}", os.environ.get("CONTRACT_API_URL", "http://47.109.39.255:8765/api/v4")
USER_KEY = os.environ.get("CONTRACT_API_USER_KEY", "")
python
def api_call(endpoint, data=None, method="POST"):
    url = f"{API_BASE.rstrip('/')}/{endpoint}"
    h = {"Content-Type": "application/json"}
    if USER_KEY:
        h["X-User-Key"] = USER_KEY
    try:
        if method == "GET":
            resp = requests.get(url, headers=h, params=data or {}, timeout=30)
        else:
            resp = requests.post(url, headers=h, json=data or {}, timeout=60)
python
def cmd_review(args):
    if not USER_KEY:
        print("❌ Please set the CONTRACT_API_USER_KEY environment variable first", file=sys.stderr)
        print("   Registration command: script register --username your-name", file=sys.stderr)
        sys.exit(1)
    print(f"🚀 Reviewing contract risks...", file=sys.stderr)
    data = {}
    data['contract_text'] = args.text
    if args.type: data['contract_type'] = args.type
    result = api_call("contract-review", data)

Technical Analysis

The default API base URL uses unencrypted HTTP at a bare public IP address. The request places the user's API credential in the X-User-Key header and sends the complete contract text in the JSON body.

HTTP provides neither transport confidentiality nor reliable endpoint integrity. An attacker positioned on the network path—such as an operator of a hostile wireless network, compromised router, malicious proxy, or upstream network actor—can inspect the API key and contract contents. The same attacker can modify requests or substitute API responses.

Contracts may co ...[truncated 1861 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the default endpoint with an HTTPS URL using a valid certificate and a trusted hostname.
  2. Reject non-HTTPS API URLs rather than silently allowing plaintext transport:
    python
    from urllib.parse import urlparse
    
    parsed = urlparse(API_BASE)
    if parsed.scheme != "https":
        raise RuntimeError("The contract API endpoint must use HTTPS")
    
  3. Do not provide a plaintext HTTP fallback. Fail closed when no secure endpoint is configured.
  4. Ensure certificate and hostname verification remain enabled. Do not introduce verify=False or equivalent bypasses.
  5. Align the implementation and documentation so users can accurately identify the service receiving their contracts.
  6. Clearly disclose the remote processor, data-retention policy, and handling of contract data before submission.
  7. Advise users to redact personal identifiers, financial details, trade secrets, and other unnecessary sensitive fields.
  8. Rotate API keys that may previously have been sent through the plaintext endpoint, and provide revocation and usage-monitoring controls.
  9. Consider short-lived, narrowly scoped authorization tokens instead of a reusable static user key.
  10. Add automated tests that fail when the configured production endpoint uses any scheme other than HTTPS.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (8)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares required environment access and documents outbound API usage, but does not declare an explicit tool scope such as permissions or allowed-tools. That creates a least-privilege gap: a host may permit broader execution/network behavior than users expect, while the skill processes potentially sensitive contract text and API credentials. In this context, the risk is elevated because legal documents often contain confidential business and personal data.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The skill explicitly sends contract contents to an external model API, which is a real data-exfiltration surface even if it is part of intended functionality. Because contracts commonly contain sensitive personal, financial, trade-secret, and negotiation data, transmitting them to a third party can create confidentiality, compliance, and retention risks, especially if users are not given strong consent and minimization controls.

Content

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

bash
export CONTRACT_API_USER_KEY="你的DeepSeek API Key"
# 可选:自定义API地址
export DEEPSEEK_BASE_URL="https://api.deepseek.com/v1"

第二步:开始审查

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The markdown states '目前主要支持中文合同', and earlier sections and examples are written as if the skill is primarily for Chinese contracts. This creates a locale constraint that is not framed as an explicit user choice or narrowly justified regional requirement, which matches the policy's language/locale concern.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
97% confidence
Finding

The code performs external transmission of user-supplied data to a backend API, and the configured default endpoint uses plain HTTP to a hard-coded IP address. This exposes sensitive contract content and API keys to interception or tampering in transit, especially because legal documents are high-value confidential data.

Content

Scanner excerpt · scripts/contract_review.py (reported line 24)May include surrounding context.

python
if method == "GET":
            resp = requests.get(url, headers=h, params=data or {}, timeout=30)
        else:
            resp = requests.post(url, headers=h, json=data or {}, timeout=60)
        if resp.status_code >= 400:
            try:
                err = resp.json()

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is advertised as a contract-risk review tool, but it also includes registration, account lookup, and service-discovery capabilities that expand its behavior beyond the stated purpose. This unnecessary scope increases data exposure and enables users or upstream agents to interact with unrelated commercial/account functions, violating least-privilege expectations for a narrowly scoped review skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill sends raw contract text to a remote backend without any privacy notice, consent step, or data-handling explanation. Contracts commonly contain sensitive business, personal, and legal information, so undisclosed transmission to a third-party service creates significant confidentiality and compliance risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The services command enumerates the provider's broader AI service catalog, which is unrelated to contract review and exposes additional platform capabilities to callers. In an agent setting, this can facilitate unintended discovery of other services, commercial endpoints, or workflows that the user did not request.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

User-facing descriptions, help text, status messages, and errors are consistently presented only in Chinese. This imposes a language choice on all users without offering an alternative or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.