Skip to content

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

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

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

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate bot commented Oct 11, 2022

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
fastify (source) ^4.3.0^5.8.3 age confidence
fastify (source) 4.3.05.8.3 age confidence

GitHub Vulnerability Alerts

CVE-2022-39288

Impact

An attacker can send an invalid Content-Type header that can cause the application to crash, leading to a possible Denial of Service attack. Only the v4.x line is affected.

(This was updated: upon a close inspection, v3.x is not affected after all).

Patches

Yes, update to > v4.8.0.

Workarounds

You can reject the malicious content types before the body parser enters in action.

  const badNames = Object.getOwnPropertyNames({}.__proto__)
  fastify.addHook('onRequest', async (req, reply) => {
    for (const badName of badNames) {
      if (req.headers['content-type'].indexOf(badName) > -1) {
        reply.code(415)
        throw new Error('Content type not supported')
      }
    }
  })

References

See the HackerOne report #​1715536

For more information

Fastify security policy

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:N/A:H

CVE-2022-41919

Impact

The attacker can use the incorrect Content-Type to bypass the Pre-Flight checking of fetch. fetch() requests with Content-Type’s essence as "application/x-www-form-urlencoded", "multipart/form-data", or "text/plain", could potentially be used to invoke routes that only accepts application/json content type, thus bypassing any CORS protection, and therefore they could lead to a Cross-Site Request Forgery attack.

Patches

For 4.x users, please update to at least 4.10.2
For 3.x users, please update to at least 3.29.4

Workarounds

Implement Cross-Site Request Forgery protection using @fastify/csrf.

References

Check out the HackerOne report: https://hackerone.com/reports/1763832.

For more information

Fastify security policy

Severity
  • CVSS Score: 4.2 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N

CVE-2026-25223

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

CVE-2026-25224

Impact

A Denial of Service vulnerability in Fastify’s Web Streams response handling can allow a remote client to exhaust server memory. Applications that return a ReadableStream (or Response with a Web Stream body) via reply.send() are impacted. A slow or non-reading client can trigger unbounded buffering when backpressure is ignored, leading to process crashes or severe degradation.

Patches

The issue is fixed in Fastify 5.7.3. Users should upgrade to 5.7.3 or later.

Workarounds

Avoid sending Web Streams from Fastify responses (e.g., ReadableStream or Response bodies). Use Node.js streams (stream.Readable) or buffered payloads instead until the project can upgrade.

References

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

CVE-2026-3635

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

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

Configuration

📅 Schedule: (in timezone America/Los_Angeles)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates 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 changed the title chore(deps): update dependency fastify to 4.8.1 [security] chore(deps): update dependency fastify to 4.10.2 [security] Mar 18, 2023
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from d60ca18 to 9f72d55 Compare March 18, 2023 12:04
@renovate renovate bot changed the title chore(deps): update dependency fastify to 4.10.2 [security] chore(deps): update dependency fastify to v4.10.2 [security] Mar 25, 2023
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from 9f72d55 to 3b19bd0 Compare April 3, 2023 10:57
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from 3b19bd0 to caaa401 Compare April 17, 2023 12:56
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from caaa401 to d5c2860 Compare May 28, 2023 12:20
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from d5c2860 to 39e49cd Compare October 19, 2023 15:02
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from 39e49cd to 2656ce2 Compare November 30, 2023 16:33
@renovate renovate bot requested a review from trevor-scheer as a code owner November 30, 2023 16:33
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from 2656ce2 to d72a0a7 Compare January 30, 2024 12:52
@renovate
Copy link
Copy Markdown
Contributor Author

renovate bot commented Feb 4, 2024

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: package-lock.json
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: apollo-server-integration-fastify@0.0.0
npm ERR! Found: fastify@4.3.0
npm ERR! node_modules/fastify
npm ERR!   dev fastify@"4.3.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer fastify@"4.10.2" from apollo-server-integration-fastify@0.0.0
npm ERR! packages/fastify
npm ERR!   apollo-server-integration-fastify@0.0.0
npm ERR!   node_modules/apollo-server-integration-fastify
npm ERR!     workspace packages/fastify from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: fastify@4.10.2
npm ERR! node_modules/fastify
npm ERR!   peer fastify@"4.10.2" from apollo-server-integration-fastify@0.0.0
npm ERR!   packages/fastify
npm ERR!     apollo-server-integration-fastify@0.0.0
npm ERR!     node_modules/apollo-server-integration-fastify
npm ERR!       workspace packages/fastify from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /tmp/renovate/cache/others/npm/_logs/2024-04-25T08_58_32_860Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /tmp/renovate/cache/others/npm/_logs/2024-04-25T08_58_32_860Z-debug-0.log

@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from d72a0a7 to 8c32c16 Compare May 29, 2025 18:54
@renovate renovate bot requested a review from glasser as a code owner May 29, 2025 18:54
@apollo-bot2
Copy link
Copy Markdown

Detected SAST Vulnerabilities

@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from 8c32c16 to d37c07a Compare August 10, 2025 12:25
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from d37c07a to 7327601 Compare October 21, 2025 16:42
@renovate renovate bot changed the title chore(deps): update dependency fastify to v4.10.2 [security] chore(deps): update dependency fastify to v4.10.2 [security] - autoclosed Dec 18, 2025
@renovate renovate bot closed this Dec 18, 2025
@renovate renovate bot deleted the renovate/npm-fastify-vulnerability branch December 18, 2025 06:24
@renovate renovate bot changed the title chore(deps): update dependency fastify to v4.10.2 [security] - autoclosed chore(deps): update dependency fastify to v4.10.2 [security] Dec 18, 2025
@renovate renovate bot reopened this Dec 18, 2025
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from 7327601 to a2094f0 Compare December 18, 2025 08:35
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from a2094f0 to 3194f51 Compare February 2, 2026 23:34
@renovate renovate bot changed the title chore(deps): update dependency fastify to v4.10.2 [security] chore(deps): update dependency fastify to v5 [security] Feb 2, 2026
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch 4 times, most recently from e80f24b to e185de2 Compare February 17, 2026 22:44
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from b088bf9 to 98b8242 Compare March 6, 2026 02:05
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from 9f7472e to e290308 Compare March 13, 2026 14:33
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from e290308 to 525ed12 Compare March 25, 2026 21:11
@renovate renovate bot changed the title chore(deps): update dependency fastify to v5 [security] chore(deps): update dependency fastify to v5 [security] - autoclosed Mar 27, 2026
@renovate renovate bot closed this Mar 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] Mar 30, 2026
@renovate renovate bot reopened this Mar 30, 2026
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch 4 times, most recently from 3e7ba90 to c65238c Compare April 1, 2026 23:13
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from c65238c to fdfc955 Compare April 8, 2026 19:49
@renovate renovate bot force-pushed the renovate/npm-fastify-vulnerability branch from fdfc955 to 820eecf Compare April 8, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant