Back to skill

Security audit

international_draft_ocr

Security checks for vulnerabilities and agentic risk

Overview

The skill openly performs bill OCR by uploading user files, but its configurable upload endpoint can send sensitive documents and the API token outside the declared Scnet destination.

Review before installing. Only use this skill if you are allowed to send the selected bill documents to Scnet, keep config/.env private, and verify SCNET_API_BASE remains exactly the intended HTTPS Scnet API base before every use. Prefer a pinned dependency install in an isolated environment.

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

Error
Location
scripts/main.py:64
Finding

Unrestricted OCR Endpoint Can Expose Sensitive Documents and API Credentials

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:96
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation
``` 2. Generate and verify cryptographic hashes for the package and its transitive dependencies. 3. Install with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Maintain a lock file so transitive dependencies are also deterministic. 5. Install dependencies in an isolated virtual environment rather than globally or with administrator privileges. 6. Use a trusted package index and review user-level pip configuration before installation. 7. Establish an update process that reviews and tests dependency upgrades before changing pinned versions. ]]>
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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
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"

# 允许使用的 ocrType 枚举值,避免任意字符串被传到服务端
ALLOWED_OCR_TYPES = {'INTERNATIONAL_BILL'}

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 176)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 42)May include surrounding context.

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

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 199)May include surrounding context.

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

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 223)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
95% confidence
Finding

The skill documentation states that file read, network upload, shell execution, and environment-variable access are required, but the file lacks an actual machine-readable tool scope such as permissions or allowed-tools. This creates a policy/permission ambiguity where a host may not be able to enforce least privilege reliably, increasing the chance of overbroad execution or silent capability expansion.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The skill explicitly uploads local financial documents to a third-party OCR API, which is an external data transmission of sensitive content. Even though the transfer is disclosed and gated by an acknowledgment flag, it still creates confidentiality, privacy, regulatory, and retention risks if users upload sensitive bills or if the third party mishandles the data.

Content

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

md
| 权限 | 范围 | 用途 |
|------|------|------|
| files | read | 读取用户提供的本地图片、PDF 或压缩包文件 |
| network | upload | 将文件上传至 Scnet OCR API(`https://api.scnet.cn/api/llm/v1/ocr/recognize`) |
| shell | execute (python3/python) | 执行 Python 脚本以调用 OCR 服务 |

**数据外传说明**:

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

The configurable SCNET_API_BASE allows the upload destination to be changed from the documented API endpoint, which can broaden the exfiltration risk beyond the intended provider if altered maliciously or accidentally. Because uploaded files may contain sensitive financial data, redirectable network destinations materially increase exposure.

Content

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

md
SCNET_API_KEY=your_scnet_api_key_here

# API 基础地址(一般无需修改)
SCNET_API_BASE=https://api.scnet.cn/api/llm/v1

# 确认已了解隐私风险并同意上传文件(设为 1 表示同意)
SCNET_OCR_UPLOAD_CONFIRMED=1

External Transmission

Medium
Category
Data Exfiltration
Confidence
84% confidence
Finding

The documentation again exposes that the upload endpoint is externally configurable and that user files are sent off-device, reinforcing the same external transmission risk. In this context, the skill handles international bill images/PDFs containing sensitive financial identifiers, making third-party transfer more consequential than generic OCR content.

Content

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

md
| 变量名 | 默认值 | 说明 |
|--------|--------|------|
| SCNET_API_KEY | 必需 | Scnet API 密钥 |
| SCNET_API_BASE | https://api.scnet.cn/api/llm/v1 | API 基础地址(一般无需修改) |
| SCNET_OCR_UPLOAD_CONFIRMED | 未设置 | 设置为 `1` 表示您已了解并同意文件将被上传至第三方 Scnet 服务 |

### 输出

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

The documentation explicitly states that local bill images/PDFs containing sensitive financial data are uploaded to a third-party cloud OCR endpoint. Even though this appears to be the intended product behavior, it creates a real data exfiltration/privacy risk because highly sensitive documents leave the local environment and are transmitted to an external service.

Content

Scanner excerpt · references/api-docs.md (reported line 6)May include surrounding context.

md
> **隐私提示**:调用本接口会将您提供的本地文件上传至 Scnet 云服务器进行处理。上传内容可能包含汇票号码、收款人、付款行、信用证号码、金额等敏感金融信息,请确保您已了解相关隐私与合规风险。

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

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

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 58)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 165)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
96% confidence
Finding

The script uploads user-supplied bill images/PDFs to a third-party OCR endpoint at api.scnet.cn. Although it includes a consent gate and transparency notice, this is still a real data exfiltration path for potentially sensitive financial documents if users misconfigure consent or do not fully understand the privacy implications.

Content

Scanner excerpt · scripts/main.py (reported line 91)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

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest’s user-facing description, permission reasons, risk disclosures, and consent instructions are entirely in Chinese, with no indication that users may 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, which this file does not do.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

This skill explicitly uploads local financial document images/PDFs to a third-party OCR endpoint, which creates a real data exfiltration path for sensitive banking and payment information. Even though the transmission is declared and gated by consent, the exposed data includes bill details, parties, amounts, and bank information, so compromise, misconfiguration, or uninformed consent could lead to significant confidentiality loss.

Content

Scanner excerpt · skill.yaml (reported line 30)May include surrounding context.

yaml
- scope: network
    access: upload
    endpoints:
      - https://api.scnet.cn/api/llm/v1/ocr/recognize
    reason: 将用户文件上传至第三方 Scnet OCR API 进行识别
  - scope: shell
    access: execute

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

The data_handling section confirms that sensitive financial files leave the local environment and may be transmitted to Scnet cloud services, potentially across borders. In the context of international drafts and OCR of financial instruments, this materially increases risk because the files can contain regulated or highly sensitive financial data whose exposure could enable fraud, privacy violations, or compliance issues.

Content

Scanner excerpt · skill.yaml (reported line 43)May include surrounding context.

yaml
leaves_local_environment: true
  external_services:
    - name: Scnet OCR API
      url: https://api.scnet.cn/api/llm/v1/ocr/recognize
      purpose: 上传用户文件并获取 OCR 识别结果
      data_types:
        - 票据图像

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents its user-facing natural-language content entirely in Chinese, including the title and change descriptions, with no indication that the user opted into that language or that the skill is limited to a Chinese-language context. Under the language/locale policy rule, forcing a single language without opt-in can be a policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file contains user-facing natural-language instructions entirely in Chinese, including the description and operational guidance. Under the language/locale policy rule, forcing a specific language without giving the user a choice or documenting a justified locale restriction is a policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file presents all user-facing instructional content exclusively in Chinese, with no indication that the user can choose another language or that the skill is limited to a Chinese-language audience. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.