Back to skill

Security audit

工业化数据处理

Security checks for vulnerabilities and agentic risk

Overview

The skill performs its stated IQC conversion and submission workflow, but it embeds reusable credentials and sends/stores tokens and business data insecurely.

Review carefully before installing. Only use this in a controlled internal environment after rotating the exposed password, replacing hardcoded credentials with managed secrets, enforcing HTTPS, confirming the destination API is intended, restricting token file permissions, and deciding how long logs and run outputs should be retained.

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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/jwt_token.py:32
Finding

Hardcoded Reusable API Credentials

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/jwt_token.py:116
Finding

Credentials, Bearer Tokens, and IQC Records Transmitted over Plaintext HTTP

Content
View full analysis
str: url = f"{API_BASE_URL.rstrip('/')}{LOGIN_PATH}" payload = { "user_account": USERNAME, "user_password": PASSWORD, "message": LOGIN_MESSAGE, } headers = {"Content-Type": "application/json; charset=utf-8"} logging.info(f"请求登录接口: {url}") resp = requests.post(url, json=payload, headers=headers, timeout=timeout) ``` Authenticated data submission: ```python API_BASE_URL = "http://192.168.60.241:1120" url = f"{api_base_url.rstrip('/')}{API_SUBMIT_PATH}" headers = { "Authorization": f"Bearer {token}", "Content-Type": "application/json; charset=utf-8", } logging.info(f"发送 {len(parts)} 条记录 → {url}") try: resp = requests.post(url, json=parts, headers=headers, timeout=timeout) ``` ### Technical Analysis Both authentication and data submission use a hardcoded `http://` endpoint rather than HTTPS. Consequently, the following information is transmitted without transport encryption: - The API username and password. - The persistent client-identifying message. - The returned or subsequently used JWT bearer token. - Generated product-part and industrial IQC records. A private RFC1918 address does not provide confidentiality or server authenticity. Any attacker with network-path visibility may inspect or modify plaintext traffic. Bearer tokens are particularly sensitive because possession is normally sufficient for replay until expiration or revocation. The code also does not enforce an HTTPS-only policy because the destination is directly configured with the HTTP scheme. ### Attack Path 1. The attacker obtains a position on t ...[truncated 1105 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/jwt_token.py:160
Finding

JWT Bearer Tokens Stored in Plaintext Files Without Explicit Access Restrictions

Content
View full analysis
None: token_file.write_text(token, encoding="utf-8") logging.info(f"Token 已写入: {token_file}") def get_daily_cache_file() -> Path: date_str = datetime.now().strftime("%Y%m%d") return TOKEN_CACHE_DIR / f"jwt_token_{date_str}.txt" def load_daily_cached_token() -> str | None: cache_file = get_daily_cache_file() if not cache_file.exists(): return None token = cache_file.read_text(encoding="utf-8").strip() if not token: return None logging.info(f"复用当天缓存 Token: {cache_file}") return token def save_daily_cache_token(token: str) -> None: cache_file = get_daily_cache_file() cache_file.write_text(token, encoding="utf-8") logging.info(f"当天缓存 Token 已更新: {cache_file}") ``` ### Technical Analysis The same bearer token is persisted in two ordinary plaintext locations: - The per-run `output/jwt_token.txt` file. - A date-based file under `token_cache`. `Path.write_text()` creates or truncates files according to the process umask and does not explicitly enforce owner-only permissions. On a shared system, permissive directory permissions or umask settings may expose the token to other local users and processes. Backups, artifact collection, or accidental packaging of run output can also retain the token. The daily cache is reused solely according to its filename and presence. The code does not inspect token expiry before reuse. In addition, the `expire_minutes` workflow parameter is accepted but ignored, so the documented 30-minute setting does not control token lifetime. ### Attack Path 1. An attacker obtains local read access to the project directory, a `run_*` directory, `token_cache`, a backup, or a collected build artifact. 2. The attacker r ...[truncated 724 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/jwt_token.py:7
Finding

Unpinned Third-Party Runtime Dependencies

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (12)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The script sends a username and password to an HTTP endpoint at a private IP address, which provides no transport-layer confidentiality or integrity. Anyone with network visibility or man-in-the-middle capability on that network can intercept credentials and the returned JWT, then reuse them to authenticate as the user.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The username and password are hardcoded directly in the script, making credential exposure likely through source control, backups, logs, screenshots, and accidental sharing. Because the same credentials are then used for authentication, compromise of the codebase or artifact is equivalent to compromise of the account.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The workflow hardcodes a JWT secret key directly in the manifest while presenting the step as a security/authentication layer. A static embedded secret is easily disclosed through source access, logs, backups, or package distribution, allowing forged tokens and undermining the trust model of any downstream submission step.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest includes a JWT generation step and a final data submission step, but the description does not warn users that authentication material is used and data may be transmitted outward. This lack of disclosure can cause users to run the skill without understanding that it may create tokens and submit processed enterprise data to another system.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill explicitly enables persistent logging, checkpoint saving, and output file retention but does not warn users that operational data may be written to disk. In a workflow that processes enterprise Excel/CSV/JSON data, this can expose sensitive business information through logs, saved intermediates, or retained artifacts beyond the user's expectations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The docstring states that paths are determined solely by script-internal configuration, implying fixed configured locations. However, main() loads a run ID from current_run_id.txt and derives per-run INPUT_JSON_DIR_CONFIG and TOKEN_FILE_CONFIG dynamically, so the effective file paths are not solely the static configured ones described in the documentation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The script transmits JSON payloads and a Bearer JWT to an HTTP endpoint using cleartext transport, which exposes both sensitive business data and authentication tokens to interception or modification by anyone on the network path. In an industrial data submission context, this materially increases the risk of credential theft, replay, tampering, and unauthorized API actions.

Content

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

python
}
    logging.info(f"发送 {len(parts)} 条记录 → {url}")
    try:
        resp = requests.post(url, json=parts, headers=headers, timeout=timeout)
        resp.raise_for_status()
        result = resp.json()
        state  = result.get("httpstate")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script writes the JWT to output/jwt_token.txt and also caches it in token_cache without any access-control checks, encryption, or permission hardening. A local user, another process, or a later workflow step with filesystem access can read and reuse the bearer token until it expires.

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/jwt_token.py (reported line 125)May include surrounding context.

python
headers = {"Content-Type": "application/json; charset=utf-8"}

    logging.info(f"请求登录接口: {url}")
    resp = requests.post(url, json=payload, headers=headers, timeout=timeout)

    # 先尝试解析响应体,以便在 raise_for_status 前记录服务端错误信息
    try:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code file contains natural-language strings exclusively in Chinese in the module docstring, CLI description, argument help, errors, and logs. Under the policy, forcing a specific language without user opt-in is a locale/language policy violation unless the constraint is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The natural-language description and operational commentary are entirely in Chinese, with no indication that users may choose another language or that the skill is intentionally restricted to a Chinese-speaking or region-specific context. Per SQP-3, forcing a specific language without opt-in can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file includes its module docstring, CLI description, help text, and runtime messages only in Chinese. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.