The vulnerability is a path traversal issue within the skill installation feature of OpenClaw. The root cause lies in the resolveDownloadTargetDir function in src/agents/skills-install.ts. This function was responsible for determining the destination directory for downloaded skill assets. It directly used the targetDir value from a skill's metadata, resolving it with resolveUserPath without proper sanitization or validation. This allowed a malicious actor to craft a skill with a targetDir like ../../../../tmp/pwned to write files outside the intended sandboxed tools directory.
The patch addresses this by refactoring the download logic into a new file, src/agents/skills-install-download.ts. The new implementation of resolveDownloadTargetDir now establishes a safe root directory for the skill and uses a new isWithinDir utility function to ensure that the resolved targetDir is strictly confined within this safe root. If the path falls outside, the installation is aborted. The function installDownloadSpec was the consumer of the insecure path and was also moved and now benefits from the new, secure path resolution. The main entry point, installSkill, remains the primary function that would be seen in a runtime profile during exploitation.