Back to skill

Security audit

Agent Core Extractor

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it packages sensitive agent configuration by default and its export script can write outside the intended output area if given crafted path-like inputs.

Install only if you are comfortable reviewing the generated archive before sharing it. Avoid passing path-like values in --name or --repos, inspect .claude/settings.json and other config files for secrets, local paths, allowlists, or private policy before distributing the zip, and prefer running it on repositories you control.

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/export-agent-core-pack.sh:163
Finding

Unvalidated Path Components Permit Writes Outside the Intended Staging Directory

Content
View full analysis
&2; usage >&2; exit 1 ;; esac done require_cmd zip BASE_DIR="$(resolve_path "$BASE_DIR")" OUTPUT_DIR="$(resolve_path "$OUTPUT_DIR")" STAGING_DIR="$OUTPUT_DIR/$NAME" ZIP_PATH="$OUTPUT_DIR/$NAME.zip" [[ ! -e "$STAGING_DIR" ]] || { echo "Refusing to overwrite: $STAGING_DIR" >&2; exit 1; } [[ ! -e "$ZIP_PATH" ]] || { echo "Refusing to overwrite: $ZIP_PATH" >&2; exit 1; } mkdir -p "$STAGING_DIR" declare -a INCLUDED_PATHS=() declare -a FRAMEWORK_LINES=() IFS=',' read -r -a REPOS <<<"$REPOS_RAW" for repo in "${REPOS[@]}"; do repo="$(printf '%s' "$repo" | xargs)" [[ -n "$repo" ]] || continue repo_dir="$BASE_DIR/$repo" [[ -d "$repo_dir" ]] || { echo "Missing repo: $repo_dir" >&2; exit 1; } framework="$(detect_framework "$repo_dir")" [[ "$framework" != "unknown" ]] || { echo "Unsupported framework in $repo" >&2; exit 1; } FRAMEWORK_LINES+=("$repo | $framework") mkdir -p "$STAGING_DIR/$repo" extract_by_framework "$repo" "$repo_dir" "$framework" "$STAGING_DIR/$repo" done ``` The resulting destination is subsequently passed to overwrite-capable copy operations: ```bash copy_file() { local src="$1" local dst="$2" [[ -f "$src" ]] || return 0 mkdir -p "$(dirname "$dst")" cp -p "$src" "$dst" INCLUDED_PATHS+=("$src") } copy_dir() { local src="$1" local dst="$2" [[ -d "$src" ]] || return 0 mkdir -p "$(dirname "$dst")" cp -Rp "$src" "$dst" INCLUDED_PATHS+=("$src") } ``` ### Technical Analysis The user-controlled `NAME` value and eac ...[truncated 2305 chars]
Remediation
View remediation
&2 exit 1 fi } ``` 2. Validate `NAME` after option parsing and validate every repository identifier before using it: ```bash validate_component "$NAME" "archive name" for repo in "${REPOS[@]}"; do repo="$(printf '%s' "$repo" | xargs)" [[ -n "$repo" ]] || continue validate_component "$repo" "repository name" # Continue processing. done ``` 3. Canonicalize output and destination paths and verify containment before creating directories or copying files. The canonical staging path must remain beneath the canonical output directory, and every extraction destination must remain beneath the canonical staging directory. 4. Explicitly reject absolute paths, `/`, backslashes where applicable, and all `..` path components even if a broader naming policy is later adopted. 5. Use non-overwriting copy behavior, such as `cp -n`, or explicitly fail when a destination file already exists. This provides defense in depth but should not replace containment validation. 6. Consider creating the staging directory with `mktemp -d` beneath the validated output directory to reduce path collisions and unsafe directory reuse. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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 (7)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
2. Run `scripts/export-agent-core-pack.sh`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
2. Run `scripts/export-agent-core-pack.sh`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
2. Run `scripts/export-agent-core-pack.sh`.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
2. Run `scripts/export-agent-core-pack.sh`.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

The script includes .claude/settings.json from the source repository in the exported archive, which may contain agent configuration, local preferences, mount allowlists, or other sensitive operational settings that are not intended for redistribution. In the context of a portability/export skill, bundling hidden agent config increases the chance of leaking security-relevant configuration into a shareable zip, especially because the output is explicitly designed for migration or cross-framework analysis.

Content

Scanner excerpt · scripts/export-agent-core-pack.sh (reported line 92)May include surrounding context.

sh
copy_file "$repo_dir/CLAUDE.md" "$dest/CLAUDE.md"
      copy_file "$repo_dir/groups/global/CLAUDE.md" "$dest/groups/global/CLAUDE.md"
      copy_file "$repo_dir/groups/main/CLAUDE.md" "$dest/groups/main/CLAUDE.md"
      copy_file "$repo_dir/.claude/settings.json" "$dest/.claude/settings.json"
      copy_file "$repo_dir/src/config.ts" "$dest/src/config.ts"
      copy_file "$repo_dir/config-examples/mount-allowlist.json" "$dest/config-examples/mount-allowlist.json"
      ;;

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This shell script performs nontrivial file writes by creating a staging directory and later populating it with copied content, but there is no confirmation prompt or explicit user-facing warning beyond the generic usage text. For a code file, filesystem-modifying behavior can warrant disclosure unless it is clearly communicated to the user.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The extraction step copies selected files and directories from repositories into a new output tree, which affects local data layout and may duplicate potentially sensitive project content. Although this behavior is somewhat implied by the script name and usage, the file lacks a clear warning or disclosure message near the operation itself.

Content

No source excerpt is available for this finding.