Application Security

VS Code Configs Expose GitHub Codespaces to Attacks

VS Code-integrated configuration files are automatically executed in Codespaces when the user opens a repository or pull request.

Code supply chain attack

The automatic execution of VS Code-integrated configuration files when opening a repository or pull request in GitHub Codespaces could lead to supply chain attacks, Orca Security reports.

A cloud-hosted developer environment, Codespaces allows users to create a fully configured Visual Studio Code instance almost instantly, providing them with tight repository integration and container support.

It allows developers to test code, review pull requests, and more, but also exposes them to attacks via repository-defined configuration files, Orca says.

“Codespaces is essentially VS Code running in the cloud, backed by Ubuntu containers, with built-in GitHub authentication and repository integration. This means any VS Code feature that touches execution, secrets, or extensions can potentially be abused when attackers control the repository content,” the cybersecurity firm notes.

The issue, it explains, is that Codespaces automatically respects all VS Code configurations when the user opens a repository or pull request, and even when they check a pull request from an existing Codespace environment.

An attacker could include malicious commands in a JSON file in the .vscode/ folder and abuse the automation for their execution without user approval when an arbitrary folder is opened, Orca says.

Advertisement. Scroll to continue reading.

Furthermore, the attacker can target Linux systems by embedding variables for the integrated terminal in another JSON file, which would result in the payload’s execution via bash.

According to the cybersecurity firm, an attacker could also use the devcontainer.json file to embed arbitrary commands that would be executed after the container is initialized on a machine.

These attack vectors, Orca says, could lead to the exfiltration of GitHub tokens, Codespaces secrets, and other secrets.

The GitHub token, the security firm notes, allows read and write operations in the context of the victim user, but can also be abused to introduce malicious pull requests to public repositories.

Orca also explains that the GitHub Codespaces RCE vector could be abused in supply chain attacks by forking public repositories, creating a malicious pull request that, when opened by a maintainer via Codespaces, leaks the maintainer’s GitHub token.

The attacker could then push code as a verified maintainer, Orca explains.

Furthermore, the security firm says, an attacker could create a malicious VS Code extension to mount an XSS attack and access local services via the ‘0.0.0.0 Day’ vulnerability disclosed in August 2024.

Furthermore, “adversaries can use the exfiltrated GitHub token with hidden, undocumented APIs that will allow them to prompt paid, premium AI-models on behalf of the victim,” Orca says.

The cybersecurity firm says it has reported the findings to Microsoft, which said the behavior is intentional.

SecurityWeek has emailed Microsoft-owned GitHub for a statement on the matter and will update this article if the company responds.

Related: Critical N8n Sandbox Escape Could Lead to Server Compromise

Related: North Korean Hackers Target macOS Developers via Malicious VS Code Projects

Related: Adobe ColdFusion Servers Targeted in Coordinated Campaign

Related: ‘PackageGate’ Flaws Open JavaScript Ecosystem to Supply Chain Attacks

Related Content

Vulnerabilities

Remote, unauthenticated attackers could exploit the bugs to cause a denial-of-service (DoS) condition.

Vulnerabilities

The vulnerabilities affected software used by eight of Belgium’s ten largest banks and over 60 government agencies.

Endpoint Security

Microsoft fixed critical vulnerabilities across Azure, Entra, and SharePoint, while Apple patched a high-severity authentication bypass.

Vulnerabilities

The browser refresh eliminates over two dozen memory safety bugs, including critical use-after-free flaws.

Artificial Intelligence

Zenity researchers reported the findings to Anthropic and OpenAI in late 2025 and early 2026, but they remain unpatched.

Artificial Intelligence

An attacker could self-register, sign in for board-level API access, and import a new company for code execution.

Vulnerabilities

Patches were rolled out for two dozen vulnerabilities, including one with public proof-of-concept (PoC) code.

Vulnerabilities

Tracked as CVE-2026-63077, the critical bug can be exploited without authentication for remote code execution.

Copyright © 2026 SecurityWeek ®, a Wired Business Media Publication. All Rights Reserved.

Exit mobile version