Wysoka

OpenClaw has Sandbox Media Root Bypass via Unnormalized `mediaUrl` / `fileUrl` Parameter Keys (CWE-22)

  • Ujawniono: 30.03.2026
  • Aktualizacja: 11.10.2026 10:22

Fixed in OpenClaw 2026.3.24, the current shipping release.

Advisory Details

Title: Sandbox Media Root Bypass via Unnormalized mediaUrl / fileUrl Parameter Keys (CWE-22)

Description:

Summary

A path traversal vulnerability in the agent sandbox enforcement allows a sandboxed agent to read arbitrary files from other agents' workspaces by using the mediaUrl or fileUrl parameter key in message tool calls. The normalizeSandboxMediaParams function only checks ["media", "path", "filePath"] keys, while mediaUrl and fileUrl escape normalization entirely. Combined with handlePluginAction dropping mediaLocalRoots from the dispatch context, this enables a full sandbox escape where any agent can read files outside its designated sandbox root.

Details

The vulnerability exists in two files within the messaging pipeline:

1. Incomplete parameter key coverage in normalizeSandboxMediaParams:

In src/infra/outbound/message-action-params.ts, the function iterates over a hardcoded allowlist of parameter keys to validate:

ts
// Line 212
const mediaKeys: Array<"media" | "path" | "filePath"> = ["media", "path", "filePath"];

The mediaUrl and fileUrl parameter keys are not included in this array. These keys are actively used by multiple channel extensions (Discord, Telegram, Slack, Matrix, Twitch) for media attachment handling, but they completely bypass the sandbox path validation performed by resolveSandboxedMediaSource.

2. Dropped mediaLocalRoots in handlePluginAction:

In src/infra/outbound/message-action-runner.ts, the handlePluginAction function dispatches actions to channel plugins but omits mediaLocalRoots from the context:

ts
// Lines 684-697
const handled = await dispatchChannelMessageAction({
    channel,
    action,
    cfg,
    params,
    accountId: accountId ?? undefined,
    requesterSenderId: input.requesterSenderId ?? undefined,
    sessionKey: input.sessionKey,
    sessionId: input.sessionId,
    agentId,
    gateway,
    toolContext: input.toolContext,
    dryRun,
    // mediaLocalRoots is MISSING here
});

Despite ChannelMessageActionContext defining mediaLocalRoots?: readonly string[] (in src/channels/plugins/types.core.ts line 478), plugins receive undefined and fall back to getDefaultMediaLocalRoots(), which permits reads of the entire ~/.openclaw/ directory tree — including all agents' workspaces.

Attack chain:

  1. A sandboxed agent (Agent-A at ~/.openclaw/workspace/agent-a/) calls the message tool with { mediaUrl: "~/.openclaw/workspace/agent-b/secret.txt" }
  2. normalizeSandboxMediaParams skips the mediaUrl key (not in allowlist)
  3. handlePluginAction dispatches without mediaLocalRoots
  4. Plugin calls loadWebMedia with default roots, which allows ~/.openclaw/workspace/**
  5. Agent-B's secret file content is read and sent as a channel attachment

PoC

Prerequisites:

  • Docker installed
  • OpenClaw Docker image built (openclaw-gateway:latest)

Steps:

  1. Start the vulnerable gateway container:
bash
cd llm-enhance/cve-finding/Path_Traversal/CVE-2026-27522-Media_Root_Bypass-variant-exp/
docker compose up -d
sleep 5
  1. Run the exploit:
bash
python3 poc_exploit.py
  1. The exploit writes a secret file to ~/.openclaw/workspace/agent-b/secret_key.txt inside the container, then invokes normalizeSandboxMediaParams with Agent-A's sandbox policy and { mediaUrl: <agent-b-secret-path> }. The mediaUrl key bypasses normalization, and loadWebMedia reads the file successfully.

  2. Run the control experiment to confirm sandbox works for checked keys:

bash
python3 control-sandbox_enforced.py

Log of Evidence

Exploit output:

=== CVE-2026-27522 Variant: Sandbox Media Root Bypass ===

[*] Container 'openclaw-media-bypass-test' is running
[*] Running exploit script with Bun...

[VULNERABLE] mediaUrl bypassed normalizeSandboxMediaParams!
  Agent-A sandboxRoot: /root/.openclaw/workspace/agent-a
  mediaUrl targets Agent-B: /root/.openclaw/workspace/agent-b/secret_key.txt
  args after normalization: {"mediaUrl":"/root/.openclaw/workspace/agent-b/secret_key.txt"}
[EXPLOITED] Agent-B secret file content: AGENT-B-SECRET-API-KEY-sk-12345abcdef

=== EXPLOIT SUCCESSFUL ===
Agent-A read Agent-B's secret file via mediaUrl, bypassing sandbox.

[+] RESULT: VULNERABLE — mediaUrl bypasses sandbox enforcement

Control experiment output:

=== Control Experiment: Sandbox Enforcement for 'media' Key ===

[*] Container 'openclaw-media-bypass-test' is running
[*] Running control script with Bun...

[SAFE] normalizeSandboxMediaParams blocked 'media' key as expected!
  Error: Path escapes sandbox root (/tmp/sandbox-ZKvGQX): /tmp/victim-2cuAOO/secret.txt

=== CONTROL EXPERIMENT PASSED ===
The 'media' parameter IS correctly checked by sandbox enforcement.
Only unchecked keys (mediaUrl, fileUrl) bypass the sandbox.

[+] CONTROL PASSED: 'media' key is correctly enforced by sandbox

Impact

This is a sandbox escape vulnerability. An attacker who can influence an agent's tool calls (via prompt injection, multi-agent interaction, or malicious plugin instruction) can read arbitrary files from other agents' workspaces. This includes:

  • API keys and secrets stored in other agents' sandboxes
  • Session data and conversation logs
  • Configuration files with sensitive credentials
  • Any file within the ~/.openclaw/ directory tree

This completely defeats the purpose of the multi-agent sandbox isolation feature, which is documented as a security boundary in the project's Docker and sandboxing documentation.

Affected products

  • Ecosystem: npm
  • Package name: openclaw
  • Affected versions: <= 2026.3.14 (current latest)
  • Patched versions: <None>

Severity

  • Severity: High
  • Vector string: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N

Weaknesses

  • CWE: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Occurrences

Permalink Description
https://github.com/moltbot/moltbot/blob/main/src/infra/outbound/message-action-params.ts#L206-L227 The normalizeSandboxMediaParams function with incomplete mediaKeys allowlist — mediaUrl and fileUrl are not checked.
https://github.com/moltbot/moltbot/blob/main/src/infra/outbound/message-action-runner.ts#L684-L697 The handlePluginAction dispatch call that omits mediaLocalRoots from the context passed to dispatchChannelMessageAction.
https://github.com/moltbot/moltbot/blob/main/src/channels/plugins/types.core.ts#L478 The ChannelMessageActionContext type that defines mediaLocalRoots but never receives it from handlePluginAction.

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Paczka npm openclaw < 2026.3.24 2026.3.24

Odnośniki

Ocena CVSS 7.7/10
Wektor CVSS
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
Słabość (CWE)
CWE-22
Platforma
npm
Paczka
openclaw
Ujawniono
30.03.2026
Aktualizacja
11.10.2026 10:22

Źródła i licencje

OSV / GitHub Advisory Database - GHSA-hr5v-j9h9-xjhg - CC BY 4.0

Historia podatności: openclaw

Wszystkie opisane podatności tej paczki (Paczka npm), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkie (588) w archiwum
Wszystkich wpisów
588
Pierwsza → ostatnia
02.2026 07.2026
Bez poprawki
9
Wykorzystywana w atakach
0

Rozkład istotności

  • Krytyczna 20
  • Wysoka 215
  • Średnia 299
  • Niska 54

Ujawnienia w latach

  1. 2026: 588
Istotność:
  1. OpenClaw has Sandbox Media Root Bypass via Unnormalized `mediaUrl` / `fileUrl` Parameter Keys (CWE-22) ten wpis
    Wysoka · 7.7 CVE-2026-35668 < 2026.3.24 2026.3.24
  2. Wysoka · 8.8 CVE-2026-53836 < 2026.5.12 2026.5.12
  3. Wysoka · 8.8 CVE-2026-53811 < 2026.5.7 2026.5.7
  4. Wysoka · 8.8 CVE-2026-53806 < 2026.5.12 2026.5.12
  5. Wysoka · 7.8 CVE-2026-53813 < 2026.4.25 2026.4.25
  6. Wysoka · 7.5 CVE-2026-53834 < 2026.4.27 2026.4.27
  7. Wysoka · 8.3 CVE-2026-32905 < 2026.5.4 2026.5.4
  8. Krytyczna CVE-2026-34507 < 2026.4.29 2026.4.29
  9. Wysoka CVE-2026-53823 < 2026.5.3 2026.5.3
  10. Wysoka · 8.4 CVE-2026-53814 < 2026.5.20 2026.5.20
  11. Wysoka · 8.0 CVE-2026-53817 < 2026.5.22 2026.5.22
  12. Wysoka · 6.5 CVE-2026-53815 < 2026.5.19 2026.5.19
  13. Wysoka · 8.1 CVE-2026-53849 < 2026.5.7 2026.5.7
  14. Wysoka · 7.1 CVE-2026-53853 < 2026.5.12 2026.5.12
  15. Wysoka · 8.1 CVE-2026-53857 < 2026.5.3 2026.5.3
  16. Wysoka · 8.1 CVE-2026-53855 < 2026.4.2 2026.4.2
  17. Wysoka · 8.1 CVE-2026-53866 < 2026.5.12 2026.5.12
  18. Wysoka · 8.1 CVE-2026-53864 < 2026.5.26 2026.5.26
  19. Wysoka · 7.8 CVE-2026-44114 < 2026.4.20 2026.4.20
  20. Krytyczna · 9.8 CVE-2026-44109 < 2026.4.15 2026.4.15
  21. Krytyczna · 8.1 CVE-2026-43585 < 2026.4.15 2026.4.15
  22. Wysoka · 8.8 CVE-2026-43530 >= 2026.2.23, < 2026.4.12 2026.4.12
  23. Wysoka · 8.8 CVE-2026-42434 >= 2026.4.5, < 2026.4.10 2026.4.10
  24. Wysoka · 7.5 CVE-2026-42437 >= 2026.4.9, < 2026.4.10 2026.4.10
  25. Wysoka CVE-2026-41393 < 2026.3.31 2026.3.31
  26. Krytyczna · 8.2 CVE-2026-41296 < 2026.3.31 2026.3.31
  27. Wysoka · 8.8 CVE-2026-41352 < 2026.3.31 2026.3.31
  28. Wysoka · 7.8 CVE-2026-41396 < 2026.3.31 2026.3.31
Pokaż więcej (20) Widać 81 z 235

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.