NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · OpenClaw

GHSA-jccr-rrw2-vc8h: OpenClaw safeBins jq `$ENV` filter bypass allows environment variable disclosure

highCVSS 3.1 7.7

OpenClaw up to 2026.3.24 lets a jq command run under the safeBins policy read environment variables through the $ENV variable. The policy blocked the env builtin but not $ENV, so API keys and other secrets in the environment could leak. Fixed in 2026.3.28.

Published Mar 31, 2026 · Updated Apr 8, 2026 · Analysis Oct 31, 2026

What an attacker can do

OpenClaw's safe-bin policy lets operators pre-approve commands such as jq, with argument rules meant to keep them harmless. The jq rule in src/infra/exec-safe-bin-semantics.ts rejected the env builtin (env, env.FOO, .foo | env). jq also exposes the same data as the $ENV variable, which the rule did not match. A program like ($ENV).OPENAI_API_KEY passed the check and printed the secret.

The attacker needs the agent to run an approved jq call, which a prompt-injected model or a low-privilege user can request. No extra approval prompt appears because jq is already trusted. The command prints the process environment, which commonly holds model API keys, cloud credentials and tokens. The attacker then reads those from the command output or the chat. The flaw gives secret disclosure only, but the scope is changed in the CVSS vector because those secrets open other systems.

Who is affected

npm package openclaw, versions up to and including 2026.3.24, on setups where jq is allowed as a safe bin. No CVE id is assigned in the data for this advisory. Check the version:

npm ls openclaw

Then look at your exec approvals config for jq in the safe-bin list.

openclaw

Ecosystem
npm
Affected
<= 2026.3.24
Fixed in
2026.3.28
Check
npm ls openclaw

How to fix it

Upgrade to openclaw 2026.3.28 or later:

npm install [email protected]

Commit 78e2f3d66d adds a JQ_ENV_VARIABLE_PATTERN that matches $ENV, so jq arguments using it, including ($ENV).OPENAI_API_KEY, are rejected. If you cannot upgrade, remove jq from the safe-bin list. Rotate any secrets that live in the agent's environment if you suspect abuse.

How to tell if you were hit

Search recorded agent commands for jq invocations containing $ENV or env. Review chat output for strings that look like API keys. The advisory gives no log signature. Beam records shell commands an agent runs, and its rules can flag commands that read environment data, which helps find such jq calls.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

The jq safe-bin policy blocked explicit env usage but still allowed jq programs that accessed environment data through $ENV.

Impact

An operator-approved safe-bin jq command could disclose environment variables that the safe-bin policy was supposed to keep out of scope.

Affected Component

src/infra/exec-safe-bin-semantics.ts

Fixed Versions

  • Affected: <= 2026.3.24
  • Patched: >= 2026.3.28
  • Latest stable 2026.3.28 contains the fix.

Fix

Fixed by commit 78e2f3d66d (Exec: tighten jq safe-bin env checks).

Thanks @nicky-cc of Tencent zhuque Lab (https://github.com/Tencent/AI-Infra-Guard) for reporting.

Credited to nicky-cc.

Questions

Does this advisory have a CVE id?

Not in the data we hold. It is tracked as GHSA-jccr-rrw2-vc8h.

What can an attacker read with the jq $ENV bypass?

The environment variables of the OpenClaw process, such as API keys and tokens. Files and code execution are not part of this flaw.

Which version fixes it?

openclaw 2026.3.28. Versions up to and including 2026.3.24 are affected.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More OpenClaw vulnerabilities

All OpenClaw entries