AI and data stack advisories

Severe, 6 weeks1496Projects326

1496 severe, 6 weeks · 326 projects

MicrosoftGHSA-c82g-9gj4-hxp2

Auto-Approved File Write via Unconfirmed Environment-Variable Path Redirection

Microsoft

CVE-2026-45482 · Published Jun 9, 2026

Low
Fix: upgrade to 1.123.1 or later
GitHub advisory

VS Code - Security Feature Bypass Vulnerability

A security feature bypass vulnerability exists in VS Code where the terminal command auto-approval logic could approve a file-write redirection to a path that escapes the expected workspace scope. The guard that blocks redirection to non-absolute destinations accounted for POSIX tilde/home expansion (~) but not Windows environment-variable expansion (%). Paths such as %APPDATA%\file.txt or %HOME%/file.txt are not classified as absolute by posix.isAbsolute or win32.isAbsolute, so a command redirecting output to one of them could be auto-approved and write to a sensitive, user-controlled location without explicit user confirmation.

Patches

The fix extends the redirection guard to also block auto-approval when the destination path contains % (Windows environment-variable expansion), in addition to the existing ~ handling, and adds regression tests for both bash and pwsh.

Workarounds

Avoid enabling terminal command auto-approval, or set chat.tools.terminal.autoApprove / the file-write blocking setting so that detected file writes are always blocked.

References

  • The patch for this can be found at https://github.com/microsoft/vscode/pull/320676
  • An issue for this can be found at [#320660](https://github.com/microsoft/vscode/issues/320660)
  • MSRC details for this can be found at...

Affected versions

PackageAffectedFixed in
vscode
Product
< 1.123.11.123.1
Details and references

## VS Code - Security Feature Bypass Vulnerability A security feature bypass vulnerability exists in VS Code where the terminal command auto-approval logic could approve a file-write redirection to a path that escapes the expected workspace scope. The guard that blocks redirection to non-absolute destinations accounted for POSIX tilde/home expansion (`~`) but not Windows environment-variable expansion (`%`). Paths such as `%APPDATA%\file.txt` or `%HOME%/file.txt` are not classified as absolute by `posix.isAbsolute` or `win32.isAbsolute`, so a command redirecting output to one of them could be auto-approved and write to a sensitive, user-controlled location without explicit user confirmation. ### Patches The fix extends the redirection guard to also block auto-approval when the destination path contains `%` (Windows environment-variable expansion), in addition to the existing `~` handling, and adds regression tests for both bash and pwsh. ### Workarounds Avoid enabling terminal command auto-approval, or set `chat.tools.terminal.autoApprove` / the file-write blocking setting so that detected file writes are always blocked. ### References - The patch for this can be found at https://github.com/microsoft/vscode/pull/320676 - An issue for this can be found at [#320660](https://github.com/microsoft/vscode/issues/320660) - MSRC details for this can be found at https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-45482

Severity from
GitHub (reviewed advisory)

More Microsoft advisories

All Microsoft