Back to skill

Security audit

Humanize Beagle

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent writing-cleanup purpose, but it can automatically edit files from a weakly validated review file and may execute an unpinned npm package during validation.

Review this skill before installing. Use it only in a clean, backed-up repository where you trust the source of .beagle/ai-writing-review.json, prefer --dry-run first, and avoid running it with access to sensitive files or credentials. A safer version should validate each finding path inside the git worktree and use a pinned or locally installed JS parser instead of npx -y.

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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:205
Finding

Unpinned npm Package Downloaded and Executed During Validation

Content
View full analysis
/dev/null 2>&1 ``` ``` ### Technical Analysis The validation procedure invokes `npx -y acorn` without specifying an exact package version, integrity hash, or trusted local installation. If `acorn` is not already available locally, `npx` can retrieve the current package from the configured npm registry and execute it automatically. The `-y` option suppresses the confirmation prompt, so external package code may be downloaded and executed without explicit user approval. The executed package version can change after the Skill has been audited, making the validation process dependent on mutable third-party registry content. This is an insecure supply-chain practice. Compromise of the npm package, registry account, registry configuration, DNS path, or a transitive dependency could turn a syntax-validation step into arbitrary code execution. ### Attack Path 1. The Skill modifies or attempts to validate a TypeScript or JavaScript file. 2. The validation step runs `npx -y acorn`. 3. If a trusted local copy is unavailable, `npx` queries the configured npm registry. 4. A compromised or unexpectedly changed package version is downloaded. 5. npm package lifecycle behavior or package code executes with the same operating-system privileges as the Agent. 6. The malicious package can access files, environment variables, network resources, and credentials available to that account. ### Impact Assessment Successful exploitation could provide arbitrary code execution with the Agent process's privileges. The accessible scope could include: - The current repository and other files writable by the Agent account. - Environment variables and locally available credentials. - Git configuration, tokens, and package-manager ...[truncated 383 chars]
Remediation
View remediation
/dev/null 2>&1 ``` 3. Prefer the package manager's immutable or frozen-lockfile mode when installing dependencies. 4. Pin an exact version and verify package integrity if runtime retrieval cannot be eliminated. 5. Run validation in a restricted environment without sensitive credentials and with network access disabled. 6. Document the required validator version and fail safely when it is unavailable rather than downloading it automatically. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:71
Finding

Insufficient Validation of Review-Controlled File Paths

Content
View full analysis
/dev/null 2>&1 \ || { echo "Invalid or incompatible ai-writing-review.json"; exit 1; } ``` Finding paths are subsequently used to select files for modification: ```markdown 1. Sort findings by file, then by line number (descending, to avoid offset drift) 2. For each file, apply all safe fixes in reverse line order 3. For git artifacts (`git:commit:*`, `git:pr:*`), skip — these can't be auto-fixed. Report them for manual attention. ``` The paths are also passed to validation commands, including interpolation directly into Python source: ```bash **Python:** ```bash python3 -c "import ast; ast.parse(open('$file').read())" ``` **TypeScript/JavaScript:** ```bash npx -y acorn --ecma2020 "$file" > /dev/null 2>&1 ``` ``` ### Technical Analysis The JSON validation confirms only that `git_head` exists and `findings` is an array. It does not validate the schema of each finding or constrain its file path. There are no stated checks that: - Reject absolute paths. - Reject `..` traversal components. - Resolve and verify canonical paths against the Git worktree. - Reject symbolic links that resolve outside the repository. - Require the target to be a regular file. - Require the target to be tracked by Git. - Reject control characters or quote characters in filenames. Consequently, a tampered `.beagle/ai-writing-review.json` could identify files outside the intended repository. Because the Skill instructs the Agent to apply findings directly, suc ...[truncated 2500 chars]
Remediation
View remediation
/dev/null 2>&1 || exit 1 ``` 6. Maintain an explicit allowlist of supported file extensions and exclude `.git`, credential files, dependency directories, and generated artifacts. 7. Never interpolate paths into source code passed through `python3 -c`. Pass the path as a positional argument: ```bash python3 -c 'import ast, pathlib, sys; ast.parse(pathlib.Path(sys.argv[1]).read_text())' "$file" ``` 8. Use argument arrays or equivalent structured process APIs for all subprocess execution. 9. Treat `.beagle/ai-writing-review.json` as untrusted input even when generated by another Skill. 10. Revalidate containment immediately before every read, write, validation, or revert operation to reduce symlink and time-of-check/time-of-use risks. ]]>
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (4)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

md
2. **G2 — Review input is real JSON with expected shape** — **PASS:** `.beagle/ai-writing-review.json` exists **and** the file parses as JSON with a `git_head` key and a `findings` value that is an array (possibly empty). Use the `jq -e` command in step 3, or the same checks with `json.load` in Python. If this fails, stop with a parse/validation error—do not apply fixes.
3. **G3 — References before rewrites** — **PASS:** For each finding you will edit, the `references/*.md` files required by step 4 for that category/type are read in this session before you change text.
4. **G4 — Per-file validation** — **PASS:** Every modified file passes the step 8 check for its type; otherwise run `git checkout -- "$file"` for that file and do not list it as OK in the summary.
5. **G5 — Delete review file only on full success** — **PASS:** Run `rm .beagle/ai-writing-review.json` only when G4 holds for all files you are keeping unchanged from validation failures (aligns with step 10).

### 1. Parse Arguments

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

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

md
Partition remaining findings by `fix_safety`:

**Safe Fixes** (auto-apply):
- `chat_leak` - Delete conversational artifacts
- `cutoff_disclaimer` - Delete knowledge cutoff references
- `filler_phrase` - Delete filler phrases
- `heading_restatement` - Delete restating first sentence

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

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

On successful completion (all validations pass):

bash
rm .beagle/ai-writing-review.json

If any validation fails, keep the file and report:

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

The skill instructs use of npx -y acorn without pinning a specific package version. That makes execution depend on whatever version is current at runtime, which weakens reproducibility and creates supply-chain risk if a compromised or breaking release is published.

Content

No source excerpt is available for this finding.