Repository navigation
chore(deps): bump mysql2 and fast-uri past audited vulnerabilities - #30314
Conversation
npm audit on [email protected] reports two mysql2 advisories: - GHSA-3f6p-5ww8-9rcr (high): a server can downgrade authentication to mysql_clear_password and read the password in plaintext. Fixed in 3.22.0. - GHSA-rgwj-5xj2-c3m3 (moderate): unbounded zlib inflate in the compressed protocol handler. Fixed in 3.23.1. Bump the CLI's mysql2 pin from 3.15.3 to 3.24.4. Prisma Studio is its only consumer. pnpm audit --prod also fails on four fast-uri advisories reached through @prisma/dev > @prisma/streams-local > ajv, which fail the audit step on every PR to this branch. Raise the existing fast-uri override floor from 3.1.5 to 3.1.6. Refs #30295 Co-Authored-By: Claude Opus 5 <[email protected]> Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]>
|
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: ASSERTIVE Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe pull request updates the CLI ChangesDependency updates
Priority: ⬆️ High Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Other · Severity of issue fixed: High Suggested reviewers: Merge Risk: ⚪ Minimal · up to The dependency updates address the reported vulnerability floors, so the change is mergeable with normal checks. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation The PR updates Resolution Update the applicable Prisma package dependency or override so that Full details: Out of Scope Changes checkExplanation The PR raises the
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use Comment |
size-limit report 📦
|
…5.4 with its IPv6 parsing change (#30668) Every pull request to `v7` currently fails CI, whatever it changes. Here is what [#30368](#30368), a one-line client fix, gets today: ``` Lint pnpm audit --prod -> 7 vulnerabilities found (5 high, 2 moderate) macOS (3 jobs) brew install mysql -> compiles MySQL 26.7.0 from source -> make: *** [all] Error 2 ``` This PR makes `v7` CI pass again in three ways: 1. It updates the two vulnerable dependencies that have patched releases: `mariadb` and `source-map-js`. 2. It tells `pnpm audit` to ignore two advisories, for `braces` and `sprintf-js`. These have no patched release, and Prisma can't be attacked through them. 3. It moves the macOS jobs from the deprecated `macos-14` runner to `macos-latest`. The `mariadb` update reaches users. `@prisma/adapter-mariadb` now depends on `mariadb` 3.5.4 instead of 3.5.3, and it stops rewriting IPv6 hosts in connection strings, because 3.5.4 accepts them as written. Without that second change, the update would break IPv6 connections. ## Why CI broke without a code change `v7` last passed CI on 16 September. Nothing in the repository broke it. Two things outside the repository changed after that date. ### New security advisories fail the audit step The Lint job ends with `pnpm audit --prod`. That step fails when any production dependency has a known advisory. Since 16 September, advisories were published against four packages in our lockfile: | Package | Reached through | Advisories | What this PR does | | --- | --- | --- | --- | | `mariadb` 3.5.3 | `@prisma/adapter-mariadb`, a direct dependency | 4 (3 high) | Bumps it to 3.5.4, a patch release with the fixes | | `source-map-js` 1.2.1 | `@prisma/config` > `c12` > `magicast` | 1 (high) | Adds a pnpm override that forces at least 1.2.2 | | `braces` 3.0.3 | `@prisma/client-generator-ts` > `fast-glob` > `micromatch` | [GHSA-vfj7-8cjw-p6xm](GHSA-vfj7-8cjw-p6xm) (high) | Ignores it | | `sprintf-js` 1.1.3 | `@prisma/adapter-mssql` > `mssql` > `tedious` | [GHSA-hp3w-g68c-fv3c](GHSA-hp3w-g68c-fv3c) (moderate) | Ignores it | The first two have fixes, so we take them. The overrides follow the same pattern as [#30314](#30314), the previous audit fix on `v7`. The last two can't be fixed by upgrading. Their advisories name 3.0.4 and 1.1.4 as the patched versions, but neither version exists on npm: 3.0.3 and 1.1.3 are the latest releases. Both advisories describe a crash that happens only when an attacker controls the input string, and in Prisma no attacker can: - The generator calls `fast-glob`, which uses `braces`, only with patterns built from the user's own output folder (`generateClient.ts`). - `tedious`, the SQL Server driver, calls `sprintf` only with its own fixed message templates, for debug output and error messages. So `pnpm-workspace.yaml` now lists both advisory IDs under `auditConfig.ignoreGhsas`, with this reason written next to them. Once fixed releases exist, the ignores can go. ### Updating `mariadb` needs a change to the adapter `mariadb` 3.5.3 parsed connection strings with a regular expression that rejected the colons in a bracketed IPv6 host such as `[::1]`. So `@prisma/adapter-mariadb` rewrote that host to a percent-encoded form, which the old parser decoded back into `::1` ([#29026](#29026)): ``` mariadb://user:pass@[::1]:3306/db -> mariadb://user:pass@%3A%3A1:3306/db ``` `mariadb` 3.5.4 parses connection strings with the standard `URL` parser instead, and it accepts `[::1]` as written. It no longer decodes the host, so the rewritten string made the driver look up a host literally named `%3A%3A1`. The adapter's IPv6 tests caught this. The adapter now passes the bracketed host through unchanged, and the tests check that the driver accepts it and connects to a server listening on `::1`. The release notes for 3.5.4 don't mention this parser change. Its other changes are security limits, such as the new `maxAllowedColumns` option, and bug fixes. ### Homebrew dropped macOS 14 The cross-platform test jobs run on Windows and macOS, and on macOS they install MySQL with `brew install mysql`. Homebrew no longer ships prebuilt packages for macOS 14, so that command now compiles MySQL from source, and the compile fails. GitHub has deprecated the `macos-14` runner as well. We pinned `macos-14` in [#22904](#22904) in March 2024, when it was the newest runner, and nobody moved the pin after that. This PR switches those jobs, and `build-engine-branch.yml`, to `macos-latest`, which is macOS 26 on Apple Silicon today. The same jobs already use `windows-latest`, and one other macOS job in `test-template.yml` already used `macos-latest`. ## How it was checked - `pnpm audit --prod` exits 0 locally. The lockfile diff touches only `mariadb`, `source-map-js` and `iconv-lite`, which `mariadb` 3.5.4 depends on. - The `@prisma/adapter-mariadb` unit tests pass locally, including the IPv6 test that connects to a server on `::1`. - ESLint and Prettier pass on every changed file. - The macOS change can only be checked by this PR's own CI run. Agent: nestor-69 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: willbot <[email protected]> Signed-off-by: Will Madden <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@prisma/client](https://www.prisma.io) ([source](https://github.com/prisma/orm/tree/HEAD/packages/client)) | imports | patch | [`7.10.0` -> `7.10.1`](https://renovatebot.com/diffs/npm/@prisma%2fclient/7.10.0/7.10.1) | --- ### Release Notes <details> <summary>prisma/orm (@​prisma/client)</summary> ### [`v7.10.1`](https://github.com/prisma/orm/releases/tag/7.10.1) [Compare Source](prisma/orm@7.10.0...7.10.1) Prisma ORM 7.10.1 is a patch release. It fixes a bug where a nested interactive transaction could make later, unrelated transactions run inside the wrong transaction. It also updates dependencies that had security advisories. ##### Fixes ##### Prisma Client: nested `$transaction` no longer changes the options object you pass in If you passed the same options object to a nested `tx.$transaction(...)` and later to a top-level `prisma.$transaction(...)`, the nested call wrote the outer transaction's id into that object. Every later top-level transaction that used the object was then treated as nested inside that old transaction: - if the old transaction had committed, the new one failed with `P2028`; - if the old transaction was still open, the new one silently ran as a savepoint inside another request's transaction. ```ts const TX_OPTIONS = { timeout: 30_000, maxWait: 10_000 } await prisma.$transaction(async (tx) => { await tx.$transaction(async (inner) => { /* ... */ }, TX_OPTIONS) }) // Before 7.10.1, this call could fail with P2028 or join another transaction. await prisma.$transaction(async (tx) => { /* ... */ }, TX_OPTIONS) ``` Prisma Client no longer modifies the options object. ([#​30368](prisma/orm#30368), thanks [@​lazerg](https://github.com/lazerg)) ##### Prisma Migrate: refuse a shadow database that is the main database Prisma Migrate now refuses to run with error `P3025` when the shadow database URL points at the same database as the main database URL. Before, `prisma migrate diff --from-migrations` with that setup dropped the real schema, rebuilt it from the migrations, and reported an empty diff. ([prisma/prisma-engines#5851](prisma/prisma-engines#5851)) ##### MariaDB adapter: updated to `mariadb` 3.5.4 `@prisma/adapter-mariadb` now depends on `mariadb` 3.5.4, which fixes several security advisories in 3.5.3. The adapter no longer rewrites IPv6 hosts in connection strings, because `mariadb` 3.5.4 accepts them as written. IPv6 connection strings keep working without changes. ([#​30668](prisma/orm#30668)) ##### Dependency updates Dependencies with security advisories were updated: `mysql2`, `fast-uri`, `deepmerge-ts`, `mariadb` and `source-map-js`. ([#​30314](prisma/orm#30314), [#​30189](prisma/orm#30189), [#​30668](prisma/orm#30668)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNjguMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE2OC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://git.oirnoir.dev/OIRNOIR/YouTube-Helper-Server/pulls/59
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@prisma/adapter-pg](https://github.com/prisma/orm) ([source](https://github.com/prisma/orm/tree/HEAD/packages/adapter-pg)) | imports | patch | [`7.10.0` -> `7.10.1`](https://renovatebot.com/diffs/npm/@prisma%2fadapter-pg/7.10.0/7.10.1) | --- ### Release Notes <details> <summary>prisma/orm (@​prisma/adapter-pg)</summary> ### [`v7.10.1`](https://github.com/prisma/orm/releases/tag/7.10.1) [Compare Source](prisma/orm@7.10.0...7.10.1) Prisma ORM 7.10.1 is a patch release. It fixes a bug where a nested interactive transaction could make later, unrelated transactions run inside the wrong transaction. It also updates dependencies that had security advisories. ##### Fixes ##### Prisma Client: nested `$transaction` no longer changes the options object you pass in If you passed the same options object to a nested `tx.$transaction(...)` and later to a top-level `prisma.$transaction(...)`, the nested call wrote the outer transaction's id into that object. Every later top-level transaction that used the object was then treated as nested inside that old transaction: - if the old transaction had committed, the new one failed with `P2028`; - if the old transaction was still open, the new one silently ran as a savepoint inside another request's transaction. ```ts const TX_OPTIONS = { timeout: 30_000, maxWait: 10_000 } await prisma.$transaction(async (tx) => { await tx.$transaction(async (inner) => { /* ... */ }, TX_OPTIONS) }) // Before 7.10.1, this call could fail with P2028 or join another transaction. await prisma.$transaction(async (tx) => { /* ... */ }, TX_OPTIONS) ``` Prisma Client no longer modifies the options object. ([#​30368](prisma/orm#30368), thanks [@​lazerg](https://github.com/lazerg)) ##### Prisma Migrate: refuse a shadow database that is the main database Prisma Migrate now refuses to run with error `P3025` when the shadow database URL points at the same database as the main database URL. Before, `prisma migrate diff --from-migrations` with that setup dropped the real schema, rebuilt it from the migrations, and reported an empty diff. ([prisma/prisma-engines#5851](prisma/prisma-engines#5851)) ##### MariaDB adapter: updated to `mariadb` 3.5.4 `@prisma/adapter-mariadb` now depends on `mariadb` 3.5.4, which fixes several security advisories in 3.5.3. The adapter no longer rewrites IPv6 hosts in connection strings, because `mariadb` 3.5.4 accepts them as written. IPv6 connection strings keep working without changes. ([#​30668](prisma/orm#30668)) ##### Dependency updates Dependencies with security advisories were updated: `mysql2`, `fast-uri`, `deepmerge-ts`, `mariadb` and `source-map-js`. ([#​30314](prisma/orm#30314), [#​30189](prisma/orm#30189), [#​30668](prisma/orm#30668)) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNjguMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE2OC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://git.oirnoir.dev/OIRNOIR/YouTube-Helper-Server/pulls/58
Summary
npm auditon[email protected]reports high-severity findings in dependencies that Prisma pins (#30295). Thedeepmerge-tsfinding is already fixed on this branch by #30189 but is unreleased. This PR fixes the rest:mysql23.15.3 → 3.24.4 inpackages/cli. Prisma Studio's MySQL connection is its only consumer.mysql_clear_passwordand read the password in plaintext. Fixed in 3.22.0.fast-urioverride floor 3.1.5 → 3.1.6 inpnpm-workspace.yaml. Fourfast-uriadvisories reach the lockfile through@prisma/dev→@prisma/streams-local→ajv, and they fail thepnpm audit --prodstep on every PR tov7. Users are not affected, because a fresh install already resolvesfast-urito 3.1.8.The lockfile diff is limited to
mysql2, its dependencies, andfast-uri.Behavior changes for Studio users
mysql23.22.0 stops accepting a server's request formysql_clear_password. That is the fix for the high-severity advisory. Servers that require it, such as AWS RDS IAM authentication, now need?enableCleartextPlugin=trueon the URL.normalizeMySQLConnectionStringkeeps that parameter, andmysql2parses it totrue.@types/nodebecomes a peer dependency ofprisma's dependency tree. Starting with 3.18.0,mysql2declares@types/node: ">= 8"as a required peer dependency, and no fixed version drops it. npm 7+ and pnpm install required peers automatically, so projects without@types/nodewill get it after upgrading. It is types only. If that is unwanted, the alternative is to movemysql2todevDependenciesso the CLI build bundles it, which is a larger change to the bundle.Testing performed
pnpm audit --prod: before, 6 findings (2mysql2, 4fast-uri). After, "No known vulnerabilities found".vitest run src/__tests__/Studio.vitest.tsinpackages/cli: 31 passed. These tests mockmysql2, so they don't exercise the new version.pnpm run tscinpackages/cli: passes.prisma studio --url "mysql://…?connection_limit=2", and confirmed frompackages/clithatmysql2resolves to 3.24.4. I then posted to Studio's/bffendpoint:SELECTwith ajson-parsetransformation, which returned the rows with parsed JSONSELECT, which returned the matching rowtransactionthat inserts a value containing a single quote and reads it back, which round-tripped the valueER_NO_SUCH_TABLEas a serialized errorRelease
Users only get these fixes, and the
deepmerge-tsfix from #30189, from a new7.xrelease. Merging intov7does not close #30295 or #30052, so close them when that release ships.🤖 Generated with Claude Code
Summary by CodeRabbit