fix(security): guarantee temp file cleanup in performAutoUpdate (#3307)

Restructure temp file write-execute-cleanup in performAutoUpdate so
cleanup is unconditionally reached after tryCatch captures any exec
error. Previously, the Windows and Unix paths each had separate
tryCatch+cleanup+rethrow sequences that could diverge under future
edits. Now a single tryCatch wraps the platform-branching exec, with
cleanup always running before any error is re-thrown.

Fixes #3306

Agent: security-auditor

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
A 2026-04-14 22:48:12 -07:00 committed by GitHub
parent 1e64d34e5a
commit d1d51fb06d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 27 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@openrouter/spawn",
"version": "1.0.11",
"version": "1.0.12",
"type": "module",
"bin": {
"spawn": "cli.js"