Repository navigation
fix(cli,create-objectstack): scaffolds override uuid below 12.0.0 to ^11.1.1, out of GHSA-w5hq-g745-h8pq - #25197
Conversation
…^11.1.1, out of GHSA-w5hq-g745-h8pq @objectstack/rest depends on exceljs ^4.4.0, whose newest release declares uuid ^8.3.0, so every npm-installed scaffold audited 9 moderate entries. npm reads overrides only from the root manifest, so the route is the scaffolds' own overrides block: one constant in init.ts, emitted by os init and os create, and stamped into the create-objectstack blank template by the emission-policy sync script (new POLICY_STAMPS row). Claude-Session: https://claude.ai/code/session_01AFrKwndmrCLtF5V9hNtrw3 Co-authored-by: Claude <noreply@anthropic.com>
…old every scaffolder's overrides block equal Claude-Session: https://claude.ai/code/session_01AFrKwndmrCLtF5V9hNtrw3 Co-authored-by: Claude <noreply@anthropic.com>
…s its key spelling Claude-Session: https://claude.ai/code/session_01AFrKwndmrCLtF5V9hNtrw3 Co-authored-by: Claude <noreply@anthropic.com>
…or, and the full dependency path Claude-Session: https://claude.ai/code/session_01AFrKwndmrCLtF5V9hNtrw3 Co-authored-by: Claude <noreply@anthropic.com>
…st-uuid-advisory Claude-Session: https://claude.ai/code/session_01AFrKwndmrCLtF5V9hNtrw3 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 30 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 38a9ee353f6eeaf7b3789cbc339011c558db9280 && git checkout 38a9ee353f6eeaf7b3789cbc339011c558db9280
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 2069b81c266836fd6d7b52fc5e6679c734bdcd3c 50d7f9c254e0bbdc3b8491d5fc464e358b46f66a && git checkout -B drift-repro 2069b81c266836fd6d7b52fc5e6679c734bdcd3c && git merge --no-ff 50d7f9c254e0bbdc3b8491d5fc464e358b46f66a
node scripts/docs-audit/affected-docs.mjs --json 2069b81c266836fd6d7b52fc5e6679c734bdcd3c
|
席位核对 · ACCEPT (landing on green)
Generated by Claude Code |
Fixes #25174
Clause-②: no
Metadata-protocol: none
What this changes
Every standalone scaffold's npm
overridesblock gains auuidentry that routes everyuuidedge below 12.0.0 to^11.1.1, out of GHSA-w5hq-g745-h8pq (uuidbelow 11.1.1). The scaffolds are thecreate-objectstackblank template,os init -t app,-t pluginand-t empty, andos create plugin(standalone).packages/cli/src/commands/init.ts: two new constants,SCAFFOLD_UUID_OVERRIDE_SELECTOR(the npm override key:uuid@, a less-than sign,12.0.0) andSCAFFOLD_UUID_OVERRIDE_RANGE(^11.1.1).SCAFFOLD_NPM_OVERRIDESis built from them and fromSCAFFOLD_VITEST_RANGE, soos initandos createemit it with no other code change.scripts/sync-scaffold-emission-policy.mjs: one newPOLICY_STAMPSrow stamps the value into the bundled template from the constant (the same path PR fix(cli,create-objectstack): scaffolds declare vitest ~4.1.12, outside GHSA-qxg6-89mg-rqv8, and still install on npm 10 #25173 used for vitest). The field regex now escapes the key, because the selector contains.. The self-test fixtures declare the new constant and key, with one new assertion (61 assertions in total).packages/create-objectstack/src/templates/blank/package.json: the stamped entry, written by the script's write run.packages/cli/test/scaffold-npm-overrides.test.tspins the map, the target's floor (at or above the fix for its major) and the selector's bound (the major right above the target).packages/cli/test/scaffold-emission-policy.e2e.test.ts(nightly tier) adds a check that the on-ramp,os initandos createemit the SAME wholeoverridesblock. The sync script's--checkcompares values only and cannot see a key spelled differently from the constant.@objectstack/cliandcreate-objectstack, patch. It includes the one-line fix for existing projects and for other npm consumers.@objectstack/restis not changed: no route at its level reaches npm consumers (measured below).Route measurements (npm 10.9.9 and npm 11.21.1)
Method: each manifest in its own empty directory under the scratchpad, with a fresh
--cacheper leg, and one install tree at a time. The@objectstack/*ranges^18.0.0resolve to the published 18.0.0. Theos init/os createmanifests were emitted by this tree's source CLI (bin/run-dev.js), and the blank template was taken from the tree.uuidwas read fromnode_modules, thennpm audit --jsonwas run. Two npm 10 audits and one npm 11 audit hit a registry endpoint error (400 onaudits/quickafter the bulk endpoint failed, and a 503 onadvisories/bulk). Those were re-run, and only completed audits are counted.uuid8.3.2, audit 9 moderate, all GHSA-w5hq-g745-h8pq@objectstack/restin its closure)uuid, audit 0latestis 4.4.0 (2023-10-19), and4.4.1-prerelease.0also declaresuuid ^8.3.0overridesinside the published@objectstack/rest(18.0.0 repacked withoverrides.uuid ^11.1.1, installed as a dependency)uuid8.3.2, audit 3 moderate (rest, exceljs, uuid): ignoredoverrides, selectoruuid@+ less-than12.0.0→^11.1.1(chosen)uuid11.1.1, audit 0uuid, audit 0 (the entry is inert)uuidkey@objectstack/restconsumeruuid11.1.1, audit 0exceljsaliased to theexceljs-community@5.2.1fork, as a published swap would resolve)uuid, audit 0Follow-up on a consumer of the published
@objectstack/rest18.0.0, root override as in C or C'. A laternpm install uuid@14exits 0 under C (declares^14.0.3, exceljs keeps 11.1.1), and exits 1 withEOVERRIDEunder C'. A spec-lessnpm install uuidexits 1 withEOVERRIDE: Override for uuid@* conflicts with direct dependencyunder both. Same on both npm versions. This is why the key is a selector and not bareuuid.Runtime under route C (H3), measured rather than read from a changelog. On the installed blank and
os init -t apptrees, on both npm versions, exceljs resolveduuid11.1.1. A buffered write with adataBarrule ran:CfRuleExtXform.preparecallsuuid.v4(), and the sheet carried 2 generated ids. The streamingWorkbookWriterran, the shapecreateXlsxStreambridges onto HTTP. A bufferedloadran.@objectstack/rest's ownparseXlsxToRowsread both workbooks back to the expected rows. exceljs calls no otheruuidexport. In the monorepo, the same pairing (exceljs 4.4.0 onuuid11.1.1, through the workspace override) runs the 16 rest test files that touch xlsx: 16 passed, 737 tests.Why C, by the four axes
uuidthe monorepo's exceljs suites run on. It has a written retirement re-check on the constant. D would move a published runtime dependency onto a fork. The measured candidate is maintained by one person, was created 2026-08-09 and declaresengines.node >=22.12.0, narrower than@objectstack/rest's>=22.0.0. That is a supply-chain decision, not a dependency bump.Acceptance notes
@objectstack/restother than through a fresh scaffold still audits GHSA-w5hq-g745-h8pq. This covers projects made before this change and hand-written projects, and the bare consumer measured 3 moderate entries on npm 10.9.9 and 11.21.1. npm readsoverridesonly from the root manifest (route B), so only replacingexceljs(route D) reaches them. That choice is raised for the maintainer in the report on rest: the published @objectstack/rest pulls exceljs ^4.4.0 → uuid ^8.3.0, so every npm-installed scaffold audits 9 moderate GHSA-w5hq-g745-h8pq entries; the workspace's uuid override never reaches npm consumers #25174, and is not made here.pnpm-workspace.yamlcomment says "high". The npm registry's bulk advisory endpoint saysmoderate, with a CVSS 3.1 vector scoring 7.5.npm auditin the scaffolds says moderate. GitHub's global advisory API was not readable from this session (403, session-bound).scripts/sync-scaffold-emission-policy.mjs'sdevDependencies.vitestrow comment still says the constant holds why the range is~4.0.0. The range has been~4.1.12since PR fix(cli,create-objectstack): scaffolds declare vitest ~4.1.12, outside GHSA-qxg6-89mg-rqv8, and still install on npm 10 #25173. The comment is stale, has no runtime effect and is outside this change. Carrier: none.Verification
All readings are at head
50d7f9c25, which is this branch withorigin/mainf7d740376merged in. The two incoming commits touchclimigrate code andplatform-objectstranslations, and none of these 6 paths. After the merge:pnpm installwas unchanged (no lockfile or manifest moved), the non-docs build was 76/76, andpackages/runtime/.objectstackwas cleared.pnpm --filter @objectstack/cli exec vitest run --project unit --maxWorkers=2under the verify lock: VERDICT command-exit 0, 323 test files passed, 4772 tests passed. The CLI integration tier is left to CI. The one integration-tier file in this diff is in the nightly tier, so it was run on its own:OS_TEST_TIERS=nightly … vitest run --project integration test/scaffold-emission-policy.e2e.test.ts, 1 file, 11 tests passed.pnpm --filter create-objectstack test: 18 files, 278 tests passed.pnpm --filter @objectstack/cli typecheck && pnpm --filter create-objectstack typecheck: VERDICT command-exit 0. The clitsc -p tsconfig.test.json --listFileslists both edited cli test files.@objectstack/restxlsx export and import tests (the 16 files underpackages/rest/srcthat touch xlsx or exceljs): 16 files, 737 tests passed.@objectstack/restis unchanged; these run exceljs onuuid11.1.1 through the workspace override.node scripts/sync-scaffold-emission-policy.mjs --self-test: exit 0, 61 assertions. Its--checkexited 1 on an unstamped key (overrides.uuid@… is"0.0.0-unstamped"but the policy declares"^11.1.1"). The write run then stamped it (1 value rewritten), and--checkexited 0.--no-inline-configover the 4 changed code files: exit 0. Control-byte scan over the 6 changed files: no hits.e7cf02f09with the fix committed first, throughscripts/ablation-replace.mjsin wrap mode. The later commits change only comments ininit.ts. The tests import../src, so nodist/is on their path.SCAFFOLD_UUID_OVERRIDE_RANGEchanged from^11.1.1to^11.1.0(anchor 1 to 0, blob827cf1e96177to33bed46cc4ef). Result:Tests 1 failed | 13 passed (14), failing onadmits 11.1.0, below the fix 11.1.1. Restored: blob equals HEAD,git diff HEADempty.SCAFFOLD_UUID_OVERRIDE_SELECTORwith its bound moved to13.0.0(anchor 1 to 0, blob827cf1e96177to98fd9e5105ca). Result: unit1 failed | 13 passed (14)(expected 13 to be 12), and nightly e2e1 failed | 10 passed (11)(npx create-objectstack must emit the shared npm overrides block). That second failure is the key-spelling drift the stamp script cannot see. Restored: blob equals HEAD,git diff HEADempty.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 103 commands over 6 paths, against merge basef7d740376. Each ran byte for byte, with its exit code recorded before any pipe: all 103 exited 0.--ran:103 derived, 103 run, 0 NOT-MEASURED, 0 UNRUN, exit 0. This includescheck:scaffold-emission-policy,check:template-version-sync,check:cross-package-test-inputsandcheck:pm-dispatch-gates.check-governed-merges --branch: 0 of 6 paths governed, 220 changed lines.Generated by Claude Code