Skip to content

fix: spawn the archiver without a shell in verify-vsix - #17

Merged
kkdev92 merged 1 commit into
mainfrom
fix/verify-vsix-no-shell
Aug 12, 2026
Merged

fix: spawn the archiver without a shell in verify-vsix#17
kkdev92 merged 1 commit into
mainfrom
fix/verify-vsix-no-shell

Conversation

@kkdev92

@kkdev92 kkdev92 commented Aug 12, 2026

Copy link
Copy Markdown
Owner

CodeQL flags js/indirect-command-line-injection: process.env.SystemRoot is
interpolated into a string handed to execSync.

Not exploitable

The value is already quoted, and SystemRoot is a trusted value — anyone able
to set it can run anything they like without this script's help. The script also
does not ship: it runs locally and in CI to check a packaged VSIX.

Why change it anyway

One reason, and it has nothing to do with CodeQL: vscode-ext-kit's equivalent
script already uses execFileSync.
This is the odd one out.

Passing argv removes the quoting question rather than answering it, and removes
the shell that could get it wrong.

What is preserved

The archive argument stays relative and cwd stays as it was. That pairing is
deliberate — bsdtar reads an absolute C:\… as a remote host — and the comment
saying so is kept.

Verification

Ran the lane that actually exercises this: package, then verify:vsix end to
end, extracting a real VSIX.

🤖 Generated with Claude Code

CodeQL flags `js/indirect-command-line-injection` here: `process.env.SystemRoot`
is interpolated into a string handed to `execSync`.

**It is not exploitable and this commit should not claim otherwise.** The value is
already quoted, and `SystemRoot` is a trusted value — anyone able to set it can run
anything they like without this script's help. Nor does the script ship; it runs
locally and in CI to check a packaged VSIX.

It is worth changing anyway for one reason that has nothing to do with CodeQL:
`vscode-ext-kit`'s equivalent script already uses `execFileSync`, so this is the
odd one out. Passing argv removes the quoting question rather than answering it,
and removes the shell that could get it wrong.

The archive argument stays relative and `cwd` stays as it was — that pairing is
deliberate, because bsdtar reads an absolute `C:\…` as a remote host.

Verified by running the lane that actually exercises it: package, then
`verify:vsix` end to end.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@kkdev92
kkdev92 merged commit 0184468 into main Aug 12, 2026
8 checks passed
@kkdev92
kkdev92 deleted the fix/verify-vsix-no-shell branch August 12, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant