Back to skill

Security audit

中国地区30+常用发票抽取与发票查验(ADP)

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with cloud receipt extraction, but its install instructions execute unverified remote code and it handles sensitive invoice data, so it should be reviewed before use.

Install only after reviewing the ADP CLI source or using a pinned, verified release; avoid the curl|bash and irm|iex commands. Use a least-privilege API key, limit the files or folders an agent may process, and confirm that sending invoices or receipts to Laiye ADP and any tax-verification service meets your privacy, business, and compliance requirements.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:98
Finding

Execution of an Unpinned Mutable Remote Shell Script

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:98, README.md:30, and README-CN.md:29
Vulnerability Type: Remote payload retrieval and immediate shell execution
Risk Level: Critical

Complete Code Snippet:

bash
# Method 2 / Method 2 equivalent: Shell script installation
curl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash

Technical Analysis

The installation command retrieves a shell script from the mutable main branch of an external GitHub repository and pipes the response directly into bash. The downloaded payload is not included in the audited project, pinned to an immutable commit, verified against a cryptographic checksum, or authenticated with a release signature.

Consequently, the effective code executed by this Skill can change after the Skill itself has been reviewed. The GitHub namespace appears consistent with the declared vendor, but the identity, current security posture, and future contents of the external repository cannot be established from this project alone.

Piping network output directly into a shell also removes the normal inspection boundary between download and execution. Any code returned by the URL receives the same operating-system privileges as the user or agent running the command. This execution capability exceeds the minimum privilege necessary to document or install the invoice-recognition client because a pinned, verified package or binary could provide the declared functionality without immediately trusting mutable remote content.

Attack Path

  1. An attacker compromises the external repository, its maintainer account, a publishing workflow, or another mechanism capable of modifying scripts/adp-init.sh on the main branch.
  2. The attacker inserts arbitrary shell commands into the remotely hosted installation script.
  3. A user or AI agent follows the installation instructions in SKILL.md, README.md, or `REA ...[truncated 1024 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove the direct curl | bash installation pipeline from all affected documentation.
  2. Publish versioned installation scripts or release artifacts and reference an immutable release tag or commit rather than main.
  3. Download the artifact to a local file before execution:
    bash
    curl -fL -o adp-init.sh https://example.invalid/releases/vX.Y.Z/adp-init.sh
    
  4. Publish a SHA-256 or stronger checksum through a separately protected release channel and verify it before execution:
    bash
    echo "EXPECTED_SHA256  adp-init.sh" | sha256sum --check -
    
  5. Prefer cryptographic release signatures with documented key-verification procedures.
  6. Allow the user to inspect the downloaded script and require explicit confirmation before running it:
    bash
    less adp-init.sh
    bash adp-init.sh
    
  7. Do not recommend running the installer as root or through sudo unless a specific operation demonstrably requires elevation.
  8. Pin the installer and resulting CLI version, and document all files, network endpoints, and permissions used by the installation process.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:93
Finding

Unpinned Global npm Package Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:93, README.md:25, and README-CN.md:24
Vulnerability Type: Unpinned third-party dependency installed globally
Risk Level: Medium

Complete Code Snippet:

bash
npm install -g @laiye-adp/agentic-doc-parse-and-extract-cli

Technical Analysis

The recommended npm command installs the latest available version of a third-party package globally without specifying an audited version or validating package integrity. npm packages may execute lifecycle scripts during installation, so package installation can run publisher-controlled code rather than merely copy inert files.

Because no version is pinned, the effective dependency can change independently of this reviewed project. A compromised publisher account, package registry incident, or malicious future package release could therefore introduce executable behavior not represented in the audited Skill.

Global installation also places the adp executable in a shared command location and affects subsequent sessions. This is broader than necessary for a project-specific client invocation; a local, pinned dependency would reduce both filesystem scope and exposure to future package changes.

Attack Path

  1. An attacker compromises the npm publisher account, package release pipeline, or package contents.
  2. The attacker publishes a malicious release under the legitimate package name.
  3. A user or agent runs the documented command without a version constraint.
  4. npm resolves the package to the attacker-controlled latest release.
  5. Malicious package code or lifecycle scripts execute during installation with the invoking user's privileges.
  6. The installed global adp command may continue executing attacker-controlled behavior during later document-processing operations.

Impact Assessment

Exploitation can provide arbitrary code execution with the permissions of the account running npm. The compr ...[truncated 582 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin the dependency to a specifically reviewed version:
    bash
    npm install --save-exact @laiye-adp/agentic-doc-parse-and-extract-cli@X.Y.Z
    
  2. Prefer a project-local installation over -g, then invoke the pinned binary through an approved project script or npx --no-install.
  3. Commit and enforce an npm lockfile containing registry integrity metadata.
  4. Verify package provenance, publisher identity, release signatures, and integrity before approving version updates.
  5. Where compatible with the package, disable lifecycle scripts during installation:
    bash
    npm install --ignore-scripts --save-exact @laiye-adp/agentic-doc-parse-and-extract-cli@X.Y.Z
    
  6. If lifecycle scripts are required, review those scripts for every approved release before installation.
  7. Avoid installation through privileged accounts and document the exact filesystem and network permissions required by the CLI.
  8. Use controlled dependency-update reviews rather than automatically resolving the latest package release.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (25)

Chaining Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

The use of a pipe into bash creates a one-step code-execution chain with no opportunity for inspection or integrity validation. This chaining pattern magnifies risk because any compromise in the fetched content immediately becomes shell execution, and the mismatch between the skill's narrow stated purpose and this system-level install behavior makes it more suspicious and dangerous.

Content

Scanner excerpt · README-CN.md (reported line 29)May include surrounding context.

bash
# 方法 2: Shell 脚本(Linux / macOS,无 npm 环境时使用)
curl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash
bash

Chaining Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

Piping curl output directly into bash is an unsafe command-chaining pattern that executes network-retrieved content immediately without inspection or integrity verification. If the source, transport, repository, or account is compromised, this can lead to arbitrary code execution on the user's system, making the issue more dangerous than a generic install command.

Content

Scanner excerpt · README.md (reported line 30)May include surrounding context.

bash
# Method 2: Shell script (Linux / macOS, when npm is not available)
curl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash
bash

Chaining Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

The | bash pattern is a classic command-chaining risk because it causes unreviewed network content to execute immediately in a shell. In this skill's context, the command is presented as normal setup guidance, making unsafe execution more likely for users who trust the documentation.

Content

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

bash
# 方法 2: Shell 脚本(Linux / macOS,无 npm 环境时使用)
curl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash
bash

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README describes a general-purpose ADP document processing CLI with parsing, extraction, task orchestration, and broad document support, which materially exceeds the stated scope of a receipt-recognition skill. Capability/scope mismatch is dangerous because agents or users may grant the skill broader trust and permissions than intended, enabling unexpected handling of arbitrary documents and workflows.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation includes custom document extraction application creation and management, which goes beyond simple receipt recognition/extraction. This increases the attack surface because it suggests the skill can alter or manage processing logic and applications, not merely consume a fixed receipt parser, creating opportunities for misuse and privilege overreach.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The installation section tells users to execute remote shell and PowerShell scripts directly from the network without verification, pinning, checksum validation, or a risk warning. This is dangerous because compromise of the remote source, repository, transport, or referenced script would lead to immediate arbitrary code execution on the user's machine.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Application management commands such as creating, updating, deleting, and AI-generating custom extraction apps are not justified by a receipt-recognition-only use case. In skill ecosystems, undocumented or excessive management capabilities can let an agent move from data extraction into configuration mutation, which is more dangerous than the advertised function.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The README presents the skill as a general-purpose document processing CLI with broad parsing, extraction, and workflow capabilities, which materially exceeds the manifest's stated receipt-recognition scope. This capability mismatch is dangerous because agents or users may invoke unintended high-privilege features, expanding data exposure and operational scope beyond what the skill advertises.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Application-management and custom-app lifecycle features go beyond passive receipt extraction and enable modification of extraction configurations and business workflows. In an agent setting, this increases the attack surface by allowing actions that change state, create persistence, or alter downstream processing behavior without being justified by the skill's narrow stated purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README instructs users to configure an API key and use a public cloud endpoint but does not clearly warn that uploaded documents are sent to a remote service and that credentials are stored locally under ~/.adp/. For a financial receipt skill, this omission is especially sensitive because receipts and invoices often contain personal, financial, and tax data, so users may unknowingly transmit regulated information off-host.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Custom app creation, update, and deletion are administrative capabilities unrelated to simple receipt recognition and enable persistent changes to remote service behavior. This is risky because an agent granted this skill could create or modify extraction apps, causing unauthorized configuration drift, data-routing changes, or misuse of the associated cloud account.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill directs users to send receipts, invoices, and Base64/local documents to a third-party ADP service, but it does not clearly warn up front that potentially sensitive financial and personal data will leave the local environment. Because these documents may contain names, tax IDs, invoice numbers, travel details, and other confidential business information, users could disclose regulated or sensitive data without informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The installation section recommends executing remote shell and PowerShell scripts directly from the network via pipe-to-shell (curl ... | bash, irm ... | iex) without integrity verification or a safety warning. This is dangerous because any compromise of the remote source, repository, DNS, TLS trust chain, or script update process could lead to immediate arbitrary code execution on the user's machine.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document advertises extraction of extensive personally identifiable, financial, travel, and tax data across many receipt and invoice types, but provides no privacy notice, handling constraints, retention guidance, or consent expectations. In a financial OCR skill, this omission increases the risk that users process sensitive documents without understanding compliance, minimization, or downstream exposure obligations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The text states that 11 invoice types support automatic tax-authority verification, but does not warn that invoice contents may be transmitted to external government or third-party verification services. That missing disclosure can cause unintentional external sharing of sensitive invoice and identity data, especially in enterprise reimbursement and bookkeeping workflows where users may assume all processing is local or internal.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This JSON sample uses Chinese-only natural-language field names and status values throughout, such as the invoice title, field labels, and verification results. There is no indication that the skill offers a language choice or documents a justified region-specific locale constraint, which can violate organizational language/locale policy for general-purpose skills.

Content

No source excerpt is available for this finding.

External Script Fetching

Low
Category
Supply Chain
Confidence
99% confidence
Finding

The command fetches a shell script from a remote URL and executes it as part of installation. In the context of an agent skill, encouraging external script fetching is especially risky because users may treat the documentation as trusted automation guidance and run attacker-controlled or later-compromised code.

Content

Scanner excerpt · README-CN.md (reported line 29)May include surrounding context.

bash
# 方法 2: Shell 脚本(Linux / macOS,无 npm 环境时使用)
curl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash
bash

External Script Fetching

Low
Category
Supply Chain
Confidence
90% confidence
Finding

The README recommends installing via a remotely fetched shell script from GitHub, which introduces supply-chain risk because the script content can change after publication or be compromised upstream. Users are encouraged to execute unreviewed code directly on their machine, which is especially risky in enterprise finance environments where this skill is likely to be used.

Content

Scanner excerpt · README.md (reported line 30)May include surrounding context.

bash
# Method 2: Shell script (Linux / macOS, when npm is not available)
curl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash
bash

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language instructions, headings, and operational guidance are all presented in Chinese, effectively forcing a specific language for users of the skill. The file does not offer an alternate language, user opt-in, or an explicit statement that the language restriction is intentional and limited to a China-specific audience.

Content

No source excerpt is available for this finding.

External Script Fetching

Low
Category
Supply Chain
Confidence
99% confidence
Finding

The skill explicitly fetches and executes a remote script from GitHub in one command. This introduces a direct trust dependency on mutable remote content and can result in arbitrary code execution if the script source is altered or intercepted.

Content

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

bash
# 方法 2: Shell 脚本(Linux / macOS,无 npm 环境时使用)
curl -fsSL https://raw.githubusercontent.com/laiye-ai/adp-cli/main/scripts/adp-init.sh | bash
bash

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · license.md (reported line 10)May include surrounding context.

md
1. Licensing

1.1 Free Use and Distribution: The Licensor grants the Licensee a non-transferable, non-exclusive right to freely use, copy, publish, and distribute copies of the Product for non-commercial purposes. The aforementioned "non-commercial purposes" include, but are not limited to:
Personal learning, research, teaching, and evaluation.
Technical exchanges within academic institutions or open-source communities, non-profit projects.
Integration or demonstration in non-commercial products or services.

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · license.md (reported line 14)May include surrounding context.

md
1. Licensing

1.1 Free Use and Distribution: The Licensor grants the Licensee a non-transferable, non-exclusive right to freely use, copy, publish, and distribute copies of the Product for non-commercial purposes. The aforementioned "non-commercial purposes" include, but are not limited to:
Personal learning, research, teaching, and evaluation.
Technical exchanges within academic institutions or open-source communities, non-profit projects.
Integration or demonstration in non-commercial products or services.

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · license.md (reported line 22)May include surrounding context.

md
1. Licensing

1.1 Free Use and Distribution: The Licensor grants the Licensee a non-transferable, non-exclusive right to freely use, copy, publish, and distribute copies of the Product for non-commercial purposes. The aforementioned "non-commercial purposes" include, but are not limited to:
Personal learning, research, teaching, and evaluation.
Technical exchanges within academic institutions or open-source communities, non-profit projects.
Integration or demonstration in non-commercial products or services.

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · license.md (reported line 32)May include surrounding context.

md
4. Disclaimer of Warranties

THE PRODUCT IS PROVIDED "AS IS", WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO: THE LICENSOR DOES NOT WARRANT THAT THE PRODUCT IS FREE FROM ERRORS, BUGS, WILL OPERATE PROPERLY, OR IS SUITABLE FOR A PARTICULAR PURPOSE; THE LICENSOR DOES NOT WARRANT THAT USE OF THE PRODUCT WILL NOT INFRINGE UPON THIRD-PARTY RIGHTS; THE LICENSOR SHALL NOT BE LIABLE TO THE LICENSEE OR ANY THIRD PARTY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, OR PUNITIVE DAMAGES ARISING FROM THE USE OF THE PRODUCT.

5. Termination

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This markdown file contains natural-language policy text fixing disputes to the laws of the People's Republic of China and the Licensor's local court. Under the stated rule, forcing a specific locale without user choice can be a policy concern when not clearly framed as an opt-in or region-specific requirement.

Content

No source excerpt is available for this finding.