CVE-2026-35641
OpenClaw < 2026.3.24 - Arbitrary Code Execution via .npmrc in Local Plugin/Hook Installation
OpenClaw before 2026.3.24 contains an arbitrary code execution vulnerability in local plugin and hook installation that allows attackers to execute malicious code by crafting a .npmrc file with a git executable override. During npm install execution in the staged package directory, attackers can leverage git dependencies to trigger execution of arbitrary programs specified in the attacker-controlled .npmrc configuration file.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Active
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
8.4
OpenClaw < 2026.3.24 - Arbitrary Code Execution via .npmrc in Local Plugin/Hook Installation
OpenClaw before 2026.3.24 contains an arbitrary code execution vulnerability in local plugin and hook installation that allows attackers to execute malicious code by crafting a .npmrc file with a git executable override. During npm install execution in the staged package directory, attackers can leverage git dependencies to trigger execution of arbitrary programs specified in the attacker-controlled .npmrc configuration file.
- Record
CVE-2026-35641- CVSS 4.0
- 8.4 High
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-349
- Updated
- 2026-11-02
EUVDEUVD-2026-21436
8.4
OpenClaw before 2026.3.24 contains an arbitrary code execution vulnerability in local plugin and hook installation that allows attackers to execute malicious code by crafting a .npmrc file with a git executable override. During npm install execution in the staged package directory, attackers can leverage git dependencies to trigger execution of arbitrary programs specified in the attacker-controlled .npmrc configuration file.
- Record
EUVD-2026-21436- CVSS 4.0
- 8.4 High
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-m3mh-3mpg-37hw
8.4
OpenClaw has an Arbitrary Malicious Code Execution Vulnerability
Fixed in OpenClaw 2026.3.24, the current shipping release.
Summary
During the installation phase of OpenClaw local plugins/hooks, the Git executable can be hijacked by a project-level .npmrc file, leading to arbitrary code execution during installation.
Details
Please note that the source code locations mentioned below are based on version openclaw-2026.3.13-1, but the issue has been confirmed to still exist in the current latest version, 2026.3.23.
When installing a local plugin directory, local plugin archive, local hook pack directory, or local hook pack archive, OpenClaw first copies the source directory to a temporary stageDir, then executes the following in that directory:
npm install --omit=dev --silent --ignore-scripts
See src/infra/install-package-dir.ts:176-199.
Since this process does not strip the project root .npmrc, and npm reads the project-level .npmrc during local project installation, an attacker could use a .npmrc file in a malicious plugin or hook directory to override npm’s git executable path. By leveraging a Git dependency, the attacker could trigger npm to call this malicious program, thereby executing arbitrary local code during the installation phase.
Affected Paths
- Plugin CLI entry point:
src/cli/plugins-cli.ts:199-255 - Hook CLI entry point:
src/cli/hooks-cli.ts:573-676 - Plugin local directory / archive installation:
src/plugins/install.ts:379-405,src/plugins/install.ts:541-565 - Hook local directory / archive installation:
src/hooks/install.ts:380-403,src/hooks/install.ts:443-470 - Actual execution of
npm install --ignore-scripts:src/infra/install-package-dir.ts:176-199
Vulnerability Trigger Flow
-
The user executes one of the following commands:
openclaw plugins install <path-or-spec>openclaw hooks install <path-or-spec>
-
If the argument is a local directory or local archive, OpenClaw navigates to the local installation path.
-
OpenClaw copies the source directory to a temporary
stageDir. Seesrc/infra/install-package-dir.ts:176-177. -
If
dependenciesare present inpackage.json, OpenClaw executes the following instageDir:
npm install --omit=dev --silent --ignore-scripts
See src/infra/install-package-dir.ts:188-199.
- npm reads the project-level
.npmrcfile in this directory. Official documentation:.npmrc - If
.npmrcis set togit=<path to malicious program>and there is a git dependency in the dependency tree, npm will invoke thatgitprogram when resolving the dependency. Official documentation:npm config gitGit dependency documentation:package.json - Consequently, an attacker can execute arbitrary local programs during the plugin/hook installation phase without waiting for the plugin or hook to be loaded later.
Triggering Commands
- Plugin installation command:
openclaw plugins install <path-or-spec>
- Hook installation command:
openclaw hooks install <path-or-spec>
When <path-or-spec> is a local directory or local archive, it will be resolved to the path used by the npm install --omit=dev --silent --ignore-scripts command mentioned above.
PoC
Currently, testpoc/ is a minimal PoC directory used to verify that “when installing local packages, OpenClaw enters the npm install --ignore-scripts path.” It is divided into two core sections:
testpoc/pkg/
Purpose: Simulates the local package directory installed by openclaw plugins install ... or openclaw hooks install ...
testpoc/repo/
Purpose: Simulates a Git dependency repository within the npm dependency tree
Directory Structure
testpoc/ ├─ pkg/ │ ├─ .npmrc │ ├─ package.json │ └─ sample-hook/ │ ├─ HOOK.md │ └─ handler.js └─ repo/ ├─…
- Record
GHSA-m3mh-3mpg-37hw- CVSS 4.0
- 8.4 High
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - CVSS 3.1
- 8.6 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H - Weakness
- CWE-349, CWE-426
- Updated
- 2026-11-02
NVD
8.4
OpenClaw before 2026.3.24 contains an arbitrary code execution vulnerability in local plugin and hook installation that allows attackers to execute malicious code by crafting a .npmrc file with a git executable override. During npm install execution in the staged package directory, attackers can leverage git dependencies to trigger execution of arbitrary programs specified in the attacker-controlled .npmrc configuration file.
- Record
CVE-2026-35641- CVSS 4.0
- 8.4 High
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-349
- Updated
- 2026-11-02
OSV
8.4
OpenClaw < 2026.3.24 - Arbitrary Code Execution via .npmrc in Local Plugin/Hook Installation
OpenClaw before 2026.3.24 contains an arbitrary code execution vulnerability in local plugin and hook installation that allows attackers to execute malicious code by crafting a .npmrc file with a git executable override. During npm install execution in the staged package directory, attackers can leverage git dependencies to trigger execution of arbitrary programs specified in the attacker-controlled .npmrc configuration file.
- Record
CVE-2026-35641- CVSS 4.0
- 8.4 High
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - Weakness
- CWE-349
- Updated
- 2026-11-02
OSVGHSA-m3mh-3mpg-37hw
8.4
OpenClaw has an Arbitrary Malicious Code Execution Vulnerability
Fixed in OpenClaw 2026.3.24, the current shipping release.
Summary
During the installation phase of OpenClaw local plugins/hooks, the Git executable can be hijacked by a project-level .npmrc file, leading to arbitrary code execution during installation.
Details
Please note that the source code locations mentioned below are based on version openclaw-2026.3.13-1, but the issue has been confirmed to still exist in the current latest version, 2026.3.23.
When installing a local plugin directory, local plugin archive, local hook pack directory, or local hook pack archive, OpenClaw first copies the source directory to a temporary stageDir, then executes the following in that directory:
npm install --omit=dev --silent --ignore-scripts
See src/infra/install-package-dir.ts:176-199.
Since this process does not strip the project root .npmrc, and npm reads the project-level .npmrc during local project installation, an attacker could use a .npmrc file in a malicious plugin or hook directory to override npm’s git executable path. By leveraging a Git dependency, the attacker could trigger npm to call this malicious program, thereby executing arbitrary local code during the installation phase.
Affected Paths
- Plugin CLI entry point:
src/cli/plugins-cli.ts:199-255 - Hook CLI entry point:
src/cli/hooks-cli.ts:573-676 - Plugin local directory / archive installation:
src/plugins/install.ts:379-405,src/plugins/install.ts:541-565 - Hook local directory / archive installation:
src/hooks/install.ts:380-403,src/hooks/install.ts:443-470 - Actual execution of
npm install --ignore-scripts:src/infra/install-package-dir.ts:176-199
Vulnerability Trigger Flow
-
The user executes one of the following commands:
openclaw plugins install <path-or-spec>openclaw hooks install <path-or-spec>
-
If the argument is a local directory or local archive, OpenClaw navigates to the local installation path.
-
OpenClaw copies the source directory to a temporary
stageDir. Seesrc/infra/install-package-dir.ts:176-177. -
If
dependenciesare present inpackage.json, OpenClaw executes the following instageDir:
npm install --omit=dev --silent --ignore-scripts
See src/infra/install-package-dir.ts:188-199.
- npm reads the project-level
.npmrcfile in this directory. Official documentation:.npmrc - If
.npmrcis set togit=<path to malicious program>and there is a git dependency in the dependency tree, npm will invoke thatgitprogram when resolving the dependency. Official documentation:npm config gitGit dependency documentation:package.json - Consequently, an attacker can execute arbitrary local programs during the plugin/hook installation phase without waiting for the plugin or hook to be loaded later.
Triggering Commands
- Plugin installation command:
openclaw plugins install <path-or-spec>
- Hook installation command:
openclaw hooks install <path-or-spec>
When <path-or-spec> is a local directory or local archive, it will be resolved to the path used by the npm install --omit=dev --silent --ignore-scripts command mentioned above.
PoC
Currently, testpoc/ is a minimal PoC directory used to verify that “when installing local packages, OpenClaw enters the npm install --ignore-scripts path.” It is divided into two core sections:
testpoc/pkg/
Purpose: Simulates the local package directory installed by openclaw plugins install ... or openclaw hooks install ...
testpoc/repo/
Purpose: Simulates a Git dependency repository within the npm dependency tree
Directory Structure
testpoc/ ├─ pkg/ │ ├─ .npmrc │ ├─ package.json │ └─ sample-hook/ │ ├─ HOOK.md │ └─ handler.js └─ repo/ ├─…
- Record
GHSA-m3mh-3mpg-37hw- CVSS 4.0
- 8.4 High
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N - CVSS 3.1
- 8.6 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H - Weakness
- CWE-349, CWE-426
- Updated
- 2026-11-02
Affected products
Affected packages
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-35641 is a high vulnerability (CVSS 8.4) in Openclaw, published March 30, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.14%, the 3rd percentile. Fixed in openclaw 2026.3.24.
References
github.com/openclaw/openclaw/security/advisories/GHSA-m3mh-3mpg-37hw
vulncheck.com/advisories/openclaw-arbitrary-code-execution-via-npmrc-in-local-plugin-hook-installation
nvd.nist.gov/vuln/detail/CVE-2026-35641
github.com/advisories/GHSA-m3mh-3mpg-37hw
github.com/CVEProject/cvelistV5/tree/main/cves/2026/35xxx/CVE-2026-35641.json
github.com/openclaw/openclaw
Left out here: the rest of 2 source descriptions. The JSON record has them.