Back to skill

Security audit

Document Parse Ocr

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a real Scnet OCR client, but its handling of external document processing, API credentials, and unvalidated network destinations needs user review before installation.

Install only if you are comfortable sending document URLs and their contents to Scnet for OCR. Do not use it for confidential, regulated, internal-only, or signed-URL documents unless external processing is approved. Keep the API base pointed at the official HTTPS Scnet endpoint, protect the `config/.env` token file, and consider pinning dependencies before use.

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:79
Finding

Unvalidated outbound destinations can expose credentials and access internal resources

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:67
Finding

Unpinned third-party dependency installation creates supply-chain risk

Content
View full analysis
Remediation
View remediation
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 (26)

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 64)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 130)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 31)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 117)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
92% confidence
Finding

The skill documentation describes capabilities that involve local file access (.env/config), network access to an external API, and shell/Python execution, but it does not declare an explicit tool scope such as allowed-tools or permissions. This increases the chance that an agent invokes the skill with broader privileges than necessary, violating least-privilege and making misuse or prompt-triggered overreach more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill clearly submits document URLs to a third-party OCR provider and returns externally generated results, but the documentation does not prominently warn users that document contents and metadata will leave the local environment. This can lead to inadvertent disclosure of confidential files, internal URLs, or regulated content to an external service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
89% confidence
Finding

This skill is designed to transmit user-supplied document URLs and related processing requests to an external endpoint at api.scnet.cn. In context, external transmission is expected functionality, but it is still security-relevant because documents may contain sensitive data and the skill encourages use of publicly accessible URLs, expanding the exposure surface.

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=你的密钥

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation guidance says the AI will automatically trigger the skill based on description keywords, but it does not clearly constrain when invocation is appropriate or require confirmation before sending data externally. Ambiguous triggering can cause accidental processing of user-provided links or sensitive documents and unintended transmission to the third-party OCR service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file is natural-language documentation and begins with a Chinese-only title and continues entirely in Chinese. Under the policy, forcing a specific language without user opt-in or a documented regional justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The skill sends documents and related metadata to an external OCR API endpoint, which is a genuine external data transmission path. In this context, the danger is elevated because the service processes full document contents, including potentially sensitive text, tables, seals, and other structured data, yet the documentation does not include security boundaries or user consent/privacy warnings.

Content

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

md
Scnet OCR 文档智能服务支持异步提交文档识别任务,适用于大批量文档处理。识别结果包含丰富的版面分析信息(文本、表格、图表、公式、页眉页脚、脚注、印章等)以及 Markdown 格式的全文。

## 接口地址
- **提交任务**: `POST https://api.scnet.cn/api/llm/v1/ocrdoc/submit`
- **查询结果**: `POST https://api.scnet.cn/api/llm/v1/ocrdoc/result`

## 请求头

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The result-query endpoint is also part of the same third-party OCR workflow and returns downloadable result URLs, extending the external data flow beyond submission to retrieval of extracted document content. This increases exposure because recognized text and structure are made available through externally hosted result files with limited but real access windows.

Content

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

md
## 接口地址
- **提交任务**: `POST https://api.scnet.cn/api/llm/v1/ocrdoc/submit`
- **查询结果**: `POST https://api.scnet.cn/api/llm/v1/ocrdoc/result`

## 请求头
- `Content-Type: application/json`

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation instructs users to submit publicly accessible document URLs to a third-party OCR service, but it does not warn that this exposes document contents and metadata to an external provider and requires the source file to be retrievable over the public internet. In a document-parsing skill, this is a real data-handling risk because users may send sensitive files without understanding the privacy, retention, or access implications.

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 47)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
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 · SKILL.md (reported line 112)May include surrounding context.

md
)
        sys.exit(error_msg)

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

def submit_task(api_base, api_key, file_url, ocr_type, retry_count=0):

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

python
)
        sys.exit(error_msg)

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

def submit_task(api_base, api_key, file_url, ocr_type, retry_count=0):

External Transmission

Medium
Category
Data Exfiltration
Confidence
92% confidence
Finding

The code performs an outbound POST request containing the user-provided file URL and OCR parameters to an external API. Because documents may be sensitive and the skill is specifically designed to process arbitrary public URLs, this creates a real data-exposure boundary and should be treated as a security-relevant transmission.

Content

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

python
payload['ocr_type'] = ocr_type

    try:
        response = requests.post(url, headers=headers, json=payload, timeout=30)
    except Exception as e:
        sys.exit(f"网络请求失败: {str(e)}")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill sends a user-supplied document URL to a third-party OCR provider, which causes user data to leave the local environment and be processed externally. In this skill's context, external processing is the core feature, but the code does not present an explicit privacy/disclosure warning or require affirmative consent before transmitting potentially sensitive documents.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% 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 · scripts/main.py (reported line 154)May include surrounding context.

python
'task_ids': [task_id]
    }
    try:
        response = requests.post(url, headers=headers, json=payload, timeout=30)
    except Exception as e:
        sys.exit(f"查询网络请求失败: {str(e)}")

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest description uses Chinese exclusively and does not indicate that the skill is region-specific or that users can opt into a preferred language. Under the stated policy, forcing a specific language without user choice is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file uses Chinese for its heading and entry text, but it does not indicate that the skill is Chinese-language only or offer any language/locale choice. Under the policy criteria, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file includes actionable commands to add a remote, rename the branch, and push to origin, which can affect repository state and publish local content. The README provides no warning or disclosure about these side effects, and the file otherwise appears to be a generic template rather than a purpose-specific guide that would make the risk obvious.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The skill documentation is entirely in Chinese and provides only Chinese interaction examples, with no indication that users may choose another language. This can constitute a language/locale policy issue when a skill appears to prescribe a single language 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
84% confidence
Finding

All user-facing documentation is presented in Chinese, which can impose a language constraint without user opt-in. There is no note indicating that the skill or documentation is intentionally limited to a Chinese-speaking or region-specific audience.

Content

No source excerpt is available for this finding.