The vulnerability is a path traversal weakness in OpenClaw's webhook transform module loading mechanism. The root cause lies in the resolveContainedPath function within src/gateway/hooks-mapping.ts, which failed to properly sanitize user-provided paths. Specifically, the function only performed lexical checks and did not resolve symbolic links before validation.
The exported function resolveHookMappings uses resolveContainedPath to validate paths specified in the hook configuration, such as the transformsDir and individual transform module paths. An attacker with privileges to create symlinks on the server's filesystem and influence the OpenClaw configuration could create a symlink within the expected transform directory that points to a malicious script located elsewhere on the system.
When resolveHookMappings processes this malicious configuration, the call to the vulnerable resolveContainedPath function would succeed because the initial, unresolved path appears to be legitimate. Subsequently, when the application attempts to load the transform module, it follows the symlink and executes the attacker's code with the full permissions of the OpenClaw gateway process.
The patch remediates this by modifying resolveContainedPath to use fs.realpathSync. This ensures that the canonical path, with all symlinks resolved, is checked for containment within the trusted base directory, effectively closing the path traversal loophole.