Back to skill

Security audit

Document Compliance Audit Engine

Security checks for vulnerabilities and agentic risk

Overview

A crafted document can insert unwanted browser scripts into the generated HTML report.

Use JSON output until HTML generation properly escapes document and rule content. Avoid opening or sharing HTML reports generated from untrusted documents. Run demos in a new empty directory because existing report filenames can be overwritten. Keep document sizes manageable and use trusted custom rules. The Review verdict follows the independently verified HTML flaw, not the advisory scanner's rating; the separate static scan reported no findings.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (5)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The primary auditing functionality accurately matches the description. However, cmd_demo() defaults its output directory to Path.cwd(), and run_demo() calls mkdir(parents=True, exist_ok=True) and writes three reports per sample using generated filenames. This contradicts the explicit write-scope guarantee. External rule-file reads are disclosed by the --rules-dir capability, and timestamps and random trace identifiers are supporting metadata rather than nondeterministic verdicts. The confidence field is not emitted by the supplied report serializers.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
86% confidence
Finding

The audit and rule-management commands align with the declared purpose. However, the advertised demo is inconsistent with the unconditional claim that the tool reads only the input file passed and writes only the report file named. This is a bounded file-I/O mismatch, not evidence of network access or malicious behavior. Because only invocation examples are provided, the underlying engine's actual access patterns, determinism, and dependency claims cannot be verified.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: file_read, file_write.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Unbounded Output

Medium
Category
Output Handling
Confidence
87% confidence
Finding

The documented removal of finding limits allows attacker-supplied documents containing many matching occurrences to amplify memory consumption, report size, and agent-visible output. Offline operation prevents direct network exposure but does not prevent local resource exhaustion when an agent audits an untrusted document.

Content

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

md
Synced the single-file engine with the upstream repository's `compliance_engine` fixes (the `Document Engine.py` / `compliance_engine/` line).

- **Every occurrence is reported.** The keyword matcher now loops over the whole document instead of stopping at the first hit per keyword — a clause repeated 300 times yields 300 findings. The upstream per-rule cap (200) was removed again in a follow-up fix, so there is no truncation and no "仅列前 N 处" summary row.
- **Findings carry an offset.** `AuditFinding.offset` records the character position of each hit; `AuditNode` gained `start` / `end`. Findings are attached to the owning clause by binary search over node offsets (with the previous snippet-contains fallback), so a hit in 第一条 no longer lands on 第二条.
- **Regex rules accept a pattern list.** `_match_regex` reads `patterns` (falling back to the legacy single `pattern`), compiles each entry, merges matches by position and de-duplicates identical spans.
- **Rules widened.** `COM-001` gained

The demo command writes multiple automatically named files, contrary to the manifest's single named-report write boundary.

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

The manifest promises to write only the report file the user names. At L1022 and L1029–L1032, run_demo creates a directory and writes HTML, JSON, and Markdown files under automatically generated names for each selected sample, potentially overwriting existing files. The CLI defaults this operation to the current directory when no output directory is supplied (L1099–L1101), so the additional writes do not require explicit destination filenames.

Content

No source excerpt is available for this finding.