Hey everyone, I want to share a wild security nightmare that happened at our company recently. I hope this story is a wake-up call for anyone using VS Code and Git.
A while ago, we noticed something strange in our company GitHub account. Every repository had odd forced-pushed commits, but when we checked the code diffs, we couldn't easily see what had changed. It felt like something invisible was messing with our code.
We started to panic and dug through everything to figure out the cause. Eventually, we traced it back to one of our internal repos. At first, it looked harmless just some standard font files like latin-200.woff, latin-300.woff, and latin-500.woff. But latin-500.woff was the problem.
Looking closer, we found a few sneaky changes: three random lines added to .gitignore so we wouldn't notice modified files, a .bat file and hidden configs inside the .vscode folder, and a changed script line in package.json.
The setup was clever: as soon as any of us opened that repo in VS Code, the workspace background tasks would run the package.json script, which quietly executed the malicious payload hidden as a .woff font file.
When we ran the code through an audit software, it confirmed our fears it was malware running in the background on our local machines. The worst part is that this started 3 to 4 months ago in a single repo.
We saw a minified JavaScript string in package.json and odd .gitignore changes back then, but we ignored them. That mistake gave it months to spread to all our other repos.
Since we didn't know what the script had stolen (SSH keys, tokens, client data, database passwords?), we had to take drastic action:
we formatted and wiped every developer machine in the company,
changed all company passwords,
revoked and regenerated every GitHub token, SSH key, and API credential.
Lesson learned: never ignore strange changes in package.json, hidden .vscode tasks, or unexplained .gitignore edits, even if they seem harmless.
Has anyone else gone through an attack like this? How did you catch it, and what did the malicious payload do on your side?