Back to skill

Security audit

Thread Dump Analyzer

Security checks for vulnerabilities and agentic risk

Overview

This diagnostic skill is coherent, but it gives process-signal and dump-capture commands that can expose sensitive runtime data or affect live services without enough safety guidance.

Review before installing or using in production. Only run the commands on systems you control, confirm the exact process ID first, prefer controlled maintenance windows, store dumps in a private directory with restrictive permissions, redact secrets and internal details before sharing, and delete dump files after analysis.

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
SKILL.md:23
Finding
Predictable Temporary Files Expose Runtime Dumps and Enable File-Clobbering Attacks<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 23, 29, and 38 **Vulnerability Type**: Unsafe predictable temporary-file creation **Risk Level**: Medium ### Vulnerable Code ```bash # Line 23 jstack $(pgrep -f 'java.*your-app') > /tmp/thread-dump.txt 2>&1 # Line 29 jcmd $(pgrep -f 'java.*your-app') Thread.print > /tmp/thread-dump.txt # Line 38 curl -s http://localhost:6060/debug/pprof/goroutine?debug=2 > /tmp/goroutine-dump.txt ``` ### Technical Analysis The Skill directs users or agents to write diagnostic output to fixed, predictable paths in the shared `/tmp` directory. It does not securely create the files, set a restrictive `umask`, verify file ownership or type, prevent symbolic-link traversal, or remove the files after use. Thread and goroutine dumps may contain sensitive operational information, including application class and function names, source paths, SQL operations, internal hostnames, request-processing states, lock identifiers, and stack-local data exposed by the runtime. Depending on the executing account's `umask`, these files may be readable by other local users. Shell output redirection follows an existing target path. A local attacker who can anticipate the documented names may attempt to pre-create the destination or replace it with a symbolic link. If the command runs under an account permitted to follow and write through that link, output could overwrite another file accessible to that account. Operating-system protections such as Linux `fs.protected_symlinks` can reduce this attack, but the Skill does not require or verify those protections. ### Attack Path 1. An attacker with local access observes that the Skill uses `/tmp/thread-dump.txt` or `/tmp/goroutine-dump.txt`. 2. The attacker monitors for creation of the predictable file and reads it if its resulting permissions permit cross-user access. 3. Alternatively, the attacker pre-creates the expected path as a symbolic link to another file. 4. A user ...[truncated 1219 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Create a private temporary directory using `mktemp`, apply owner-only permissions before collecting diagnostic data, quote variables, and delete the directory after analysis: ```bash umask 077 dump_dir="$(mktemp -d)" || exit 1 trap 'rm -rf -- "$dump_dir"' EXIT pid="$(pgrep -f 'java.*your-app' | head -n 1)" [ -n "$pid" ] || { echo "Target process not found" >&2 exit 1 } jstack "$pid" > "$dump_dir/thread-dump.txt" 2>&1 ``` For a Go dump: ```bash umask 077 dump_dir="$(mktemp -d)" || exit 1 trap 'rm -rf -- "$dump_dir"' EXIT curl --fail --silent --show-error \ 'http://localhost:6060/debug/pprof/goroutine?debug=2' \ > "$dump_dir/goroutine-dump.txt" ``` Additional hardening measures: 1. Avoid fixed filenames in shared temporary directories. 2. Set `umask 077` before creating diagnostic artifacts. 3. Verify that generated files are regular files owned by the executing account. 4. Run collection commands with the least-privileged account capable of inspecting the target process. 5. Retain dumps only as long as necessary and securely remove them afterward. 6. If dumps must be retained, store them in an access-controlled diagnostics directory rather than `/tmp`. 7. Select and confirm a single target PID instead of passing unchecked `pgrep -f` output directly to diagnostic commands. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Context Leakage

High
Category
Data Exfiltration
Content
### 1. `analyze` — Parse and Diagnose Thread Dump

#### Step 1: Capture Thread Dump

**JVM (Java/Kotlin/Scala):**
```bash
Confidence
89% confidence
Finding
The skill begins a 'Capture Thread Dump' workflow that directs collection of full thread and goroutine dumps, which commonly contain stack traces, request metadata, file paths, internal hostnames, credentials in memory-adjacent strings, or other sensitive operational context. Because the skill provides extraction commands but no minimization, redaction, or handling guidance, it increases the risk of leaking sensitive context into shells, files under `/tmp`, logs, or shared analysis channels.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill instructs users to send process signals such as SIGQUIT, SIGUSR1, and `kill -3` directly to running applications without any warning about operational side effects. While these signals are often used for diagnostics rather than termination, they can still disrupt production workloads, expose sensitive runtime state in logs, and behave differently across environments, making the guidance unsafe as written.

Static analysis

No suspicious patterns detected.