Files
hyperframes/packages
WaterrrForeverandClaude Opus 5.5 e383abf475 fix(media-use): re-freezing a recipe archives only under an integer version (#8201)
* fix(media-use): re-freezing a recipe archives only under an integer version

freezeRecipe archived the previous folder at `${dir}@v${previous.version}`,
taking version straight from the old recipe.json and removing that path
recursively before renaming the folder onto it. recipe.json is committed
with the project, so a received project could set version to a path such
as "1/../../../../victim", ship a promo@v1 folder for it to walk through,
and the next freeze of that name deleted a folder outside the project and
moved the recipe folder into its place.

Only a positive integer version is trusted now; anything else archives as
v1, the same fallback the version bump already used. Both media-use copies
of recipe-store.mjs carry the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(media-use): never replace an existing recipe archive on re-freeze

A malformed recipe.json version fell back to slot 1, so re-freezing removed a
real promo@v1 archive before renaming the current folder into it. The archive
slot is now the claimed version only when that archive does not exist yet;
otherwise it is the first number above every archive on disk. Nothing is
removed any more. The version is checked against Number.MAX_SAFE_INTEGER
before either folder moves, so a freeze never writes a version the next
freeze would reject.

Refs SECOPS-2882

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 07:26:36 +00:00
..
2026-11-19 06:55:39 +00:00
2026-11-19 06:55:39 +00:00
2026-11-19 06:55:39 +00:00
2026-11-19 06:55:39 +00:00
2026-11-19 06:55:39 +00:00
2026-11-19 06:55:39 +00:00
2026-11-19 06:55:39 +00:00
2026-11-19 06:55:39 +00:00
2026-11-19 06:55:39 +00:00
2026-11-19 06:55:39 +00:00
2026-11-19 06:55:39 +00:00