Back to skill

Security audit

Payment Voucher Ocr

Security checks for vulnerabilities and agentic risk

Overview

This OCR skill is coherent, but it sends sensitive payment voucher files and an API token to a configurable external endpoint without strong endpoint limits or clear per-use consent.

Review before installing. Use only with payment documents you are allowed to send to Scnet, verify config/.env has the intended HTTPS Scnet endpoint, protect and rotate the API key as needed, and avoid automatic invocation on sensitive files unless the user explicitly approves the upload.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/main.py:86
Finding

Unrestricted OCR Endpoint Can Receive Sensitive Documents and API Credentials

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:66
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation
``` 2. For stronger integrity protection, include package hashes and install with: ```bash python -m pip install --require-hashes -r requirements.txt ``` 3. Pin and hash all transitive dependencies, preferably through a generated lock file. 4. Document installation inside a dedicated virtual environment rather than a system-wide Python environment. 5. Use `python -m pip` to ensure installation targets the intended interpreter. 6. Specify the trusted package index where operationally appropriate, and avoid unverified mirrors. 7. Add automated dependency vulnerability scanning and a controlled update process. 8. Review and regenerate dependency hashes whenever versions are intentionally updated. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (20)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/main.py (reported line 20)May include surrounding context.

python
# 获取技能根目录(脚本所在目录的上一级)
SKILL_ROOT = Path(__file__).parent.parent.absolute()
ENV_FILE = SKILL_ROOT / "config" / ".env"

# --- 新增:重试配置 ---
MAX_RETRIES = 3            # 最大重试次数

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
# --------------------

def load_config():
    """从 .env 文件加载配置,若文件不存在则抛出友好错误"""
    if not ENV_FILE.exists():
        error_msg = (
            "\n===============================================\n"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
# --------------------

def load_config():
    """从 .env 文件加载配置,若文件不存在则抛出友好错误"""
    if not ENV_FILE.exists():
        error_msg = (
            "\n===============================================\n"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/main.py (reported line 29)May include surrounding context.

python
# --------------------

def load_config():
    """从 .env 文件加载配置,若文件不存在则抛出友好错误"""
    if not ENV_FILE.exists():
        error_msg = (
            "\n===============================================\n"

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
* [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/)
* [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
* [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
* [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
* [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill documentation indicates capabilities to read local files, invoke Python from the shell, and send file contents to an external OCR API, but it does not declare any explicit tool scope or permission boundaries. This creates an authorization gap where an agent may invoke the skill with broader-than-necessary file and execution access, increasing the chance of unintended file exposure or misuse.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The skill is explicitly configured to transmit document images and extracted text to an external Scnet API endpoint. In the context of payment vouchers, this may involve sensitive financial or personal information, so external transmission materially increases confidentiality and compliance risk if users are not clearly warned and consent is not obtained.

Content

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

SCNET_API_KEY=your_scnet_api_key_here

API 基础地址(一般无需修改)

SCNET_API_BASE=https://api.scnet.cn/api/llm/v1

text
2. 添加:`SCNET_API_KEY=你的密钥`
3. 设置文件权限为 600(仅所有者可读写)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger guidance says the AI may auto-trigger this skill based on broad descriptive keywords, without strong constraints on when invocation is appropriate or what user consent is required for uploading a local file. Because the skill reads a local path and sends data to a third-party API, ambiguous triggering can cause unintended execution and external transmission of sensitive documents.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

The configuration section reiterates use of an external API endpoint, confirming that operation depends on sending locally sourced voucher content outside the host environment. Because the skill processes payment vouchers, the context makes this more sensitive than generic OCR due to likely exposure of names, amounts, signatures, and purpose fields.

Content

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

md
| 变量名 | 默认值 | 说明 |
|--------|--------|------|
| SCNET_API_KEY | 必需 | Scnet API 密钥 |
| SCNET_API_BASE | https://api.scnet.cn/api/llm/v1 | API 基础地址(一般无需修改) |

### 输出

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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 · references/api-docs.md (reported line 4)May include surrounding context.

md
# Sugon-Scnet OCR API 文档摘要

## 接口地址
`POST https://api.scnet.cn/api/llm/v1/ocr/recognize`

## 请求头
- `Content-Type: multipart/form-data`

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation includes OCR output containing highly sensitive personal data such as name, address, birth date, gender, and ID number, but provides no privacy, minimization, retention, or lawful-processing guidance. In a payment voucher OCR skill, this increases the risk that integrators will transmit regulated personal information to a third-party OCR service without appropriate user consent or data-handling safeguards.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation states that uploaded compressed archives are automatically decompressed and recognized, but does not warn about privacy, file-handling, or upload-scope risks. This can lead users to submit bulk document sets containing many sensitive records, increasing accidental over-collection and third-party exposure of personal or financial data.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/main.py (reported line 45)May include surrounding context.

python
"   b) 配置文件:\n"
            f"      mkdir -p {SKILL_ROOT}/config\n"
            f"      echo 'SCNET_API_KEY=你的密钥' > {ENV_FILE}\n"
            f"      chmod 600 {ENV_FILE}\n"
            "\n配置完成后重新运行。"
        )
        sys.exit(error_msg)

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/main.py (reported line 152)May include surrounding context.

python
"   b) 配置文件:\n"
            f"      mkdir -p {SKILL_ROOT}/config\n"
            f"      echo 'SCNET_API_KEY=你的密钥' > {ENV_FILE}\n"
            f"      chmod 600 {ENV_FILE}\n"
            "\n配置完成后重新运行。"
        )
        sys.exit(error_msg)

External Transmission

Medium
Category
Data Exfiltration
Confidence
97% confidence
Finding

The script sends user-supplied document files to an external OCR service at api.scnet.cn. Because this skill processes payment vouchers, the transmitted data likely contains sensitive financial and personal information, creating confidentiality and compliance risk if users are unaware or if the endpoint is not explicitly approved for such data.

Content

Scanner excerpt · scripts/main.py (reported line 78)May include surrounding context.

python
)
        sys.exit(error_msg)

    config.setdefault('SCNET_API_BASE', 'https://api.scnet.cn/api/llm/v1')
    return config

def recognize_with_retry(ocr_type, file_path, config, retry_count=0):

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file contains user-facing natural language entirely in Chinese, including the title and change description. Under the stated policy, forcing a specific language without offering user choice or documenting a justified locale constraint can be a language/locale policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This markdown file is a generic template README and does not describe the skill's actual behavior, limitations, or any warnings about actions that could affect user data, privacy, or system integrity. Because it includes operational sections such as adding files, CI/CD, and deployment without any skill-specific disclosure, users are not warned about what the skill may do.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language description and usage guidance are entirely in Chinese and do not indicate that the user may choose another language. Per policy, forcing a specific language without opt-in can be a locale/language policy issue unless the regional constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The document is written entirely in Chinese and does not indicate that users may choose another language or locale. Under the policy rule for natural-language violations, this can be treated as a language constraint without explicit opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The manifest description is written only in Chinese and provides no indication that users can choose another language or that the skill is intentionally limited to a Chinese-speaking context. Under the policy, language or locale constraints should be opt-in or explicitly justified.

Content

No source excerpt is available for this finding.