Średnia

OpenClaw has incomplete Fix for CVE-2026-27486: Unvalidated SIGKILL in `!stop` Chat Command via `shell-utils.ts`

  • Ujawniono: 30.03.2026
  • Aktualizacja: 11.10.2026 10:22

Fixed in OpenClaw 2026.3.24, the current shipping release.

Advisory Details

Title: Incomplete Fix for CVE-2026-27486: Unvalidated SIGKILL in !stop Chat Command via shell-utils.ts

Description:

Summary

The !stop (and /bash stop) chat command kills background bash processes using SIGKILL directly, without first sending SIGTERM to allow graceful shutdown. This is because bash-command.ts imports killProcessTree() from src/agents/shell-utils.ts, which still contains the pre-CVE-2026-27486 aggressive kill logic, rather than from the patched src/process/kill-tree.ts.

Details

CVE-2026-27486 fixed unsafe process termination by introducing a graceful shutdown sequence in src/process/kill-tree.ts — sending SIGTERM first, waiting a configurable grace period (default 3 seconds), then escalating to SIGKILL only if the process is still alive.

However, an identical copy of the unpatched killProcessTree function remains in src/agents/shell-utils.ts (lines 170–192). This function sends SIGKILL immediately with no SIGTERM:

ts
// src/agents/shell-utils.ts:170-192
export function killProcessTree(pid: number): void {
  // ... Windows handling ...
  try {
    process.kill(-pid, "SIGKILL"); // Immediate hard kill, no SIGTERM
  } catch {
    try {
      process.kill(pid, "SIGKILL");
    } catch {
      // process already dead
    }
  }
}

The !stop chat command handler in src/auto-reply/reply/bash-command.ts imports and calls this vulnerable version at line 302:

ts
// src/auto-reply/reply/bash-command.ts:5
import { killProcessTree } from "../../agents/shell-utils.js";

// src/auto-reply/reply/bash-command.ts:300-304
const pid = running.pid ?? running.child?.pid;
if (pid) {
  killProcessTree(pid);  // Calls the UNPATCHED version
}
markExited(running, null, "SIGKILL", "failed");

Compare this to the patched version in src/process/kill-tree.ts:

ts
// src/process/kill-tree.ts:46-78
function killProcessTreeUnix(pid: number, graceMs: number): void {
  // Step 1: Try graceful SIGTERM to process group
  try {
    process.kill(-pid, "SIGTERM");
  } catch { /* ... */ }

  // Step 2: Wait grace period, then SIGKILL if still alive
  setTimeout(() => {
    if (isProcessAlive(-pid)) {
      try { process.kill(-pid, "SIGKILL"); } catch { /* ... */ }
    }
  }, graceMs).unref();
}

PoC

This PoC demonstrates the difference between the vulnerable and patched code paths inside a running OpenClaw Gateway container.

Setup:

bash
# Build and start the gateway container
cd CVE-2026-27486-variant-exp/
docker compose up -d
sleep 5

Exploit (vulnerable killProcessTree from shell-utils.ts):

The following script is injected into the container and executed. It starts a bash process that traps SIGTERM for graceful shutdown, then kills it using the same code path as !stop:

js
// exploit_sigkill.cjs — replicates src/agents/shell-utils.ts:183-190
const { spawn } = require('child_process');
const fs = require('fs');

try { fs.unlinkSync('/tmp/graceful_shutdown.txt'); } catch {}

const child = spawn('/bin/bash', ['-c',
  'trap \'echo GRACEFUL_SHUTDOWN > /tmp/graceful_shutdown.txt; exit 0\' SIGTERM; while true; do sleep 1; done'
], { detached: true, stdio: 'ignore' });
child.unref();

setTimeout(() => {
  // VULNERABLE: same as shell-utils.ts — SIGKILL only
  try { process.kill(-child.pid, 'SIGKILL'); } catch {
    try { process.kill(child.pid, 'SIGKILL'); } catch {}
  }
  setTimeout(() => {
    if (fs.existsSync('/tmp/graceful_shutdown.txt')) {
      console.log('[BLOCKED] SIGTERM was received.');
      process.exit(1);
    } else {
      console.log('[EXPLOITED] SIGKILL sent directly — SIGTERM never delivered.');
      process.exit(0);
    }
  }, 2000);
}, 1000);

Run:

bash
python3 poc_exploit.py

Log of Evidence

Exploit output (SIGKILL only, no graceful shutdown):

[*] Running exploit (vulnerable killProcessTree from shell-utils.ts)...
[*] Victim PID: 78
[*] Calling vulnerable killProcessTree (SIGKILL only, no SIGTERM)...
[EXPLOITED] SIGKILL sent directly — SIGTERM never delivered.
[EXPLOITED] Graceful shutdown handler was NEVER invoked.

[SUCCESS] CVE-2026-27486 variant confirmed:
  killProcessTree() in shell-utils.ts sends immediate SIGKILL,
  bypassing the graceful shutdown fix in process/kill-tree.ts.

Control output (SIGTERM first, graceful shutdown works):

[*] Running control (patched killProcessTree from process/kill-tree.ts)...
[*] Victim PID: 93
[*] Calling patched killProcessTree (SIGTERM first, then SIGKILL after grace)...
[NORMAL] SIGTERM received — graceful shutdown completed. Flag: GRACEFUL_SHUTDOWN

[NORMAL] Control confirmed: patched killProcessTree sends SIGTERM first,
         allowing graceful shutdown before escalating to SIGKILL.

Impact

When !stop is used, background processes are killed instantly via SIGKILL with no chance to perform cleanup. This can result in:

  • Data corruption: processes writing to files or databases are interrupted mid-write
  • Resource leaks: temporary files, lock files, and network connections are not properly released
  • Security-sensitive cleanup skipped: operations like erasing in-memory secrets or completing audit logs are bypassed

This is the same class of impact that CVE-2026-27486 was filed for — the fix simply missed the shell-utils.ts copy of the function.

Affected products

  • Ecosystem: npm
  • Package name: openclaw
  • Affected versions: <= 2026.3.14
  • Patched versions: <None>

Severity

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

Weaknesses

  • CWE: CWE-404: Improper Resource Shutdown or Release

Occurrences

Permalink Description
https://github.com/moltbot/moltbot/blob/f2849c2417/src/agents/shell-utils.ts#L170-L192 The vulnerable killProcessTree function that sends immediate SIGKILL without SIGTERM.
https://github.com/moltbot/moltbot/blob/f2849c2417/src/auto-reply/reply/bash-command.ts#L5 Import statement pulling the vulnerable killProcessTree from shell-utils.ts instead of the patched kill-tree.ts.
https://github.com/moltbot/moltbot/blob/f2849c2417/src/auto-reply/reply/bash-command.ts#L300-L304 The !stop handler calling the vulnerable killProcessTree(pid).
https://github.com/moltbot/moltbot/blob/f2849c2417/src/process/kill-tree.ts#L46-L78 The patched killProcessTreeUnix with graceful SIGTERM → grace period → SIGKILL sequence (for reference).

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 6.1/10
Wektor CVSS
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H
Słabość (CWE)
CWE-404
Platforma
npm
Paczka
openclaw
Ujawniono
30.03.2026
Aktualizacja
11.10.2026 10:22

Źródła i licencje

OSV / GitHub Advisory Database - GHSA-3298-56p6-rpw2 - 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. Wysoka · 8.8 CVE-2026-53836 < 2026.5.12 2026.5.12
  2. Wysoka · 8.8 CVE-2026-53811 < 2026.5.7 2026.5.7
  3. Wysoka · 8.8 CVE-2026-53806 < 2026.5.12 2026.5.12
  4. Wysoka · 7.8 CVE-2026-53813 < 2026.4.25 2026.4.25
  5. Wysoka · 7.5 CVE-2026-53834 < 2026.4.27 2026.4.27
  6. Wysoka · 8.3 CVE-2026-32905 < 2026.5.4 2026.5.4
  7. Krytyczna CVE-2026-34507 < 2026.4.29 2026.4.29
  8. Wysoka CVE-2026-53823 < 2026.5.3 2026.5.3
  9. Wysoka · 8.4 CVE-2026-53814 < 2026.5.20 2026.5.20
  10. Wysoka · 8.0 CVE-2026-53817 < 2026.5.22 2026.5.22
  11. Wysoka · 6.5 CVE-2026-53815 < 2026.5.19 2026.5.19
  12. Wysoka · 8.1 CVE-2026-53849 < 2026.5.7 2026.5.7
  13. Wysoka · 7.1 CVE-2026-53853 < 2026.5.12 2026.5.12
  14. Wysoka · 8.1 CVE-2026-53857 < 2026.5.3 2026.5.3
  15. Wysoka · 8.1 CVE-2026-53855 < 2026.4.2 2026.4.2
  16. Wysoka · 8.1 CVE-2026-53866 < 2026.5.12 2026.5.12
  17. Wysoka · 8.1 CVE-2026-53864 < 2026.5.26 2026.5.26
  18. Wysoka · 7.8 CVE-2026-44114 < 2026.4.20 2026.4.20
  19. Krytyczna · 9.8 CVE-2026-44109 < 2026.4.15 2026.4.15
  20. Krytyczna · 8.1 CVE-2026-43585 < 2026.4.15 2026.4.15
  21. Wysoka · 8.8 CVE-2026-43530 >= 2026.2.23, < 2026.4.12 2026.4.12
  22. Wysoka · 8.8 CVE-2026-42434 >= 2026.4.5, < 2026.4.10 2026.4.10
  23. Wysoka · 7.5 CVE-2026-42437 >= 2026.4.9, < 2026.4.10 2026.4.10
  24. Wysoka CVE-2026-41393 < 2026.3.31 2026.3.31
  25. Krytyczna · 8.2 CVE-2026-41296 < 2026.3.31 2026.3.31
  26. Wysoka · 8.8 CVE-2026-41352 < 2026.3.31 2026.3.31
  27. Wysoka · 7.8 CVE-2026-41396 < 2026.3.31 2026.3.31
  28. Wysoka · 7.3 CVE-2026-41380 < 2026.3.28 2026.3.28
  29. Wysoka · 8.6 CVE-2026-35641 < 2026.3.24 2026.3.24
  30. OpenClaw has incomplete Fix for CVE-2026-27486: Unvalidated SIGKILL in `!stop` Chat Command via `shell-utils.ts` ten wpis
    Średnia · 6.1 CVE-2026-35667 < 2026.3.24 2026.3.24
  31. Wysoka CVE-2026-35636 >= 2026.3.11, < 2026.3.28 2026.3.28
  32. Krytyczna CVE-2026-35625 <= 2026.3.24 brak poprawki
  33. Wysoka · 7.5 CVE-2026-35650 < 2026.3.22 2026.3.22
  34. Wysoka · 8.8 CVE-2026-35643 < 2026.3.22 2026.3.22
  35. Wysoka · 7.5 CVE-2026-32846 < 2026.03.28 2026.03.28
  36. Wysoka · 8.8 CVE-2026-33573 < 2026.3.11 2026.3.11
  37. Krytyczna · 9.9 CVE-2026-22172 < 2026.3.12 2026.3.12
Pokaż więcej (20) Widać 120 z 236

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.