/

CVE-2026-28393

Severity:

HIGH RISK

(7.7)

Insecure Module Loading / Untrusted Search Path

CVE-2026-28393

Modified

Vulnerability type

Category:

Insecure Module Loading / Untrusted Search Path

CWE:

CWE-22

Impact:

Arbitrary Code Execution with Gateway Process Privileges

Severity:

HIGH RISK

(7.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenClaw hook transform loading accepts absolute and traversal-based module paths from configuration, allowing arbitrary JavaScript modules to be loaded.

If an attacker can modify the hooks configuration, they can force OpenClaw to execute malicious code with gateway process privileges.

Affected context

This vulnerability affects OpenClaw deployments using hook transforms where:

  • The hooks.mappings[].transform.module parameter is configurable at runtime or via files/remote configuration stores
  • Module paths are taken directly from configuration and resolved on the filesystem
  • The gateway process has access to load JavaScript modules from attacker-controllable locations

Risk is elevated in environments where configuration files, environment-based configuration, or remote config services can be modified by less-trusted users or processes.

Exploit preconditions

  • Attack surface: Configuration layer (files, environment variables, or centralized config systems feeding OpenClaw).
  • Required access: Ability to write or influence hooks.mappings[].transform.module values (e.g., modify config files, config database entries, or management UI settings).
  • Trigger point: The moment the gateway initializes or reloads hooks and attempts to load the specified transform module.
  • Why exploitation is possible: The loader:
  • Accepts absolute paths and .. traversal sequences in transform.module
  • Does not constrain module locations to a trusted directory or whitelist
  • Executes the loaded JavaScript with the privileges of the gateway process.

Why this happens

The core issue is an insecure module loading design where configuration-supplied paths are treated as trusted code locations.

This maps to CWE-427: Uncontrolled Search Path Element, because the system allows external configuration to influence which code is loaded and executed, without enforcing a safe, fixed search path.

The presence of traversal support (.. segments and absolute paths) also reflects CWE-22: Path Traversal, enabling attackers to reference arbitrary files on the filesystem.

Conceptually, the bug class is:

  • Treating configuration as trusted code selectors
  • Allowing fully dynamic filesystem paths for executable modules
  • Failing to restrict module resolution to a vetted, application-controlled directory or identifier-based registry.

Potential impact

  • Execution of arbitrary JavaScript code with gateway process privileges
  • Full compromise of the gateway application, including data handled by hooks
  • Modification, interception, or exfiltration of traffic processed by OpenClaw hooks
  • Lateral movement within the host environment or internal network, depending on gateway permissions
  • Tampering with logging, audit trails, or security controls implemented as transforms

General mitigation guidance

Effective mitigation centers on constraining where executable modules may come from and reducing trust in configuration-controlled paths:

  • Restrict transform modules to a fixed, application-controlled directory or a registry of allowed module identifiers rather than arbitrary filesystem paths.
  • Normalize and validate any path input, explicitly rejecting absolute paths, traversal sequences (..), and symlink-based escapes from trusted directories.
  • Use a logical module name or ID in configuration and map it internally to vetted module files or packages.
  • Run the gateway process with least privilege, limiting filesystem write access and external network capabilities to reduce the blast radius of code execution.
  • Treat configuration as untrusted input: apply strict schema validation, type checking, and allowed-value lists for module-selection fields.
  • Consider separate trust domains for configuration management, ensuring only highly trusted roles or services can modify hook module settings.

How teams detect issues like this

Detection generally relies on a combination of code analysis and configuration review:

  • Static code analysis: Search for dynamic require()/import patterns or custom loaders that take module paths directly from configuration and pass them into filesystem or module-loader APIs without restriction.
  • Code review signals:
  • Any use of user or config-supplied strings to construct module paths
  • Acceptance of absolute paths or .. segments in config parameters controlling code or plugin loading
  • Lack of explicit whitelisting or directory constraints in module resolution logic
  • Configuration audits: Periodically scan configuration sources (files, config services, environment) for transform module entries that:
  • Use absolute paths
  • Contain traversal (../) or unexpected directories
  • Policy enforcement: Apply CI/CD or configuration validation hooks that reject deployments where module fields are outside a known-safe set of identifiers or directories.
  • Automated security review tools can be configured to flag dynamic module loading and filesystem access patterns driven by configuration values.

Sources

SourceLink
github.comgithub.com/openclaw/openclaw/commit/18e8bd68c5015a894f999c6d5e6e32468965bfb5
github.comgithub.com/openclaw/openclaw/commit/a0361b8ba959e8506dc79d638b6e6a00d12887e4
github.comgithub.com/openclaw/openclaw/security/advisories/GHSA-7xhj-55q9-pc3m
vulncheck.comvulncheck.com/advisories/openclaw-beta-arbitrary-javascript-module-loading-via-hook-transform-path-traversal

Frequently asked

questions

It can be, if remote users or services can modify OpenClaw configuration (for example via an admin API, management UI, or misconfigured config store). Otherwise, it typically requires local or internal access to configuration sources.

The attacker must be able to alter the hooks.mappings[].transform.module configuration values. This might involve write access to configuration files, a configuration database, environment variables, or any management interface that controls hook mappings.

Replace arbitrary path-based module selection with an identifier-based system that maps configuration keys to a vetted set of modules in a fixed directory or registry. Enforce strict validation so configuration cannot specify absolute paths or traversal sequences.

Treat configuration as untrusted input when it influences code loading or execution. Design extension and plugin systems around whitelisted identifiers, enforce strict path constraints, perform security-focused code reviews for dynamic loading logic, and add automated checks to ensure new configuration fields cannot select arbitrary executable code.

Find out what's already
exploitable in your codebase.