Skip to content

chore(deps): update dependency fastify to v5 [security]#18

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-fastify-vulnerability
Open

chore(deps): update dependency fastify to v5 [security]#18
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-fastify-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
fastify (source) ^3.29.5^5.0.0 age confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Fastify's Content-Type header tab character allows body validation bypass

CVE-2026-25223 / GHSA-jx2c-rxcm-jvmq

More information

Details

Impact

A validation bypass vulnerability exists in Fastify where request body validation schemas specified by Content-Type can be completely circumvented. By appending a tab character (\t) followed by arbitrary content to the Content-Type header, attackers can bypass body validation while the server still processes the body as the original content type.

For example, a request with Content-Type: application/json\ta will bypass JSON schema validation but still be parsed as JSON.

This vulnerability affects all Fastify users who rely on Content-Type-based body validation schemas to enforce data integrity or security constraints. The concrete impact depends on the handler implementation and the level of trust placed in the validated request body, but at the library level, this allows complete bypass of body validation for any handler using Content-Type-discriminated schemas.

This issue is a regression or missed edge case from the fix for a previously reported vulnerability.

Patches

This vulnerability has been patched in Fastify v5.7.2. All users should upgrade to this version or later immediately.

Workarounds

If upgrading is not immediately possible, user can implement a custom onRequest hook to reject requests containing tab characters in the Content-Type header:

fastify.addHook('onRequest', async (request, reply) => {
  const contentType = request.headers['content-type']
  if (contentType && contentType.includes('\t')) {
    reply.code(400).send({ error: 'Invalid Content-Type header' })
  }
})
Resources

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


fastify: request.protocol and request.host Spoofable via X-Forwarded-Proto/Host from Untrusted Connections

CVE-2026-3635 / GHSA-444r-cwp2-x5xf

More information

Details

Summary

When trustProxy is configured with a restrictive trust function (e.g., a specific IP like trustProxy: '10.0.0.1', a subnet, a hop count, or a custom function), the request.protocol and request.host getters read X-Forwarded-Proto and X-Forwarded-Host headers from any connection — including connections from untrusted IPs. This allows an attacker connecting directly to Fastify (bypassing the proxy) to spoof both the protocol and host seen by the application.

Affected Versions

fastify <= 5.8.2

Impact

Applications using request.protocol or request.host for security decisions (HTTPS enforcement, secure cookie flags, CSRF origin checks, URL construction, host-based routing) are affected when trustProxy is configured with a restrictive trust function.

When trustProxy: true (trust everything), both host and protocol trust all forwarded headers — this is expected behavior. The vulnerability only manifests with restrictive trust configurations.

Severity

  • CVSS Score: 6.1 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

fastify/fastify (fastify)

v5.8.3

Compare Source

⚠️ Security Release

This fixes CVE CVE-2026-3635 GHSA-444r-cwp2-x5xf.

What's Changed

New Contributors

Full Changelog: fastify/fastify@v5.8.2...v5.8.3

v5.8.2

Compare Source

What's Changed

New Contributors

Full Changelog: fastify/fastify@v5.8.1...v5.8.2

v5.8.1

Compare Source

⚠️ Security Release

Fixes "Missing End Anchor in "subtypeNameReg" Allows Malformed Content-Types to Pass Validation": GHSA-573f-x89g-hqp9.

CVE-2026-3419

Full Changelog: fastify/fastify@v5.8.0...v5.8.1

v5.8.0

Compare Source

What's Changed

New Contributors

Full Changelog: fastify/fastify@v5.7.4...v5.8.0

v5.7.4

Compare Source

Full Changelog: fastify/fastify@v5.7.3...v5.7.4

v5.7.3

Compare Source

⚠️ Security Release
What's Changed

Full Changelog: fastify/fastify@v5.7.2...v5.7.3

v5.7.2

Compare Source

⚠️ Notice ⚠️

Parsing of the content-type header has been improved to a strict parser in PR #​6414. This means only header values in the form described in RFC 9110 are accepted.

What's Changed

New Contributors

Full Changelog: fastify/fastify@v5.7.1...v5.7.2

v5.7.1

Compare Source

What's Changed

Full Changelog: fastify/fastify@v5.7.0...v5.7.1

v5.7.0

Compare Source

What's Changed

New Contributors

Full Changelog: fastify/fastify@v5.6.2...v5.7.0

v5.6.2

Compare Source

v5.6.1

Compare Source

What's Changed

New Contributors

Full Changelog: fastify/fastify@v5.6.0...v5.6.1

v5.6.0

Compare Source

What's Changed

New Contributors

Full Changelog: fastify/fastify@v5.5.0...v5.6.0

v5.5.0

Compare Source

What's Changed

New Contributors

Full Changelog: fastify/fastify@v5.4.0...v5.5.0

v5.4.0

Compare Source

What's Changed

Note

PR body was truncated to here.


Configuration

📅 Schedule: (in timezone Asia/Shanghai)

  • 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from da7f627 to a4f4577 Compare February 18, 2026 07:59
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from a0549a8 to 5c91885 Compare February 25, 2026 08:41
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from 217504a to 851e287 Compare March 14, 2026 12:57
@renovate renovate Bot changed the title chore(deps): update dependency fastify to v5 [security] chore(deps): update dependency fastify to v5 [security] - autoclosed Mar 28, 2026
@renovate renovate Bot closed this Mar 28, 2026
@renovate renovate Bot deleted the renovate/npm-fastify-vulnerability branch March 28, 2026 02:37
@renovate renovate Bot changed the title chore(deps): update dependency fastify to v5 [security] - autoclosed chore(deps): update dependency fastify to v5 [security] Mar 31, 2026
@renovate renovate Bot reopened this Mar 31, 2026
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from 851e287 to a456520 Compare March 31, 2026 08:38
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 3 times, most recently from 1b2d1cb to a431a7e Compare April 19, 2026 09:48
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from a431a7e to 1b03332 Compare April 26, 2026 20:49
@renovate renovate Bot changed the title chore(deps): update dependency fastify to v5 [security] chore(deps): update dependency fastify to v5 [security] - autoclosed Apr 27, 2026
@renovate renovate Bot closed this Apr 27, 2026
@renovate renovate Bot changed the title chore(deps): update dependency fastify to v5 [security] - autoclosed chore(deps): update dependency fastify to v5 [security] Apr 27, 2026
@renovate renovate Bot reopened this Apr 27, 2026
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 3 times, most recently from 230e77b to 5af2f99 Compare April 29, 2026 16:30
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 3 times, most recently from 6fb586e to cc9daf2 Compare May 12, 2026 15:00
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from 6254b99 to 0fe6748 Compare May 18, 2026 10:31
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 0fe6748 to 1a0603f Compare May 28, 2026 21:54
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 1a0603f to 8ff7fe0 Compare June 1, 2026 19:33
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 8ff7fe0 to f2624b5 Compare June 11, 2026 18:45
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b52d9a7d-8f20-4d7a-8bca-d8752c3ee0af

📥 Commits

Reviewing files that changed from the base of the PR and between f2624b5 and d0cb603.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

📝 Walkthrough

Walkthrough

This pull request updates the fastify development dependency in package.json from version ^3.29.5 to ^5.0.0. This is a major version bump that advances the framework dependency across two major releases.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating fastify dependency to v5 for security reasons.
Description check ✅ Passed The description is detailed and directly related to the changeset, documenting the security vulnerabilities being addressed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch renovate/npm-fastify-vulnerability

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Line 42: The package currently depends on fastify "^5.0.0", which introduces
breaking API changes; either pin fastify to a v3/v4-compatible version or
migrate code to v5: update all fastify.listen(port) calls to fastify.listen({
port }), audit all fastify.register(...) usages and plugin imports to use v4+
naming (e.g., replace fastify-static with `@fastify/static`) and ensure
fastify-graceful-shutdown and `@types/fastify-static` are version-compatible or
replaced, and run a code search for ".listen(" without an options object and for
"fastify.register" to locate and fix remaining call sites.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a734e73c-622c-4dea-b0e0-8415aa45b687

📥 Commits

Reviewing files that changed from the base of the PR and between b3e94d6 and f2624b5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • package.json

Comment thread package.json Outdated
"@types/fastify-static": "^2.2.3",
"@types/node": "^14.18.63",
"fastify": "^3.29.5",
"fastify": "^5.0.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Critical breaking changes in Fastify v5 will cause test failures.

This major version jump from v3 to v5 introduces multiple breaking changes that affect the codebase:

  1. listen() API signature changed (v4+): The test helper at sri-plugin/examples/wsi-test-helper.js:103 calls await fastify.listen(port), but Fastify v4+ requires an options object: await fastify.listen({ port }). This will throw a TypeError at runtime.

  2. Plugin compatibility concerns: The related plugins fastify-static@^4.7.0 (line 44) and fastify-graceful-shutdown@^4.0.1 (line 43) need verification for Fastify v5 compatibility. Additionally, fastify-static was renamed to @fastify/static in the Fastify v4 ecosystem.

  3. Type definitions: @types/fastify-static@^2.2.3 (line 40) may not provide correct types for Fastify v5.

Run the following script to verify Fastify usage patterns and check for additional breaking changes:

#!/bin/bash
# Description: Find all Fastify usage in the codebase and check for v3-style API calls

echo "=== Searching for Fastify instantiation and listen() calls ==="
rg -n -A 5 -B 2 'Fastify\s*\(' --type=js

echo -e "\n=== Searching for .listen( calls that may need migration ==="
rg -n -P '\.listen\s*\(\s*(?!{)' --type=js

echo -e "\n=== Searching for fastify plugin registrations ==="
rg -n 'fastify\.register\(' --type=js -A 2

Additionally, search the web for migration guidance:

Fastify v3 to v5 migration guide breaking changes
fastify-static v4 compatibility with Fastify v5
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 42, The package currently depends on fastify "^5.0.0",
which introduces breaking API changes; either pin fastify to a v3/v4-compatible
version or migrate code to v5: update all fastify.listen(port) calls to
fastify.listen({ port }), audit all fastify.register(...) usages and plugin
imports to use v4+ naming (e.g., replace fastify-static with `@fastify/static`)
and ensure fastify-graceful-shutdown and `@types/fastify-static` are
version-compatible or replaced, and run a code search for ".listen(" without an
options object and for "fastify.register" to locate and fix remaining call
sites.

@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from f2624b5 to d0cb603 Compare June 15, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants