GitHub Copilot and Visual Studio Code Remote Code Execution Vulnerability (CVE-2026-21523)
A time-of-check time-of-use race condition in GitHub Copilot and Visual Studio lets an authorised attacker run code over the network. The text says a malicious prompt can coerce the system into executing attacker-controlled instructions, escalating to remote code execution when backend components or integrated tools run unintended commands.
Originally disclosed on Microsoft
Description
Time-of-check time-of-use (toctou) race condition in GitHub Copilot and Visual Studio allows an authorized attacker to execute code over a network.
FAQ
How could an attacker exploit this vulnerability? The AV:N rating indicates the vulnerability is exploitable over the network, meaning an attacker can deliver a malicious prompt remotely without prior access, while UI:R means a user must interact with Copilot for exploitation to occur. Due to prompt injection, the system is coerced into executing attacker-controlled instructions, which can escalate into remote code execution (RCE) when the compromised prompt causes backend components or integrated tools to run unintended commands.
GitHub Copilot and Visual Studio
GitHub Copilot and Visual Studio
Microsoft
Microsoft
Customer Action Required
Yes
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a time-of-check time-of-use race condition in how Copilot and Visual Studio handle prompts and pass them to backend tools.
Impact
An attacker who can deliver a malicious prompt could execute code over the network, but a user must interact with Copilot for the exploit to work.
What the attacker needed
Attacker can send a prompt over the network; victim interacts with Copilot
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A race condition is when a program checks something and then uses it, and an attacker can change it in the gap between those two moments. Here the text says a crafted prompt sent to Copilot can make the assistant pass instructions to tools behind it, which then run commands the user never intended. The result is that someone else's code runs on the affected machine.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.