other
- Location
scripts/clawhub_helper.sh:13- Finding
Unrestricted Local Directory Publication Can Disclose Sensitive Data
- Content
View full analysis
Vulnerability Details
File Location:
scripts/clawhub_helper.sh:13-19
Vulnerability Type: Unintended data disclosure through insufficient path validation
Risk Level: MediumVulnerable Code
bash PATH_SKILL=$2 VERSION=$3 CHANGELOG=$4 SLUG=$(basename "$PATH_SKILL") echo "Publishing $SLUG@$VERSION..." clawhub publish "$PATH_SKILL" --slug "$SLUG" --name "$SLUG" --version "$VERSION" --changelog "$CHANGELOG"The related publication policy in
SKILL.md:15-26states that custom skills must be stored under~/.openclaw/skills/, use themy_prefix, and be uploaded after local changes. The helper does not enforce those restrictions.Technical Analysis
The
publishoperation accepts an arbitrary caller-controlled filesystem path and passes it directly toclawhub publish. It only derives the publication slug from the path's basename. It does not:- Canonicalize the supplied path.
- Verify that the path is under
~/.openclaw/skills/. - Require the basename to start with
my_. - Reject symbolic links or path traversal outside the approved directory.
- Review the publication manifest for credentials or other sensitive files.
- Obtain explicit confirmation before transferring directory contents externally.
Shell command injection is not present in this segment because variable expansions used as command arguments are quoted. The vulnerability is instead the absence of semantic validation on which directory may be published.
Attack Path
- A user, automated agent, or misleading instruction invokes:
bash bash scripts/clawhub_helper.sh publish /path/to/sensitive-directory 1.0.0 "backup" - The script accepts the directory without confirming that it is an approved custom-skill directory.
basenamesupplies a plausible publication slug but provides no security boundary.- The complete selected directory is ...[truncated 886 chars]
- Remediation
View remediation
Remediation Suggestions
- Canonicalize the requested directory with
realpathand reject it unless it is a direct child of the canonical~/.openclaw/skills/directory. - Require the canonical directory basename to match a restrictive pattern such as
my_[A-Za-z0-9_-]+. - Reject symbolic-link skill directories and define whether symbolic links within a skill are permitted.
- Generate and display the exact publication manifest before upload.
- Scan the manifest for secrets, private keys, environment files, and other sensitive content.
- Require explicit user confirmation before an external upload, particularly when publication visibility is public or unknown.
- Clearly document ClawHub visibility, retention, and deletion behavior.
- Fail closed when path validation or secret scanning cannot be completed.
- Canonicalize the requested directory with
