Back to skill

Security audit

Degree Certificate Ocr

Security checks for vulnerabilities and agentic risk

Overview

The skill does degree-certificate OCR as advertised, but it uploads sensitive documents with an API key to a configurable remote endpoint without strong scoping or privacy guidance.

Install only if you are comfortable sending degree-certificate files to Scnet or the configured API base. Keep SCNET_API_BASE at the documented HTTPS Scnet endpoint unless you intentionally trust another server, protect config/.env, and avoid uploading certificates containing personal data without consent.

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

Unrestricted OCR API Base Can Expose Credentials and Sensitive Documents

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. Generate and verify cryptographic hashes, for example through a hash-locked requirements file: ```bash pip install --require-hashes -r requirements.txt ``` 3. Use a trusted package index explicitly and avoid untrusted mirrors: ```bash python -m pip install --index-url https://pypi.org/simple --require-hashes -r requirements.txt ``` 4. Install dependencies in an isolated virtual environment rather than a global or privileged Python environment. 5. Regularly review and update the pinned version to incorporate security fixes, then regenerate and verify the lock-file hashes. 6. Document the supported Python version and test the exact locked dependency set in continuous integration. ]]>
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (19)

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
93% confidence
Finding

The skill clearly requires reading a local file path, invoking Python/shell, and sending data to a remote OCR API, but the manifest does not declare any explicit tool scope or permissions. This creates an authorization and transparency gap: an agent may invoke broader capabilities than a user expects, especially because local documents are being transmitted off-host.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description is entirely in Chinese and presents the skill as operating in Chinese without any indication that users may choose another language or that the Chinese-only scope is required for a region-specific compliance reason. Under the policy, language or locale constraints should either be optional for the user or clearly justified.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The skill is designed to send user-provided certificate images and extracted OCR content to an external API endpoint. Because degree certificates contain sensitive personal data, this external transmission creates a real privacy and data-handling risk unless it is explicitly disclosed and consented to.

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(仅所有者可读写)

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The configuration section reinforces that all OCR requests are sent to a remote base URL, meaning sensitive document images and extracted text leave the local environment. In the context of academic certificates, this is material because the data commonly includes names, institutions, degree details, and dates.

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
89% confidence
Finding

The skill sends uploaded OCR documents to an external endpoint, which is a real data-exposure risk because degree certificates and related identity records are sensitive personal information. The skill context makes this more dangerous: the feature's core purpose is processing official documents, so external transmission can expose names, issuing institutions, dates, and potentially other embedded PII to a third-party service.

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
94% confidence
Finding

The documentation instructs users to upload highly sensitive identity and certificate images, but it does not warn about privacy, data handling, retention, third-party processing, or compliance requirements. In this skill context, the omission is more dangerous because degree certificates and OCR outputs contain personal data that may be transmitted to an external service without informed consent or proper safeguards.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file contains natural-language descriptions and runtime messages entirely in Chinese, including the module docstring and CLI usage/help text. Under the stated policy, forcing a specific language without user opt-in is a locale/language policy violation unless the constraint is explicitly documented and justified, which is not present here.

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
92% confidence
Finding

This skill uploads user-supplied certificate files to an external OCR service at api.scnet.cn, which constitutes transmission of potentially sensitive personal data off-host. In the context of degree certificates, the uploaded content can include PII such as names, institutions, degree types, and dates, so external transfer materially increases privacy and compliance risk even if the destination is the intended OCR provider.

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

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest description is written entirely in Chinese and provides no indication that the skill supports other languages or that the Chinese-only locale is an intentional, justified constraint. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The changelog is entirely written in Chinese, beginning with the heading '变更日志' and the entry '新增学位证书识别'. This indicates a language-specific presentation without any visible user choice, opt-in, or documented regional justification, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The manifest description and main body consistently describe a skill for 学位证书识别 only, but the declared tags include broader categories such as '发票识别' and generic '文字提取'. This creates a semantic mismatch in how the skill is presented, suggesting capabilities beyond the narrowly described degree-certificate OCR purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The file content, headings, parameter descriptions, and notes are all presented in Chinese, which effectively forces a specific language for users of this skill documentation. There is no indication that this is a region-specific or Chinese-only skill, nor any user opt-in or alternate language option.

Content

No source excerpt is available for this finding.