Summary
The extension contains a default list of allowed commands that do not need manual approval if auto-approve is enabled, and npm install was included in that list. Because npm install executes lifecycle scripts, if a repository’s package.json file contains a malicious postinstall script, it would be executed automatically without user approval. This means that enabling auto-approved commands and opening a malicious repo could result in arbitrary code execution.
Impact
This vulnerability allows an attacker to achieve arbitrary code execution on the developer’s system by placing a malicious postinstall (or similar lifecycle script) in package.json.
Remediation
The issue was fixed by removing dangerous commands from the default auto-approve allowlist as well as removing these previously default commands from the allowlist when the extension is updated.
Summary
The extension contains a default list of allowed commands that do not need manual approval if auto-approve is enabled, and npm install was included in that list. Because npm install executes lifecycle scripts, if a repository’s package.json file contains a malicious postinstall script, it would be executed automatically without user approval. This means that enabling auto-approved commands and opening a malicious repo could result in arbitrary code execution.
Impact
This vulnerability allows an attacker to achieve arbitrary code execution on the developer’s system by placing a malicious postinstall (or similar lifecycle script) in package.json.
Remediation
The issue was fixed by removing dangerous commands from the default auto-approve allowlist as well as removing these previously default commands from the allowlist when the extension is updated.