Skip to content

security: enforce frozen lockfile during setup#614

Open
halbert04 wants to merge 1 commit intogarrytan:mainfrom
halbert04:security/frozen-lockfile
Open

security: enforce frozen lockfile during setup#614
halbert04 wants to merge 1 commit intogarrytan:mainfrom
halbert04:security/frozen-lockfile

Conversation

@halbert04
Copy link
Copy Markdown

Summary

  • Changes bun install to bun install --frozen-lockfile in the main build block of the setup script
  • Prevents dependency confusion attacks where a compromised npm publish of playwright, puppeteer-core, or any transitive dependency resolves to a malicious version at install time
  • The .agents/ generation block (line 199) already uses --frozen-lockfile with a fallback — this makes the main build path consistent

Why this matters

gstack's setup runs bun install which resolves ^1.58.2 to the latest compatible version. If an attacker publishes a compromised version of any dependency in the resolution range, every new ./setup or /gstack-upgrade run would pull it. With --frozen-lockfile, only versions pinned in bun.lock are installed.

Risk

Low. If bun.lock is missing or stale (e.g., after a dependency bump in package.json without running bun install to update the lock), setup will fail with a clear error instead of silently resolving new versions. This is the correct behavior — maintainers should commit an updated lockfile.

Test plan

  • Verify ./setup succeeds with existing bun.lock
  • Verify ./setup fails clearly when bun.lock is deleted (expected: error message about frozen lockfile)

Made with Cursor

bun install with caret ranges (^1.58.2) resolves to latest compatible
versions at install time. A compromised npm publish of playwright or
puppeteer-core would get code execution on every setup run. Using
--frozen-lockfile ensures the resolved versions in bun.lock are used
exactly, preventing dependency confusion attacks.

The fallback in the .agents/ generation block (line 199) already uses
--frozen-lockfile. This makes the main build block consistent.

Made-with: Cursor
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