Back to skill

Security audit

Personalize Openclaw Webui Logo

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended to customize OpenClaw favicons, but it needs review because its optional startup hook and weak path validation can repeatedly modify local files beyond a tightly verified target.

Install only if you are comfortable with a local customization skill that writes into your OpenClaw UI package and, if enabled, installs a startup hook. Avoid using OPENCLAW_UI_DIR unless it points to a verified OpenClaw control-ui directory, do not run the scripts as root, and review or remove ~/.openclaw/hooks/logo-guard if you do not want automatic restoration on gateway startup.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
apply-logo.sh:107
Finding

Unsafe temporary-file construction enables symlink race and arbitrary file overwrite

Content
View full analysis
"$MASTER" 2>/dev/null; then base64 -D -i "$SETDIR/favicon-master.txt" > "$MASTER" fi ``` The same pattern is used for ICO generation: ```bash write_ico() { local src="$1" dst="$2" size="$3" local tmp tmp="$(mktemp "$TMPROOT/fav.XXXXXX").png" resize_png "$src" "$tmp" "$size" case "$TOOL" in sips) sips -s format ico "$tmp" --out "$dst" >/dev/null 2>&1 || cp "$tmp" "$dst" ;; magick) magick "$tmp" "$dst" 2>/dev/null || cp "$tmp" "$dst" ;; convert) convert "$tmp" "$dst" 2>/dev/null || cp "$tmp" "$dst" ;; pillow) python3 - "$tmp" "$dst" <<'PY' || cp "$tmp" "$dst" import sys from PIL import Image Image.open(sys.argv[1]).save(sys.argv[2], "ICO", sizes=[(64,64),(32,32),(16,16)]) PY ;; *) cp "$tmp" "$dst" ;; esac rm -f "$tmp" } ``` ### Technical Analysis `mktemp` securely creates a randomly named file, but the script subsequently appends `.png` to the returned pathname. For example, `mktemp` creates: ```text /tmp/logo-master.ABC123 ``` while the script writes to: ```text /tmp/logo-master.ABC123.png ``` The latter path was not created securely and is not protected by `mktemp`. The original empty file is also not removed because `CLEANUP` refers only to the suffixed pathname. On a shared system, a local attacker can monitor temporary-directory creation, learn the securely generated base name, and create the corresponding `. ...[truncated 1659 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
apply-logo.sh:33
Finding

Unvalidated OPENCLAW_UI_DIR permits out-of-scope file replacement

Content
View full analysis
&2 echo "Tried npm root -g, \$(which openclaw), and common install prefixes." >&2 echo "Set OPENCLAW_UI_DIR=/abs/path/to/openclaw/dist/control-ui and re-run." >&2 exit 1 fi ``` Four files are subsequently replaced without verifying that the destination is an OpenClaw control UI: ```bash # 1) favicon-32.png resize_png "$MASTER" "$UI/favicon-32.png" 32 # 2) apple-touch-icon.png (180x180) resize_png "$MASTER" "$UI/apple-touch-icon.png" 180 # 3) favicon.svg slot - browsers prefer it; wrap PNG as image-in-SVG B64="$(base64 < "$MASTER" | tr -d '\n')" cat > "$UI/favicon.svg" < SVGEOF # 4) favicon.ico (64x64) write_ico "$MASTER" "$UI/favicon.ico" 64 ``` ### Technical Analysis `OPENCLAW_UI_DIR` is accepted verbatim. Contrary to the documentation, the script does not require it to be absolute, canonicalize it, or verify expected OpenClaw control-UI markers. Any existing directory can therefore become the write target. The script replaces files named: - `favicon-32.png` - `apple-touch-icon.png` - `favicon.svg` - `favicon.ico` This exceeds the minimum necessary privilege boundary because the Skill only needs to modify a verified OpenClaw `dist/control-ui` directory. Quoting prevents shell command injection, but it does not prevent filesystem target manipul ...[truncated 1300 chars]
Remediation
View remediation
&2; exit 1 ;; esac UI="$(cd "$OPENCLAW_UI_DIR" && pwd -P)" ``` - Verify OpenClaw-specific markers before writing, such as the expected parent package metadata and control-UI structure. - Reject `/`, home directories, temporary roots, and other implausible destinations. - Reject symbolic links for destination files or safely replace them using temporary files in the verified directory followed by an atomic rename. - Display the canonical destination and require explicit confirmation when an override is used interactively. - Do not recommend or automatically use administrative privileges. If a global installation is not writable, instruct users to fix ownership or use an approved package-management workflow. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
apply-logo.sh:25
Finding

Logo-set path traversal permits selection of files outside the bundled logo library

Content
View full analysis
&2 echo "Available sets:" >&2 ls -1 "$SKILL_DIR/logos" 2>/dev/null | sed 's/^/ - /' >&2 || echo " (none)" >&2 exit 1 fi # ---------- 2. Resolve master PNG ---------- MASTER="" CLEANUP="" TMPROOT="${TMPDIR:-/tmp}" if [ -f "$SETDIR/favicon-master.png" ]; then MASTER="$SETDIR/favicon-master.png" elif [ -f "$SETDIR/favicon-master.txt" ]; then MASTER="$(mktemp "$TMPROOT/logo-master.XXXXXX").png" CLEANUP="$MASTER" # GNU base64 → -d; BSD/mac → -D. Try both. if ! base64 -d "$SETDIR/favicon-master.txt" > "$MASTER" 2>/dev/null; then base64 -D -i "$SETDIR/favicon-master.txt" > "$MASTER" fi ``` ### Technical Analysis The set name is concatenated directly into a filesystem path. Inputs such as `../../some-directory` are not rejected, and the resulting path is not canonicalized or checked to remain under `$SKILL_DIR/logos`. Consequently, any accessible directory containing a file named `favicon-master.png` or `favicon-master.txt` can be used as a logo source. The file is passed to privileged native image parsers including ImageMagick, Pillow, `sips`, or FFmpeg. The unchecked set value is also written to persistent state by `apply-logo.sh`. If the optional startup hook is installed, `check-and-restore.sh` reads that value and invokes `apply-logo.sh` with it again after favicon drift, preserving the out-of-library selection across gateway restarts. ### Attack Path 1. An attacker creates or identifies an accessible directory outside the Skill containing `favicon-master.png` or ...[truncated 1288 chars]
Remediation
View remediation
&2 exit 1 ;; esac ``` - Canonicalize both the logo root and selected directory, then enforce containment: ```bash LOGO_ROOT="$(cd "$SKILL_DIR/logos" && pwd -P)" SETDIR="$(cd "$LOGO_ROOT/$SET" 2>/dev/null && pwd -P)" || exit 1 case "$SETDIR/" in "$LOGO_ROOT"/*/) ;; *) echo "ERROR: logo set escapes the bundled library" >&2; exit 1 ;; esac ``` - Reject symbolic-link logo-set directories and master files unless their canonical targets remain inside the logo library. - Validate decoded assets before invoking complex image processors, including PNG signature, dimensions, maximum decoded size, and permitted format. - Record only a validated canonical set identifier in `applied-state`. - Revalidate state values in `check-and-restore.sh`; persistent state must not be trusted solely because it was generated by an earlier run. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · apply-logo.sh (reported line 217)May include surrounding context.

sh
# 4) favicon.ico (64x64)
write_ico "$MASTER" "$UI/favicon.ico" 64

[ -n "$CLEANUP" ] && rm -f "$CLEANUP"

# ---------- 5. Write applied-state stamp to STATE_DIR (publish-safe) ----------
# State lives outside the skill dir so the skill stays clean for skillhub/clawhub publish.

YARA rule 'privilege_escalation_tools': Privilege escalation tools and techniques [hacktools]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · logos/original/favicon-master.txt (reported line 1)May include surrounding context.

text
LpJCg9YNzmreKzzHDOZ0Xmu8z6mMBoGm/OGiyyhjIiQ7OHwmHGApzo3jiFSMyPoUWlCMwNjojpYwsY7q0Khg8lVjTq/QuAgbN9NcFEElUqc8qc9KxHd7ebOMjFs/AyJgbTtpVPLspze9em778KDRvx4mqJPJcuX19ZlKRGKJ5a1w3xZjicM/sSJBJEszsnhtIn1dF5W0oO3nj53JRnrkfpZbRBUvN1lhWKoqxYmyS72EDfJuQzPOacFliMlMRo1aoXCWCKfSJ+lXepZOA9+mYOV8sx4I6TZ7GdhZ8/wbDhu8iERhgLhddFmc4DEUKnjstOnczCRRepgoYmtbEuwczUbJhKiEMIUYrNYIJpCcFwsJxUqHAsnTTLu5jULgDR9Xz422rQsrJhbMKjqlpsPy51adXUqOY/NsYzGlUySg6rTvjUsgNDNDBcWZbprp/3eWkfjLIKXXEqs/SoxR++QWDcBlLSJ0dRL7+AhU7dFtoTjm44TV3LypBy44Fz5m7Q/Va48zolFniNPzs4KO5rMbXjJ/RzeufaNXqsKM8mtf8sQk5/JxJtzR0Rg90YIFGz0uYDEcwAXJjTqMYaYSXcLp9osxi6JBEJhgL+CaXmJPUM2U8Qq6woEYgJUQWXfVVVidPTU3PmHzv0x6dZnrc6BYNmjXq+e/vmhdU7XFlkWegPVbDIKgcq6wZyH8SFCLD0ATgFA7lpCT7L8dazbDuztxHnMBt8hM0FJat8wf+HktzZbYBMVBPjIm3B+Rjvcp8XtCdd47CsyJf3ssUAqQ9/HrCp91pHVVTmaYJLjq5t4LrXITMnwyTTxH+MEX60n0nY9OZJVWV5OmcjKujkTlTA8EmurnFpL2zqZtr6WtjvSaipyCQYhNaWUKqpnUWZtKKDtZ8LiB0NWkEUiULQxegyaCd2Rrsd0a9PeF3OESoFEm/CneL7249CA2JbNeU7g5GnFofFFeXcS2QieIxo8yVWhXEj5IzSMeo+eGnL3MydjN

Undeclared Tool Scope

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.

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 · apply-logo.sh (reported line 142)May include surrounding context.

sh
else
  echo "ERROR: need one of: sips (macOS), ImageMagick (magick/convert), python3+Pillow, or ffmpeg." >&2
  echo "  macOS:    built-in sips" >&2
  echo "  Linux:    sudo apt install imagemagick   # or: pip install Pillow" >&2
  echo "  Windows:  choco install imagemagick      # or: pip install Pillow" >&2
  exit 1
fi

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

Scanner excerpt · apply-logo.sh (reported line 223)May include surrounding context.

sh
LOG="$STATE_DIR/logo-guard.log"

mkdir -p "$STATE_DIR" 2>/dev/null || true
chmod 700 "$STATE_DIR" 2>/dev/null || true

log() { printf '[%s] %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$*" >> "$LOG"; }

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

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

Content

Scanner excerpt · check-and-restore.sh (reported line 24)May include surrounding context.

sh
LOG="$STATE_DIR/logo-guard.log"

mkdir -p "$STATE_DIR" 2>/dev/null || true
chmod 700 "$STATE_DIR" 2>/dev/null || true

log() { printf '[%s] %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$*" >> "$LOG"; }

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The handler launches a shell script via bash in detached mode during gateway startup, suppresses stdio, ignores child errors, and emits no user-visible logging. This creates a persistence-like execution path that is hard to audit and can silently run modified or unexpected code if SKILL_DIR, .skill-dir, or the script location is tampered with, especially since execution happens automatically on every startup.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The script unconditionally deletes any existing path at the managed hook destination with 'rm -rf' before reinstalling. Although comments describe the install flow, there is no confirmation prompt before the destructive action, which can replace or remove prior hook contents under the user's hooks directory.

Content

No source excerpt is available for this finding.

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.

Content

Scanner excerpt · logos/mac-finder/favicon-master.txt (reported line 1)May include surrounding context.

text
iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwABqodJREFUeAHsvQfAbVdVJ77WOffer72a917yXnpCaIEAioCKFAtNEETFgljQGVFnLKMo6owTLGMfpdiw4V8sYyyDDKIIAtJLAgQCJJBeX29fufXs9d9ltXO/F2xgwntnJ/fd+917zj67rt/qG6ArXelKV7rSla50pStd6UpXutKVrnSlK13pSle60pWudKUrXelKV7rSla50pStd6UpXutKVrnSlK13pSle60pWudKUrXelKV7rSla50pStd6UpXutKVrnSlK13pSle60pWudKUrXelKV7rSla50pStd6UpXutKVrnSlK13pSle60pWudKUrXelKV7rSla50pStd6UpXutKVrnSlK13pSle60pWudKUrXelKV7rSla50pStd6UpXutKVrnSlK13pSle60pWudKUrXelKV7rSla50pStd6UpXutKVrnSlK13pSle60pWudKUrXelKV7rSla50pStd6coZWRC6cr8vRIQv/bujWyc7zjp3HWYXr49wGaYQxjSbznDh2HAId1z/ul86fsMfvGQVutKVz7GS1/dLX1rnP1760vBTiAG68jlROgC5n5bvupr6kwPwsG0L4Zs2QvXlJ47RA9eGk+VxqHrTuL1m8TVuACbTuPsQZ1t29I9NAty0tR/eD1X1f2AI17/thXgcutKV+1GJYLEwBrhgdW3yBYPF6oshVHsD4d5IibYRAcbP0xk1axjwztksfGRpBd61s9f7WFzj3Vq+H5YOQO4fJc0DpQ/fS7Slft34RcfG8G0bw/qhywPqbR0A9GuEEP9bj7tvNCOYRPCYxtfGDGA4RRjG90kClYBxk2ISUPaftaN+/7ZB/dpja/C3H/kePAhd6cp9UCJoLEdm50uH4+nzJtR7/NpwdBFWvX5a8pRWfVz9oSFIYgex7NEEgib+SHGNz5rZ/pWlwQf2nLPw668AeHMnodx/Sgcg931R8Piuv529cHJw9qtrNe5YqAl2LgGcuxVgex+hrgDWxpRfk1kBjySJpPf099oM4fiE4HgEmGNjzAAzDBU08YLt2/vj/nL4i3pn/3999OvweuhKV/4DypjoYRvj8J0zwm9f3RjvRKwAqSz2Jr1HkCC+NuTPifkpoBLkPSQAClHiDnkt71xZ+ijU9Q89eG//zdCV+7x0AHI/Kc/5C3r5+rHR9+9aqujcFcLtiwAVYt5Ek6aAxvqUYBRfIUoZiUNLsxcFE4jbMkofFMEEYRTf1ycIaxOAE/GejWncyFOgWdQBxC05XVpceMMlD8SfeMdX48ehK135zBRlglKJIPDkI6Pmf6wOp0+sq6qfsSIkMAhIAbOkARlIkpSBGVTyei5fMsAUAEkgk8AlQH6n0ACOp1PYs2P55Q87b+mHsJNG7tPSAcj9oDziNfQDk6PTl+2L4HHJlgYX+8m+EUFgRHByklRUST2VuDDKHFneZAweg/Repb8R4u0RdGQ3RzBJdUR1VwKTtQgqG7OaprOAdS/qyc7qvXFha/ipG184eC90pSufgRKB43Fxvf3y0bXxEyJwQIKGWWiwyQxPBIXICCEWKSNJGMIIEQn6UJFAAksgouICkUYoqrPSK9DGcIhnnbXj57/4AVt+Arpyn5UOQO7j8pTX0rnv/Dh8bFtvtuP85QDb67SBqkj8E3BEm8cE2N7RQHzL3Fpi4eL+jJIHQC+9ZxBBWOhFW0l8LcfvFvqp9rJxI4Zku8nJaCvZiCqwYaoz/lZHfnDLroXf7T+5+rFbP68zUnblX1VU6ohE/9Ij49nL14fTZ/aqXrR/x2+iNTwxOxk4mPHJdo4MHmzjYFApVMiAhFjiQH6IPCjdEwEJIhMEa9EYOBqOR4952PkPf+A5izdB
...[truncated 28 chars]

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.

Content

Scanner excerpt · logos/original/favicon-master.txt (reported line 1)May include surrounding context.

text
iVBORw0KGgoAAAANSUhEUgAAAZAAAAGQCAYAAACAvzbMAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwACKUxJREFUeAHsvQmAbVlVHrz2PucOVfVevfm9nueGppntZpKpFQRRA/4iqDgxRIWYxgHUOKVDHJOYqGAcg0gSRelEgTCDgIgCgggCDfTc/brfWK9ezXc45+z977W+b59bGDSiQDf9zobqelV177lnXMP3rfUtkW51q1vd6la3utWtbnWrW93qVre61a1udatb3epWt7rVrW51q1vd6la3utWtbnWrW93qVre61a1udatb3epWt7rVrW51q1vd6la3utWtbnWrW93qVre61a1udatb3epWt7rVrW51q1vd6la3utWtbnWrW93qVre61a1udatb3epWt7rVrW51q1vd6la3utWtbnWrW93qVre61a1udatb3epWt7rVrW51q1vd6la3utWtbnWrW93qVre61a1udatb3epWt7rVrW51q1vd6la3utWtbnWrW93qVre61a1udatb3epWt7rVrW51q1vd6taX+3LSrXvtOvxDL9h73r75y6pmeJUP9YPcaH2fnza9Zlp5kbpq/HCr3y9Ojav6I75a+tif3hFu+rq3vGUi3erWvXhdd911/t9Nl/bIWnXhKDRXDAp3+biRA0WY9JoozXxZrI5H9S3DOP6MLB+9RV7/vqPOubhtE2q3onTrHl+dA7mXrRPXPfes3TvP/zq/vv7/FevLj662pnuKZlK4mC5VSM9MDOLqWuI0/bsepx8bielv1dxi1e/3D9e9wZ8Xc/5/b/zNbe/b/b73nd626e6h69aXcn3W/XbTt3/74kWHBlf5qX9KNd56/GRj/IByurHoJ5OyN63FNekr3dsSa73FpUr+IpRzsZpfWB+6yW1+x+K7ysr9oVz/xg+57j6+16zOgdyzq33Iln7yhefuWdj1025p+Tn1aH1nr+xJLHyUXinivYvpwZKQEo+mSQ+aOpD0cz0RN0kOZDoRP96MMf2YXImMXV/6cztP1j33Nud3vLz3+3/04W0PXedIuvXFXO39FVOmUVW3PKxZ8i/qb619/WQ0OWs43nBuPEr3bBVdXaXgJzh7tX016Sv9o0n3uSSHIunnkDyJd27ie7I1NydzC/MfKucWfrT3une+5+9+Xre+9KtzIPfcmj1ov/iDL43H114WJuN5v2NnlOGcSNlzMfkPCZWiVRahSUKuYvpZHyx97uzt+vdpetCq9PvxWGSUHs6tSfSjLf0ENy28uLm9H+sNer8if3Pja9zNN0/+7ud3q1tfgDW7n6992kCKC5+9NVp7saxtPXxQT4ti0sQ4WnVxOhUZpxQjjFMghNsvuhQUqe9okGHbpuxPwb47/VXUwCn9Nd346wsDkQsv/t1dp5vvc+95Ty3dvXyPrc6B3MOr+Xc/8AvV7bf9m8HOxRh27xPXU/+QnpiUVcTkENw4RWnJQbgEV0kV8EwV6WlLL5SiEFekAK6X/u0LQAAKb42n4jbS69c2o4zX06c41xTp245dN5e7dvyc/O3tf+BuuGHKXegevm79c9ZnO47hhd8e1qsfr8dbl/XraUKkkn0frUXZ2HKymYKamO7nKkU2mm3QYaQUA1sJ6iRSwJN+Ey37KLBpy0wafFrKTlw9jevDOdfc78J37B6c+AZ3fXsvd+tLvDoHcg+uyQ98zzPlyK3/q9dPsdje/U78MDmO5DTWU5KwvpocQWU8h6uiPWxRIzb9SkCVS5lF9OlhKguJc+l9w+RE+ilz6Rf2d33+ZJI4kvTQOv0abaVnMrhm0JNm1/5bBrvmXuL+4P+8nrvSOZFufb5r5jie9axCLlz4lmp942djU1zck2GUKt1743XnVtdEtjaSE1FnoplGtEzDsg/l9RJUZT4iwbMpzDHXkdJv/D792ylsm16n
...[truncated 28 chars]

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The install section explicitly says the hook directory is copied into ~/.openclaw/hooks and that symlinks are not used. The uninstall line then says it removes the symlink, which contradicts the documented install behavior and could mislead users about what artifact is actually removed.

Content

No source excerpt is available for this finding.