diff --git a/CHANGELOG.md b/CHANGELOG.md index 094efd3..9483eca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/package-lock.json b/package-lock.json index b870dd5..f01a75c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7465,16 +7465,6 @@ "node": ">=10" } }, - "node_modules/@strapi/admin/node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@strapi/cloud-cli": { "version": "5.63.0", "resolved": "https://registry.npmjs.org/@strapi/cloud-cli/-/cloud-cli-5.63.0.tgz", @@ -8122,16 +8112,6 @@ "node": ">=10" } }, - "node_modules/@strapi/content-manager/node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@strapi/content-releases": { "version": "5.63.0", "resolved": "https://registry.npmjs.org/@strapi/content-releases/-/content-releases-5.63.0.tgz", @@ -8586,16 +8566,6 @@ "node": ">=10" } }, - "node_modules/@strapi/content-type-builder/node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@strapi/core": { "version": "5.63.0", "resolved": "https://registry.npmjs.org/@strapi/core/-/core-5.63.0.tgz", @@ -9168,16 +9138,6 @@ "node": ">=10" } }, - "node_modules/@strapi/core/node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@strapi/data-transfer": { "version": "5.63.0", "resolved": "https://registry.npmjs.org/@strapi/data-transfer/-/data-transfer-5.63.0.tgz", @@ -9769,16 +9729,6 @@ "node": ">=10" } }, - "node_modules/@strapi/email/node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@strapi/generators": { "version": "5.63.0", "resolved": "https://registry.npmjs.org/@strapi/generators/-/generators-5.63.0.tgz", @@ -10093,16 +10043,6 @@ "node": ">=10" } }, - "node_modules/@strapi/i18n/node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@strapi/icons": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/@strapi/icons/-/icons-2.3.1.tgz", @@ -10177,16 +10117,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@strapi/openapi/node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@strapi/permissions": { "version": "5.63.0", "resolved": "https://registry.npmjs.org/@strapi/permissions/-/permissions-5.63.0.tgz", @@ -11153,16 +11083,6 @@ "node": ">= 12" } }, - "node_modules/@strapi/types/node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@strapi/typescript-utils": { "version": "5.63.0", "resolved": "https://registry.npmjs.org/@strapi/typescript-utils/-/typescript-utils-5.63.0.tgz", @@ -11881,16 +11801,6 @@ "node": ">=10" } }, - "node_modules/@strapi/upload/node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@strapi/utils": { "version": "5.63.0", "resolved": "https://registry.npmjs.org/@strapi/utils/-/utils-5.63.0.tgz", @@ -12029,15 +11939,6 @@ "node": ">=10" } }, - "node_modules/@strapi/utils/node_modules/zod": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - }, "node_modules/@swc/core": { "version": "1.16.18", "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.16.18.tgz", diff --git a/package.json b/package.json index c078b94..ddd1352 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/tests/package.test.cjs b/tests/package.test.cjs index c6d4f15..667767b 100644 --- a/tests/package.test.cjs +++ b/tests/package.test.cjs @@ -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`); + } +});