CVE-2021-28793
Description
vscode-restructuredtext before 146.0.0 contains an incorrect access control vulnerability, where a crafted project folder could execute arbitrary binaries via crafted workspace configuration.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected products
2- vscode-restructuredtext/vscode-restructuredtextdescription
- Range: <146.0.0
Patches
Vulnerability mechanics
Root cause
"Incorrect access control in workspace configuration handling allows a crafted project folder to specify arbitrary binaries that the extension executes."
Attack vector
An attacker can craft a malicious project folder containing a workspace configuration (e.g., `.vscode/settings.json`) that specifies arbitrary binary paths or commands. When a victim opens this project in VS Code with the vulnerable extension installed, the extension reads the workspace configuration without adequate access control and executes the attacker-controlled binaries. This is an incorrect access control vulnerability [ref_id=1] where the extension trusts workspace settings that should be restricted.
Affected code
The vulnerability lies in the workspace configuration handling of the vscode-restructuredtext extension prior to version 146.0.0. The patch modifies `extension.ts` to call `initConfig(context)` early in the `activate()` function and introduces `setGlobalState` and `setWorkspaceState` from `stateUtils` and `initConfig` from `config`. The reordering of imports and initialization logic indicates that previously the extension did not properly isolate workspace configuration from the execution environment.
What the fix does
The patch reorders initialization in `activate()` to call `initConfig(context)` and set global/workspace state before any other operations. It also moves the import of `ExtensionContentSecurityPolicyArbiter` and `PreviewSecuritySelector` after the new state utilities. These changes ensure that workspace configuration is properly validated and isolated before the extension processes any workspace-provided settings, preventing malicious workspace configurations from triggering arbitrary binary execution.
Preconditions
- configVictim must have the vulnerable vscode-restructuredtext extension installed (before 146.0.0).
- inputVictim must open a project folder crafted by the attacker containing malicious workspace configuration.
- inputThe attacker must control the workspace settings (e.g., via .vscode/settings.json in the project).
Generated on May 29, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
4- github.com/vscode-restructuredtext/vscode-restructuredtext/commit/1dd3e878a5559e3dfe0e48f145c90418b208c5afmitrex_refsource_MISC
- github.com/vscode-restructuredtext/vscode-restructuredtext/releasesmitrex_refsource_MISC
- github.com/vscode-restructuredtext/vscode-restructuredtext/releases/tag/147.0.0mitrex_refsource_MISC
- vuln.ryotak.me/advisories/37mitrex_refsource_MISC
News mentions
0No linked articles in our index yet.