Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [Unreleased]

### Security

* zod [GHSA-mrhx-c7xc-m3w5](https://github.com/advisories/GHSA-mrhx-c7xc-m3w5) (a large array can exhaust memory during validation; fixed in zod 4.6.6). The plugin's own request validation already runs on zod ^4.6.7, and every array it parses has an upper bound. `@strapi/utils` 5.63.0, a runtime dependency of the plugin, pins zod 4.4.3: the plugin's lockfile now overrides that copy to ^4.6.7, and a regression test fails when any zod 4 below 4.6.6 comes back into the lockfile.
* npm reads `overrides` only in the root project, so a Strapi 5.63 app still installs zod 4.4.3 for its own `@strapi/*` packages until Strapi raises that pin. To patch the app now, add `"overrides": { "zod@4.4.3": "^4.6.7" }` to the app's `package.json`, reinstall and run your tests: zod 4.5 made some string formats stricter.

## [4.0.4](https://github.com/Schero94/Magicmark/compare/v4.0.3...v4.0.4) (2026-11-18)


Expand Down
99 changes: 0 additions & 99 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
"optional": true
}
},
"overrides": {
"zod@4.4.3": "^4.6.7"
},
"engines": {
"node": "^22.22.2 || >=24.15.0",
"npm": ">=6.0.0"
Expand Down
24 changes: 24 additions & 0 deletions tests/package.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,27 @@ test('CI and Dependabot are set up like the other plugins (CI-1, REL-2)', () =>
}
assert.ok(fs.existsSync(path.join(root, '.github/dependabot.yml')));
});

test('every zod 4 in the lockfile has the GHSA-mrhx-c7xc-m3w5 fix (DEP-02)', () => {
// zod < 4.6.6 collects one issue per failing array element without a cap, so a large array
// can exhaust memory. @strapi/utils 5.63.0 (a runtime dependency) pins zod 4.4.3; the
// `zod@4.4.3` override lifts that copy to the plugin's own ^4.6.7. zod 3.25.76 (koa-body and
// koa-session under the @strapi/strapi devDependency) has no patched 3.x release and is dev-only.
assert.equal(pkg.overrides?.['zod@4.4.3'], pkg.dependencies.zod);
const lock = JSON.parse(fs.readFileSync(path.join(root, 'package-lock.json'), 'utf8'));
const atLeast = (version, [major, minor, patch]) => {
const [a, b, c] = version.split('.').map((part) => Number.parseInt(part, 10));
return a !== major ? a > major : b !== minor ? b > minor : c >= patch;
};
const copies = Object.entries(lock.packages).filter(([key]) =>
/(^|\/)node_modules\/zod$/.test(key)
);
assert.ok(copies.length > 0, 'zod is in the lockfile');
for (const [key, entry] of copies) {
if (entry.version.startsWith('3.')) {
assert.equal(entry.dev, true, `${key} ${entry.version} is dev-only`);
continue;
}
assert.ok(atLeast(entry.version, [4, 6, 6]), `${key} is ${entry.version}, needs >= 4.6.6`);
}
});