fix(devtools): validate viewer database paths - #16049
Conversation
Adds a 100 MB cap in validateRemoteDbPath so an attacker-influenced (but otherwise valid) .devtools/generations.json cannot hang/OOM the synchronous read. Complements the existing basename/dir, isFile, and symlink-escape checks. Closes the last gap noted when consolidating the duplicate VULN-11550 fixes (#16055). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Pushed a small graft on top (20e7921): a 100 MB read-size cap in Context: this consolidates the duplicate VULN-11550 fix I'd opened (#16055), which I've now closed in favor of this PR. Your validation (basename/dir + isFile + Note: VULN-11530's Host/Origin gating (#16042 / its v6 backport #16054) makes the cross-origin POST unreachable, so the residual "another project's |
|
|
|
🚀 Published in:
|
Background
currently
/api/notifytrusted whateverdbPathcame in the request body. the viewer would store/etc/passwdasremoteDbPath, and the next/api/runscall would pass it intoreloadDb(), which attempted toreadFileSync()and parse that file. If the file happened to be JSON shaped like the devtools DB, it could be exposed through the viewer APIsSummary
dbPathis only accepted if it resolves to a real regular file named:<some-project>/.devtools/generations.jsonManual Verification
na
Checklist
pnpm changesetin the project root)