Back to skill

Security audit

hash-check

Security checks for vulnerabilities and agentic risk

Overview

This is a local SHA-256 manifest tool, but it underdeclares needed file/process access and can report PASS even when new untrusted files are added.

Review before installing. Use this only as a basic local hashing aid, not as a strict tamper gate, until added files are treated as failures or explicitly allowed. Do not point it at sensitive directories unless you are comfortable producing a manifest of filenames and hashes.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/hash_check.py:41
Finding

Integrity verification reports success when untrusted files are added

Content
View full analysis

Vulnerability Details

File Location: scripts/hash_check.py, lines 41–58
Vulnerability Type: Incomplete integrity validation
Risk Level: Medium

Vulnerable Code

python
missing = sorted(set(base) - set(cur))
added = sorted(set(cur) - set(base))
changed = sorted(k for k in set(base) & set(cur) if base[k] != cur[k])
ok = not missing and not changed
if a.json:
    print(json.dumps({"ok": ok, "checked": len(base), "missing": missing,
                      "added": added, "changed": changed}, ensure_ascii=False, indent=2))
else:
    print("校验: %d/%d 一致%s" % (len(base) - len(changed), len(base), " | PASS" if ok else " | FAIL"))
    for k in changed:
        print("  [改动] " + k)
    for k in missing:
        print("  [缺失] " + k)
    for k in added:
        print("  [新增] " + k)
sys.exit(0 if ok else 1)

Technical Analysis

The script identifies files that exist in the checked directory but not in the trusted manifest through the added collection. However, the success condition only considers missing and modified files:

python
ok = not missing and not changed

Consequently, any number of unmanifested files can be present while the verifier reports PASS, emits "ok": true in JSON mode, and exits with status code 0.

This behavior conflicts with the Skill's documented purpose of detecting tampering in downloaded or transferred directories. In an automated workflow, exit code 0 or the JSON ok field is likely to be treated as authoritative, while the informational added list may not be separately enforced.

The manifest itself is normally written inside the scanned directory. Because scanning occurs before manifest generation, a subsequent check also sees the manifest as an added file. Any correction must therefore exclude the manifest from the scan or place it outside the protected directory before treating additions as failures.

Attack Path

  1. A user generates a trusted SHA-256 manifest for a directory.
  2. The directo ...[truncated 1236 chars]
Remediation
View remediation

Remediation Suggestions

  1. Include added files in the failure condition:
python
ok = not missing and not added and not changed
  1. Prevent the manifest itself from being classified as an added file. Prefer storing the manifest outside the protected directory. Alternatively, resolve its canonical path and explicitly exclude only that exact file during scanning.

  2. Make strict verification the default. If workflows legitimately permit additional files, provide an explicit option such as --allow-added rather than silently accepting them.

  3. Ensure both human-readable and JSON output clearly report failure whenever unmanifested files are present.

  4. Add regression tests covering:

    • an unchanged directory;
    • a modified manifest-listed file;
    • a deleted manifest-listed file;
    • one or more newly added files;
    • the manifest stored inside the target directory;
    • strict and explicitly permissive modes.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Scope Creep

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The manifest declares filesystem: false, but the skill's stated purpose requires reading files/directories and writing logs or JSON manifests. This permission mismatch is dangerous because policy engines, reviewers, or sandboxing layers may trust the manifest and allow a skill to operate with capabilities that are inaccurately disclosed, undermining security controls and user consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The document is written entirely in Chinese and directs AI agents to follow its instructions, but it does not offer an alternative language or indicate user opt-in for this locale constraint. Under the stated policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The policy block explicitly uses Chinese as the primary presentation language for several required disclosure lines, with only partial English glosses. This can amount to a language/locale constraint in the skill materials without clear user opt-in or a documented region-specific requirement.

Content

No source excerpt is available for this finding.

Scope Creep

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises subprocess: false while also declaring a CLI entry point executed with python3, which implies local process execution is necessary to use the tool. This inconsistency can bypass governance expectations around code execution and may cause an orchestrator to misclassify the skill as non-executing when it actually depends on spawning a process.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The changelog explicitly states a bilingual rewrite with 'English first', which is a natural-language locale choice imposed by the skill documentation. The file does not indicate that users may choose their preferred language or opt in to this ordering, so it can violate a language/locale policy requiring user choice.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

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

md
### Workflow
1. Initialize the script runtime; confirm the Python environment and stdlib (e.g. hashlib) are healthy.
2. Upload or point at the local target file/directory; ensure read/write permissions and correct paths.
3. Start the compute module: walk the directory or read the single file, hashing block by block and aggregating into a SHA-256 value.
4. The script auto-compares against the provided hashes (if expected values are configured) and returns a pass/fail status code to the console.
5. Save the verification result to a log file or the designated JSON output location, forming a tamper-evident credential record.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language content in this file is entirely in Chinese, including the guidance that AI agents should read SKILL.md first and the one-line skill description. For a general skill index, this creates an implicit language constraint without user opt-in or a documented region-specific justification, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This file contains natural-language strings for the command description, argument help, and runtime messages entirely in Chinese. Because the skill does not offer a language/locale option or state that it is intentionally limited to a Chinese-speaking context, it can violate a language/locale policy requiring user choice or explicit justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

L12 instructs AI agents to first read SKILL.md and use its frontmatter description to decide whether the skill applies. In the analyzed context, no such manifest is available, so the documented invocation path contradicts the actual available interface for this skill file.

Content

No source excerpt is available for this finding.