Path traversal in profile snippets import allows writing files outside the profile directory (Zip-Slip)
MediumCVE-2026-47287 · Published Jun 9, 2026
## VS Code - Security Feature Bypass Vulnerability An elevation of privilege vulnerability exists in VS Code 1.123.0 and earlier versions where a user who is tricked into importing a crafted .code-profile file containing a snippet entry with a maliciously crafted name could have attacker-controlled content written to an arbitrary file location outside the intended profile snippets directory. The snippet name is used to construct the destination file path without sufficient validation, allowing path traversal sequences (for example, ../) to escape the snippets folder and write to any location writable by the user, which could lead to code execution or configuration tampering. ### Patches The fix is available starting with VS Code 1.123.1. The fix (9b31ff896671125cbfc65f33731c4a99660d6201) mitigates this by skipping creating the files outside snippets directory ### Workarounds Do not create profiles from untrusted sources ### References - The patch for this can be found at 9b31ff896671125cbfc65f33731c4a99660d6201 - An issue for this can be found at https://github.com/microsoft/vscode/issues/320679 - MSRC details for this can be found at https://msrc.microsoft.com/update-guide/...
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| vscode Product | < 1.123.1 | 1.123.1 |
Details and references
## VS Code - Security Feature Bypass Vulnerability An elevation of privilege vulnerability exists in VS Code 1.123.0 and earlier versions where a user who is tricked into importing a crafted .code-profile file containing a snippet entry with a maliciously crafted name could have attacker-controlled content written to an arbitrary file location outside the intended profile snippets directory. The snippet name is used to construct the destination file path without sufficient validation, allowing path traversal sequences (for example, ../) to escape the snippets folder and write to any location writable by the user, which could lead to code execution or configuration tampering. ### Patches The fix is available starting with VS Code 1.123.1. The fix (9b31ff896671125cbfc65f33731c4a99660d6201) mitigates this by skipping creating the files outside snippets directory ### Workarounds Do not create profiles from untrusted sources ### References - The patch for this can be found at 9b31ff896671125cbfc65f33731c4a99660d6201 - An issue for this can be found at https://github.com/microsoft/vscode/issues/320679 - MSRC details for this can be found at https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-47287
- Severity from
- GitHub (reviewed advisory)
More Microsoft advisories
All Microsoft| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Jul 2 | Microsoft 365 Copilot: open redirect | Critical9.3 | No fix yet |
| Jul 2 | Microsoft Azure Synapse: improper access control | Medium4.8 | No fix yet |
| Jul 1 | Microsoft Edge (Chromium-based): use after free | High8.3 | 149.0.4022.68 |
| Jun 9 | GitHubCredentialProvider - Regex substring host match sends Basic-auth tokens | High | 1.123.1 |
| Jun 9 | Auto-Approved File Write via Unconfirmed Environment-Variable Path Redirection | Low | 1.123.1 |
| Jun 9 | Unconfirmed Remote Host Connection via Workspace File | High | 1.123.1 |