[Aikido] Fix 9 security issues in fast-uri, mysql2, zod and 2 more#9
Open
aikido-autofix-us[bot] wants to merge 1 commit into
Open
[Aikido] Fix 9 security issues in fast-uri, mysql2, zod and 2 more#9aikido-autofix-us[bot] wants to merge 1 commit into
aikido-autofix-us[bot] wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrade dependencies to fix URI parsing SSRF bypasses, SQL injection via type confusion, and zlib decompression DoS attacks.
✅ zod (3.25.76 => 4.4.0):
The codebase uses zod in three locations:
cockpit/src/bridge/events-gateway.ts: UsesBaseEvent.extend()to create event schemas, butBaseEventhas no refinementssrc/config/env.ts: UsesEnvSchema.refine()but the schema is never used with.extend(),.pick(),.omit(), or.merge()src/routes/index.ts: Only imports zod but doesn't use it (uses Fastify JSON schemas instead)None of the breaking changes affect this codebase:
.extend()is only used onBaseEventwhich has no refinementsNo usage of
.pick(),.omit(), or.merge()on any schemasNo tuple schemas with defaults
No
z.undefined()on required propertiesNo
z.strictObject()intersections.url()validation is used but all URLs in the codebase are properly formatted with://No base64 or CUID validation
@hono/node-server (1.19.11 => 2.0.5):
The package appears in
package-lock.jsonbut is not listed inpackage.jsondependencies and is not imported or used anywhere in the codebase. The project already requires Node.js >=20.0.0 inpackage.json, which satisfies the new requirement.All breaking changes by upgrading mysql2 from version 3.15.3 to 3.23.1 (CHANGELOG)
All breaking changes by upgrading zod from version 3.25.76 to 4.4.3 (CHANGELOG)
.pick()and.omit()disallowed on object schemas containing refinements - now throws an error instead of silently dropping refinements.extend()disallowed on object schemas with refinements - throws error when overwriting existing properties.pick(),.omit()) now validate that the keys provided actually exist in the schema and throw errors for unrecognized keysz.strictObject()now only reject keys unrecognized by both sides instead of either sidez.undefined()are now treated as required - the key must be present even though its value may beundefined.merge()now throws when the receiver has refinements instead of silently producing ambiguous refinement behavior$defsentries no longer include redundantidfieldsatob()-style whitespace strippingAll breaking changes by upgrading @hono/node-server from version 1.19.11 to 2.0.5 (CHANGELOG)
@hono/node-server/vercel)✅ 9 CVEs resolved by this upgrade
This PR will resolve the following CVEs:
__proto__key as a normal property, allowing attackers to modify the prototype chain of validated objects and inject arbitrary inherited properties.globalThis.__bundlerPathsOverridesaccess allows attackers to manipulate the prototype chain and alter application behavior.🤖 Remediation details
Fix security vulnerabilities in fast-uri, mysql2, zod, @hono/node-server, and pino
Short summary
This PR remediates security vulnerabilities in five packages: fast-uri, mysql2, zod, @hono/node-server, and pino. All five were resolved through a combination of direct dependency bumps in the root
package.json, parent-chain bumps that carried transitive fixes, a lockfile-only refresh forfast-uri, and a targetedoverridesentry formysql2where no parent bump was possible. Thepackage-lock.jsonwas updated throughout via--package-lock-onlyoperations.fast-uri
fast-uriappeared as a transitive dependency in multiple nested paths, all resolved throughajv@8.20.0parents whose declared ranges (^3.0.1,^2.0.0) already permitted the patched versions. A lockfile-onlynpm update fast-uri --package-lock-onlywas sufficient to advance all instances: the3.xcopies moved from3.1.3to3.1.4, the2.xcopy moved from2.4.2to2.4.3, and after thefastifyv5 parent bump (see pino below) a4.xinstance also resolved at4.1.1. No manifest edit was required forfast-uriitself.mysql2
mysql2is pulled in exclusively byprisma, which exact-pins it at3.15.3across every publishedprismarelease including the latest. Because no version ofprismaresolvesmysql2to3.23.1or higher, a parent bump alone cannot fix this instance. Anoverridesentry"mysql2@3.15.3": "3.23.1"was added to the rootpackage.jsonas the only viable path, advancing the resolved version from3.15.3to3.23.1.zod
zodis a direct dependency in the rootpackage.json. The declared spec was advanced from^3.22.4to^4.4.0, which resolved to4.4.3in the lockfile. Theopenaipackage declareszod@^3.23.8as an optional peer; this conflict was handled with--legacy-peer-deps(consistent with how the prior install already treated it), andopenaicontinues to function with the newerzodmajor.@hono/node-server
@hono/node-serverwas a transitive dependency pulled in by@prisma/dev, which is itself a dependency ofprisma. Bumpingprismafrom^7.8.0to^7.9.0in the rootpackage.jsoncausedprisma@7.9.0to depend on@prisma/dev@0.24.14, which no longer includes@hono/node-serverat all. The vulnerable package was fully removed from the resolved tree as a result.@prisma/clientwas bumped in parallel from^7.8.0to^7.9.0to keep the two Prisma packages aligned.pino
pinois a direct dependency in the rootpackage.json; its spec was advanced from^9.14.0to^10.1.1, resolving to10.3.1at the root. However,fastify@4.xalso pulls in its own copy ofpinoand pins it to^9.0.0, leaving a vulnerablepino@9.14.0nested underfastify. Fixing that instance required bumpingfastifyfrom^4.26.2to^5.6.2in the rootpackage.json, sincefastify@5.xis the first major series that declarespino@^10.1.0. Two@fastifyplugins required companion major bumps for v5 compatibility:@fastify/helmetfrom^11.1.1to^13.1.0and@fastify/rate-limitfrom^9.1.0to^11.1.0. After these changes, both the rootpinoinstance and thefastify-nested instance resolve to10.3.1.Version changes
pino^9.14.0^10.1.1(resolves10.3.1)zod^3.22.4(resolves3.25.76)^4.4.0(resolves4.4.3)prisma^7.8.0(resolves7.8.0)^7.9.0(resolves7.9.0)@hono/node-servervia@prisma/dev@0.24.14@prisma/client^7.8.0^7.9.0prismaversion bumpfastify^4.26.2(resolves4.29.1)^5.6.2(resolves5.10.0)pino@9.14.0(fastify v5 requirespino@^10.1.0)@fastify/helmet^11.1.1^13.1.0@fastify/rate-limit^9.1.0^11.1.0mysql23.15.33.23.1prismaexact-pins this version; no parent bump available)fast-uri(3.xinstances)3.1.33.1.4ajv@8.20.0parent already permitted fixfast-uri(2.xinstance)2.4.22.4.3@fastify/ajv-compilerparent already permitted fixfast-uri(4.xinstance)4.1.1@hono/node-server1.19.11prismaparent bump to7.9.0