Post

TIL about a VSCode vulnerability involving auto-run tasks inside a repo. That got me thinking: could I use this to re-program a developer's AI agents and get them to do what I want? Even worse — could I do this to all a developer’s code repositories? Turns out: hell yes. ike.io/open-a-folde...

ike.ioExploit Cursor Agents to create persistent, distributed threatsSimply opening a folder can give an attacker a foothold into all the code bases a developer maintains.

2 reposts3 likes

I had a lot of fun with this. I learned a cool shell redirect trick for appending to a file *only* if it exists, I learned how helpfully AI agents hold doors open for you when you’re carrying a large bag of contraband, and I learned about obfuscating commands in JSON arg arrays.

It’s astonishing to me that we don’t have more guard rails on our code rn. This kind of exploit was already a rough one from a supply chain perspective, but when you add in a built-in “Agentic” helper on the inside? whew boy

There are recommended mitigations that you can apply as outlined in the Oasis report, but in Cursor those remediations disable the AI features (which defeats the point). At this time, the fix is 1) enabling Workspace Trust and 2) thoroughly reading the tasks.json file OUTSIDE of VSCode/Cursor