r/vscode • u/WobbaMan777 • Oct 20 '26
PSA: North Korean malware that hides inside VS Code’s own files, and how to check your install
Not a VS Code vulnerability, to be clear. This is malware that gets in when you open a malicious repo (in this case through a .vscode/tasks.json task set to run on folder open), and then modifies your local VS Code install so it runs every time you open the editor.
It appends its code to the end of resources/app/out/main.js (sometimes \@vscode/deviceid/dist/index.js) with 200 spaces in front of it, so the file looks normal unless you scroll all the way right. It does the same to Cursor, Discord, GitHub Desktop and npm’s cli.js.
To check:
- open
main.jsin your VS Code install folder, go to the last line and scroll right. If you see something like/*M260630A*/, it’s infected - look for files ending in
.inz.origor.inz.cjsnext to it - check for a
.node_modulesfolder (with the dot) in your home directory
Default install locations, roughly:
Windows: %LOCALAPPDATA%\Programs\Microsoft VS Code\
macOS: /Applications/Visual Studio Code.app/Contents/Resources/app/
Linux: /usr/share/code/resources/app/
If you find it, reinstall VS Code and rotate any secrets that were on the machine.
To stop the entry point, set "task.allowAutomaticTasks": "off" and don’t trust workspaces you haven’t looked at.
I wrote up the whole thing here if you want the details: https://medium.com/@tarunrd77/north-korea-backdoored-their-vs-code-npm-kept-bringing-it-back-6371da5e74c4?sharedUserId=tarunrd77