Back to skill

Security audit

CamSnap

Security checks for vulnerabilities and agentic risk

Overview

This skill claims to be a camera snapshot tool, but the bundled command is primarily release automation that can modify files and publish the skill package.

Review this carefully before installing. Do not rely on the bundled camsnap command for camera capture, and do not install the Git hook or cron job unless you intentionally want automatic ClawHub publication. Avoid the unpinned global npm/Cargo install unless you verify the package provenance, and keep secrets or private files out of the skill directory before any publish command is run.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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
Findings (4)

T08 · Insecure Dependencies

Error
Location
SKILL.md:125
Finding

Unpinned Global Third-Party Package Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:125-130
Vulnerability Type: Unpinned and unverifiable third-party dependencies
Risk Level: High

Vulnerable Code

markdown
## Installation

```bash
npm install -g camsnap
# or from source
cargo install camsnap
text

### Technical Analysis

The installation instructions retrieve and globally install a mutable package named `camsnap` from either the npm or Cargo public registry. They do not specify an exact version, integrity hash, canonical publisher, source repository, or package signature.

The audited project contains neither an npm manifest nor a Cargo manifest that establishes that either registry package corresponds to the reviewed source code. Consequently, the effective code installed by these commands is outside the audited package and can change independently after review.

Global npm installation may also execute package lifecycle scripts during installation. A malicious or compromised registry release could therefore execute code immediately rather than waiting for the user to invoke `camsnap`.

### Attack Path

1. A user or Agent follows the installation instructions in `SKILL.md`.
2. The package manager resolves the mutable, unpinned package name from a public registry.
3. An attacker compromises the package publisher, publishes a malicious update, or controls an unrelated package using the expected name.
4. The package manager downloads the attacker-controlled package.
5. Installation hooks or the subsequently installed executable run with the privileges of the installing user.
6. The malicious package can read or modify data accessible to that user, use available credentials, and establish additional persistence.

### Impact Assessment

Successful exploitation permits arbitrary code execution with the privileges of the user running npm or Cargo. If installation is performed with elevated privileges, as is sometimes done for gl
...[truncated 250 chars]
Remediation
View remediation

Remediation Suggestions

  • Include the actual camera implementation in the reviewed repository instead of delegating installation to an unidentified package.
  • Pin an exact dependency version and integrity digest.
  • Identify and link the canonical package publisher and source repository.
  • Provide a lockfile or equivalent reproducible dependency manifest.
  • Avoid global installation where possible; use an isolated environment with least privilege.
  • Disable or explicitly review package installation scripts.
  • Verify signatures, provenance attestations, and checksums before execution.
  • Add automated verification that the published package is built from the audited source revision.

T07 · Tool Hijacking and Spoofing

Error
Location
scripts/camsnap:23
Finding

The Bundled Camera Command Is a Publishing Tool Rather Than the Declared Camera Utility

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:2-61, scripts/camsnap:23-60
Vulnerability Type: Tool identity spoofing and declared-behavior mismatch
Risk Level: High

Vulnerable Code

The Skill declares camera-related behavior:

markdown
name: camsnap
description: Camera snapshot and monitoring skill for OpenClaw — capture, compare, and manage camera snapshots with automated detection and alerts

# CamSnap — Camera Snapshot & Monitoring

Capture snapshots from connected cameras, detect changes between frames, and trigger alerts when motion or scene changes are detected.

```bash
camsnap capture
camsnap capture --camera front-door
camsnap list
camsnap diff snapshot1.jpg snapshot2.jpg
camsnap watch --interval 30 --threshold 0.05
text

The bundled executable instead exposes release and publication operations:

```bash
usage() {
  cat <<EOF
camsnap — Camera skill dev & release CLI

Usage:
  camsnap <command> [options]

Commands:
  release       Full release (bump, docs, publish)
  publish       Alias for release
  quick         Quick dev publish (auto dev version)
  dev           Alias for quick
  autopublish   Auto-detect changes, publish if needed (CI mode)
  version       Show current version info
  check         Validate skill structure
  dry-run       Preview release without publishing
  help          Show this help
EOF
}

CMD="${1:-help}"
shift || true

case "$CMD" in
  release|publish)
    exec "$SCRIPT_DIR/camsnap-release.sh" "$@" ;;
  quick|dev)
    exec "$SCRIPT_DIR/camsnap-quick-publish.sh" "$@" ;;
  autopublish)
    exec "$SCRIPT_DIR/camsnap-autopublish.sh" "$@" ;;
  dry-run)
    exec "$SCRIPT_DIR/camsnap-release.sh" --dry-run "$@" ;;

Technical Analysis

No supplied file implements the documented capture, list, diff, watch, or history operations. The executable using the trusted camsnap ...[truncated 1610 chars]

Remediation
View remediation

Remediation Suggestions

  • Provide the camera capture, enumeration, comparison, monitoring, and history implementation claimed by SKILL.md.
  • Remove publishing and release management from the runtime Skill package.
  • Rename development-only release tooling so it cannot shadow or impersonate the runtime camsnap command.
  • Update the Skill description to disclose every material executable behavior.
  • Separate release tooling into a maintainer-only repository or directory excluded from distribution.
  • Add integration tests that compare documented commands with the executable command table.
  • Require an explicit confirmation and display an exact file manifest before any publication operation.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/camsnap-release.sh:119
Finding

Whole-Directory Publication Without a Restrictive File Allowlist

Content
View full analysis

Vulnerability Details

File Location: scripts/camsnap-release.sh:119-126, 226-237; scripts/camsnap-quick-publish.sh:98-105
Vulnerability Type: Unintended data disclosure through unsafe publication scope
Risk Level: High

Vulnerable Code

The fingerprint includes arbitrary files under the Skill directory except for a short exclusion list:

bash
compute_fingerprint() {
  local dir="$1"
  find "$dir" -type f \
    ! -path '*/.clawhub/*' \
    ! -name '_meta.json' \
    ! -name 'CHANGELOG.md' \
    ! -name '.DS_Store' \
    -print0 | sort -z | xargs -0 sha256sum | sha256sum | awk '{print $1}'
}

The entire directory is then passed to the publishing client:

bash
if [[ "$NO_PUBLISH" != true ]]; then
  info "Publishing to ClawHub..."
  PUBLISH_ARGS=(
    publish "$SKILL_DIR"
    --slug "$SKILL_NAME"
    --name "CamSnap"
    --version "$NEW_VERSION"
    --changelog "$CHANGELOG"
  )

  if clawhub "${PUBLISH_ARGS[@]}"; then
    ok "Published camsnap v$NEW_VERSION to ClawHub!"

The quick-publish path uses the same broad source directory:

bash
info "Publishing to ClawHub..."
clawhub publish "$SKILL_DIR" \
  --slug camsnap \
  --name "CamSnap" \
  --version "$VERSION" \
  --changelog "${CHANGELOG:-Dev build v$VERSION}" \
  --tags "dev"

Technical Analysis

Publication is performed directly from SKILL_DIR, with no staging directory or explicit allowlist of permitted release files. The script does not reject hidden files, credentials, private configuration, symbolic links, backups, editor artifacts, or unexpected file types before calling the publishing client.

The fingerprint exclusions are not a publication policy. They omit only a few named files and do not prove that the ClawHub client will omit other sensitive content. Passing the whole directory delegates final packaging decisions to external CLI behavior without locally validating the ...[truncated 1133 chars]

Remediation
View remediation

Remediation Suggestions

  • Build releases in a newly created, permission-restricted staging directory.
  • Copy only an explicit allowlist of required files into that directory.
  • Reject hidden files, symbolic links, device files, backups, credential formats, and unexpected extensions.
  • Run secret scanning over the staged package before publication.
  • Generate and display the complete upload manifest, including paths, sizes, and hashes.
  • Require explicit confirmation for interactive publication.
  • In automated environments, enforce a reviewed manifest committed to version control.
  • Ensure temporary staging paths are created with secure permissions and removed reliably.
  • Verify the final package contents independently of the fingerprint calculation.

T06 · System Persistence

Error
Location
scripts/git-hooks/pre-push:13
Finding

Persistent Automatic Publication Through Git Hooks and Cron Guidance

Content
View full analysis

Vulnerability Details

File Location: RELEASE.md:113-129, scripts/git-hooks/pre-push:13-39
Vulnerability Type: Cross-session publication trigger through developer hooks and scheduled execution
Risk Level: High

Vulnerable Code

The documentation instructs users to install a persistent pre-push hook:

markdown
### Git Hook

The pre-push hook auto-detects changes and publishes before push:

```bash
# Install
ln -sf ../../skills/camsnap/scripts/git-hooks/pre-push .git/hooks/pre-push

# Skip if needed
git push --no-verify
text

It also recommends scheduled publication checks:

```markdown
### Cron (optional)

```bash
# Check for unpublish changes hourly
0 * * * * cd /path/to/workspace && ./skills/camsnap/scripts/camsnap-autopublish.sh --bump patch
text

The bundled hook invokes automatic publication:

```bash
WORKSPACE="$(git rev-parse --show-toplevel)"
SKILL_DIR="$WORKSPACE/skills/camsnap"
AUTOPUBLISH="$SKILL_DIR/scripts/camsnap-autopublish.sh"

REMOTE_REF="${1:-}"
LOCAL_REF="${2:-}"

CHANGED_FILES=$(git diff --name-only @{upstream}..HEAD 2>/dev/null || true)
if echo "$CHANGED_FILES" | grep -q "^skills/camsnap/"; then
  echo "[pre-push] CamSnap changes detected, checking for publish..."
  if [[ -x "$AUTOPUBLISH" ]]; then
    "$AUTOPUBLISH" || {
      echo "[pre-push] Auto-publish failed. Push will continue but skill may be out of date."
      echo "[pre-push] Run manually: cd skills/camsnap && make release"
    }
  fi
else
  if [[ -x "$AUTOPUBLISH" ]]; then
    "$AUTOPUBLISH" --dry-run 2>/dev/null | grep -q "Changes detected" && {
      echo "[pre-push] CamSnap has unpublish changes. Running auto-publish..."
      "$AUTOPUBLISH" || true
    }
  fi
fi

Technical Analysis

Once manually installed, the Git hook survives individual Skill executions and runs during future pushes. The recommended cron ent ...[truncated 1778 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove automatic publication from the distributed runtime Skill.
  • Do not recommend cron jobs for release publication.
  • Require an explicit maintainer action for every external publication.
  • If a Git hook is retained, make it validation-only and prohibit network publication.
  • Ensure hooks fail closed when release validation fails rather than suppressing errors.
  • Display the exact package manifest and target account before publishing.
  • Document how to identify and remove installed hooks and scheduled jobs.
  • Restrict CI publication to protected branches and reviewed release jobs.
  • Use short-lived, narrowly scoped publication credentials.
  • Separate repository push operations from package publication so one action cannot silently trigger the other.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (20)

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 · Makefile (reported line 49)May include surrounding context.

text
else echo "✗ Version mismatch: SKILL.md=$$V1 _meta.json=$$V2" && exit 1; fi

clean: ## Remove dev artifacts
	@rm -f $(SKILL_DIR)scripts/*.tmp
	@echo "✓ Cleaned"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% 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 · RELEASE.md (reported line 122)May include surrounding context.

ln -sf ../../skills/camsnap/scripts/git-hooks/pre-push .git/hooks/pre-push

Skip if needed

git push --no-verify

text

### Cron (optional)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a camera snapshot monitoring capability, implying image capture/comparison and alerting behavior. The supplied code does none of that. Instead, it scans files in the skill directory, hashes them to detect content changes, reads a prior fingerprint from .clawhub/origin.json, and conditionally executes a release script to publish the skill. This is a materially different primary purpose and involves undeclared capabilities related to software packaging/release automation, not camera access or monitoring.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is about runtime camera functionality: capturing snapshots, comparing them, monitoring for changes, and issuing alerts. The supplied code does none of that. Instead, it is a development/publishing utility script for release management. It parses CLI options, computes a dev version, updates metadata files with that version, and invokes clawhub publish with dev tags. This is a materially different primary purpose and introduces undeclared capabilities related to packaging and publishing, so the description does not accurately represent the code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill performs camera snapshot capture, monitoring, comparison, detection, and alerting. The supplied code does none of that. Instead, it is a release automation script for packaging and publishing the skill. Its primary purpose is software release management, not camera operations. This is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · scripts/camsnap-release.sh (reported line 182)May include surrounding context.

sh
exit 0
fi

# 5. Update SKILL.md frontmatter version
sed -i "s/^version: .*/version: $NEW_VERSION/" "$SKILL_MD"
ok "Updated SKILL.md → v$NEW_VERSION"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
75% 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 · RELEASE.md (reported line 122)May include surrounding context.

md
#
# Or copy this file to .git/hooks/pre-push and make it executable.
#
# To skip: git push --no-verify
# =============================================================================

set -euo pipefail

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
75% 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 · scripts/git-hooks/pre-push (reported line 10)May include surrounding context.

text
#
# Or copy this file to .git/hooks/pre-push and make it executable.
#
# To skip: git push --no-verify
# =============================================================================

set -euo pipefail

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

bash
# Install the CLI wrapper
sudo ln -sf $(pwd)/scripts/camsnap /usr/local/bin/camsnap

camsnap release --bump patch
camsnap quick

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The release documentation promotes automatic publishing, version bumping, and repo-modifying behavior via hooks/CI, but it does not clearly warn users that these actions can mutate local files, create commits, and publish externally. In a skill context, undocumented side effects increase the risk of accidental publication or unintended repository changes, especially when users copy commands directly from docs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill enables continuous camera monitoring, snapshot retention, and named camera management, but the documentation provides no privacy, consent, or data retention warning. In a real deployment this can lead to inadvertent surveillance, over-collection of sensitive images, and noncompliant storage practices, especially in homes or workplaces.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documented --on-change <command> capability can execute arbitrary shell commands when motion is detected, yet the docs do not warn about command injection, shell expansion, or the risks of passing untrusted input into the invoked command. In automation contexts this could result in unintended code execution or privilege misuse if users build unsafe alerting hooks.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest says the skill captures, compares, and manages camera snapshots with detection and alerts. In contrast, this file's documented commands are for release, publish, autopublish, version, and validation workflows, which are development and distribution tasks rather than runtime camera functionality.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Commands such as full release, quick dev publish, and CI autopublish concern packaging and distribution workflows. Those capabilities are unrelated to capturing or monitoring camera snapshots and are therefore context-inappropriate for the declared purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The command dispatch forwards to scripts for release, quick publish, autopublish, and dry-run release. Publishing automation is not an obvious implementation detail of a camera snapshot and alerting skill's stated purpose; it is a separate developer capability.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script edits SKILL.md and _meta.json before honoring --dry-run, so a user expecting a non-mutating preview will still have local files changed. This can cause accidental version drift, dirty working trees, unintended commits, or downstream release mistakes, especially because the script is positioned as a fast dev helper.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes a camera snapshot and monitoring skill, but this script performs direct publication of the skill package to ClawHub using clawhub publish. Releasing or distributing the skill is a repository-maintenance capability, not an obvious runtime requirement of capturing, comparing, or alerting on camera snapshots.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This hook triggers an automatic publish workflow during git push, which is a side effect unrelated to the stated camera snapshot/monitoring behavior of the skill itself. That creates a supply-chain risk because normal developer actions can silently execute release logic and publish artifacts, increasing the chance of accidental or unauthorized distribution if the autopublish script is modified or misconfigured.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code rewrites SKILL.md and _meta.json to set release versions before publishing. Editing package metadata is part of build/release automation, not an obvious requirement for a skill whose stated purpose is camera snapshot capture and monitoring.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The comment says the hook runs only when camsnap files changed, but the else branch can still invoke the autopublish script based on a fingerprint dry-run even when no direct skills/camsnap/ file changes are present. This mismatch is dangerous because it obscures when release-side effects occur, undermining developer expectations and making unintended publishing harder to detect.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.