SKY-D366 · Supply chain and agent configuration
Editor task that runs when the folder opens
VS Code tasks can carry "runOptions": {"runOn": "folderOpen"}. Once a developer allows automatic tasks, VS Code, Cursor and Windsurf run such a task as soon as the folder is opened. SKY-D366 reports every committed task that runs this way, and the tasks it depends on.
- Languages
- VS Code task and workspace files
- Quality gate
- Full scan: listed, not counted by the gate. Diff scan: fails the gate on its own. A CRITICAL task fails a full scan too. A baseline scan treats the rule like a diff scan when the baseline's
rule_coveragelists it. - Finding type
- review
Why it matters
A pull request that adds a folder-open task runs its command on the laptop of everyone who opens the repository, with their SSH keys and cloud logins, before anyone builds or tests the code. Worms such as Mini Shai-Hulud used exactly this to persist.
What Skylos flags
{ "version": "2.0.0", "tasks": [ { "label": "dev server", "type": "shell", "command": "npm run dev", "isBackground": true, "runOptions": { "runOn": "folderOpen" } }, { "label": "lint", "type": "shell", "command": "npm run lint" } ]}What Skylos leaves alone
{ "version": "2.0.0", "tasks": [ { "label": "dev server", "type": "shell", "command": "npm run dev", "isBackground": true, "runOptions": { "runOn": "default" } }, { "label": "lint", "type": "shell", "command": "npm run lint" } ]}Why Skylos leaves it alone
"runOn": "default" means the task runs only when someone starts it from the Tasks menu. A task that never runs on folder open, and is not a dependency of one that does, is not reported.
How Skylos decides
- Runs with
--danger(and-a). Theca9library reads.vscode/tasks.jsonand thetasksblock of*.code-workspacefiles, anywhere in the scanned folder except dependency folders such asnode_modules,.venvandsite-packages. Comments and trailing commas are allowed. - A task runs on folder open when its
runOptions.runOnisfolderOpen, in any letter case, on the task itself or in itswindows,osxorlinuxsection. Every task it names independsOnis reported too, and their dependencies in turn, because VS Code runs them first. - The finding shows the command line as it runs: the task's (or the file's)
options.shell, thencommand(ornpm run <script>for an npm task), thenargs, once for each different per-platform variant. It is reported on thecommandline. - Keeps the same files as SKY-D365: regular files inside the scanned folder; in Git, a full scan keeps tracked files and untracked files Git does not ignore, and a diff scan keeps tracked files that changed.
- No command is trusted by its name. The severity comes from ca9: HIGH, or CRITICAL for remote code, decode-and-run payloads and disguised scripts. The command is shown redacted.
- In the gate, a full scan lists HIGH findings without counting them; a CRITICAL one fails. In a diff scan a task is new when its rule, file and a digest of its label and whole command are not among the merge base's findings, so adding
runOnto an existing task is new. A new one fails the gate on its own.
How to fix it
Remove runOptions.runOn (or the whole task) unless the team really wants it to start on its own. A developer can still run it from the Tasks menu. If it must stay, review the command and every script it calls in each change.
{ "version": "2.0.0", "tasks": [ { "label": "dev server", "type": "shell", "command": "npm run dev",Removed: "isBackground": true,Removed: "runOptions": { "runOn": "folderOpen" }Added: "isBackground": true }, { "label": "lint", "type": "shell", "command": "npm run lint" } ]}When it can be wrong
- Every folder-open task is reported, however harmless, such as a watcher or a dev server. VS Code asks before it runs automatic tasks for the first time, but one "Allow" covers every later change to the file.
- When a tasks file mentions
folderOpenbut does not parse, ca9 recovers every"command"string in its text and reports each one as a folder-open task.
Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.
How to silence it
Skylos reads no inline marker for this rule, even though
tasks.jsonallows comments.Accept a reviewed task with a baseline:
skylos baseline ., then--baseline. The entry matches the rule, file, task label and command, not the line. In pull-request CI (SKYLOS_POLICY_BASE), the entry must also be in the base commit's.skylos/baseline.json.[tool.skylos] ignore = ["SKY-D366"]turns the rule off for the whole project.