Back to skill

Security audit

Opc Chain Due Diligence

Security checks for vulnerabilities and agentic risk

Overview

This skill performs a coherent public-data company scan, but it can send an unfiltered user query to third-party APIs and overstates some diligence and data-source coverage.

Install only if you are comfortable with target company identifiers, and possibly extra text if entered, being sent to Wikidata and USPTO PatentsView. Use a clean company name or registration identifier only, avoid confidential deal/project context, and treat the output as a preliminary public-data heuristic rather than legal, investment, or compliance advice. Be aware that WIPO and OpenCorporates coverage is claimed in documentation but not implemented in the inspected code.

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
main.py:1131
Finding

Unfiltered User Input Is Disclosed to Third-Party APIs

Content
View full analysis

Vulnerability Details

File Location: main.py:93-100, main.py:378-394, and main.py:1131-1150
Vulnerability Type: Excessive disclosure of user-supplied data to external services
Risk Level: Medium

The Skill requires outbound API access for its declared due-diligence functionality. However, it treats the complete QUERY_INPUT, command-line argument string, or standard-input value as the company name. It then transmits that value to Wikidata and USPTO PatentsView without extracting or validating a minimal company identifier.

Vulnerable Code

Input acquisition and propagation:

python
input_text = os.environ.get("QUERY_INPUT", "")
if not input_text:
    input_text = " ".join(sys.argv[1:])

if not input_text:
    print("OPC Chain Due Diligence Enhanced")
    print("=" * 40)
    print("Enter the target company name:")
    input_text = sys.stdin.readline().strip()

if not input_text:
    print("Please provide a company name")
    return json.dumps({"error": "Company name is required"}, ensure_ascii=False)

company_name = input_text.strip()

scanner_a = EnterpriseInfoScanner(company_name)

Wikidata transmission:

python
params = {
    "action": "wbsearchentities",
    "search": self.company_name,
    "language": "zh",
    "format": "json",
    "limit": 5,
}
try:
    resp = requests.get(WIKIDATA_SEARCH_URL, params=params, timeout=15)

USPTO PatentsView transmission:

python
query = {
    "q": {
        "_and": [
            {"assignee_organization": {"_like": self.company_name}}
        ]
    },
    "f": [
        "patent_number", "patent_title", "patent_abstract",
        "patent_date", "patent_issue_date",
        "patent_kind", "patent_type",
        "cpc_subsection_id",
        "cited_patent_count",
        "citedby_patent_count",
        "patent_year"
    ],
    "o": {"per_page": limit, "page": 1}
}
try:
    resp = r
...[truncated 2943 chars]
Remediation
View remediation

Remediation Suggestions

  1. Use structured input. Accept a dedicated company_name or registration-code field rather than treating the complete natural-language request as an identifier.

  2. Extract the minimum necessary value. If natural-language input must be supported, parse the company identifier locally and present it to the user for confirmation before making network requests.

  3. Validate the identifier. Enforce a reasonable length limit and allow only characters expected in company names or registration codes. Reject multiline values and requests containing unrelated contextual text.

  4. Disclose external destinations. Inform the user that the extracted identifier will be sent to Wikidata and USPTO PatentsView. Obtain confirmation when input may contain confidential information.

  5. Separate sensitive context from query data. Keep due-diligence purpose, internal notes, and allegations in local variables that are never inserted into API parameters or request bodies.

  6. Minimize API fields. Request only patent fields used by the implemented analysis. Remove patent titles and abstracts unless a documented analysis step requires them.

  7. Avoid logging raw input. Log a redacted or hashed identifier where operational logging is necessary, and ensure exception messages do not reproduce full request data.

  8. Add automated tests. Verify that a request such as Review Example Corp for confidential Project Falcon transmits only Example Corp, or is rejected as ambiguous, rather than forwarding the complete sentence.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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
Findings (10)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill advertises network and environment-driven capabilities via its architecture/data-source design, but it does not declare any explicit tool scope such as allowed-tools or permissions. This creates an authorization ambiguity where a host agent may invoke broader-than-expected capabilities, increasing the risk of unintended external requests or environment access during due-diligence workflows.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad, natural-language requests like '帮我查一下' and '帮我看看…综合实力', which can overlap with ordinary conversation. That raises the chance of accidental skill invocation on sensitive subjects, causing unsolicited third-party lookups, profiling, or reputation-impacting assessments without clear user intent confirmation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file’s natural-language instructions and user-facing behavior are written entirely in Chinese and describe the skill as operating in that locale/context. There is no indication that users can opt into another language or locale, which matches the policy category for forced language/locale behavior.

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 · main.py (reported line 30)May include surrounding context.

python
WIKIDATA_SEARCH_URL = "https://www.wikidata.org/w/api.php"
WIKIDATA_ENTITY_URL = "https://www.wikidata.org/wiki/Special:EntityData/{qid}.json"
USPTO_API_URL = "https://api.patentsview.org/patents/query"
WIPO_SEARCH_URL = "https://www.wipo.int/edocs/"

# IPC大类 - 技术领域映射

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The skill transmits the user-supplied company name to an external third-party API (USPTO PatentsView). Even though the destination is expected for the feature, this is still an outbound data-flow risk because user queries may contain sensitive target names, internal project codenames, or confidential diligence subjects, and the skill does not appear to obtain explicit consent, minimize data, or disclose transmission at execution time.

Content

Scanner excerpt · main.py (reported line 393)May include surrounding context.

python
"o": {"per_page": limit, "page": 1}
        }
        try:
            resp = requests.post(USPTO_API_URL, json=query, timeout=30,
                                 headers={"Content-Type": "application/json"})
            if resp.status_code != 200:
                return []

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The module is labeled and reported as a '资金合规检查' (funding/compliance check), but it performs only heuristic inference from website presence, employee count, age, and industry keywords rather than validating actual capital, licensing, sanctions, or regulatory data. In a due-diligence/investment workflow, this can mislead users into treating speculative signals as compliance verification, creating a false sense of assurance and potentially causing unsafe business decisions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

All natural-language instructions and examples in the skill are presented in Chinese, with no statement that users may choose another language. This can amount to a language/locale policy issue when the skill effectively forces one language without explicit user opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The header claims OpenCorporates and WIPO are used as data sources, but the implementation does not query them. In a diligence tool, overstating data coverage can materially misrepresent what was checked, causing users to rely on absent verification and misunderstand the completeness of the report.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency is specified as requests>=2.28.0, which permits installation of many different future or current versions and prevents reproducible builds. In a due-diligence skill that may process external data and network requests, this increases supply-chain risk and makes it impossible to verify whether a vulnerable version is being used in development or testing.

Content

Scanner excerpt · requirements.txt (reported line 5)May include surrounding context.

text
# 运行时依赖通过 coze_workload_identity.requests 提供,无需额外安装
# 以下为开发/测试所需依赖

requests>=2.28.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
91% confidence
Finding

Because requests is not pinned, the manifest does not establish whether the environment will install a version affected by known CVEs. This is a real supply-chain hygiene issue: even if the current resolver selects a safe release, the configuration allows drift to vulnerable releases and prevents reliable security verification.

Content

No source excerpt is available for this finding.