Skip to content

Update dependency fastify to v5 [SECURITY]#90

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

Update dependency fastify to v5 [SECURITY]#90
renovate[bot] wants to merge 1 commit into
mainfrom
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.1.0^5.0.0 age confidence

fastify vulnerable to denial of service via malicious Content-Type

CVE-2022-39288 / GHSA-455w-c45v-86rg

More information

Details

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

References

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


Fastify: Incorrect Content-Type parsing can lead to CSRF attack

CVE-2022-41919 / GHSA-3fjj-p79j-c9hh

More information

Details

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

References

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


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

Note

PR body was truncated to here.


Configuration

📅 Schedule: (in timezone Asia/Tokyo)

  • Branch creation
    • ""
  • 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 from ad37c2d to d03e7d7 Compare February 2, 2023 20:50
@renovate renovate Bot changed the title Update dependency fastify to v4.8.1 [SECURITY] Update dependency fastify to v4.10.2 [SECURITY] Feb 2, 2023
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from d03e7d7 to 1631858 Compare March 18, 2023 23:57
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 1631858 to 7646222 Compare April 3, 2023 16:30
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 7646222 to 1e79e89 Compare April 17, 2023 14:15
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 1e79e89 to 15f380b Compare May 28, 2023 09:15
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 15f380b to 94ef381 Compare June 4, 2023 10:34
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from 8c16b67 to 602c1c2 Compare June 18, 2023 08:33
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 602c1c2 to 5d47652 Compare June 29, 2023 09:40
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from 562ab32 to 399f0c1 Compare July 9, 2023 09:55
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 399f0c1 to 0d3d5cf Compare July 19, 2023 11:11
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 0d3d5cf to f920122 Compare July 27, 2023 18:39
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from f920122 to 1432d11 Compare August 9, 2023 12:47
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from af4b909 to 2c9e150 Compare August 27, 2023 08:28
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 2c9e150 to 15a7916 Compare September 19, 2023 11:45
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from d09ce25 to f83459b Compare September 28, 2023 14:12
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from abf2738 to 7e20b19 Compare October 15, 2023 09:42
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 7e20b19 to bb4d2f3 Compare October 23, 2023 15:23
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from bb4d2f3 to 5246efa Compare November 6, 2023 09:14
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 5246efa to 6e2ddac Compare November 16, 2023 09:55
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 6e2ddac to d89bee9 Compare December 3, 2023 12:33
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from d89bee9 to 31ea73e Compare January 28, 2024 10:07
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 31ea73e to ed1008b Compare February 4, 2024 10:11
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from ed1008b to 13a68a6 Compare February 25, 2024 09:33
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 13a68a6 to 97fc443 Compare March 12, 2024 09:45
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 7c19eab to 27dc8ed Compare February 9, 2025 12:24
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 27dc8ed to 95cf067 Compare March 3, 2025 16:42
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 95cf067 to 73b0b4f Compare May 19, 2025 16:56
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from 6aac200 to 5423cb2 Compare August 13, 2025 16:41
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 5423cb2 to e4b1e54 Compare August 31, 2025 10:46
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from e4b1e54 to f8b253f Compare September 25, 2025 16:13
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from f8b253f to 3fbcfa8 Compare October 21, 2025 11:05
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 3fbcfa8 to 12e3fd5 Compare November 11, 2025 00:01
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 12e3fd5 to 45b56d7 Compare December 31, 2025 15:28
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 45b56d7 to 897dde6 Compare January 19, 2026 17:39
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 897dde6 to 791a1a2 Compare February 3, 2026 00:58
@renovate renovate Bot changed the title Update dependency fastify to v4.10.2 [SECURITY] Update dependency fastify to v5 [SECURITY] Feb 3, 2026
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch 2 times, most recently from 915d2d5 to e039fb9 Compare February 17, 2026 14:13
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from e039fb9 to 23f8249 Compare March 5, 2026 20:16
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 23f8249 to 295171e Compare March 13, 2026 16:00
@renovate renovate Bot force-pushed the renovate/npm-fastify-vulnerability branch from 295171e to e6153af Compare March 25, 2026 21:19
@renovate renovate Bot changed the title Update dependency fastify to v5 [SECURITY] Update dependency fastify to v5 [SECURITY] - autoclosed Mar 27, 2026
@renovate renovate Bot closed this Mar 27, 2026
@renovate renovate Bot deleted the renovate/npm-fastify-vulnerability branch March 27, 2026 00:39
@renovate renovate Bot changed the title Update dependency fastify to v5 [SECURITY] - autoclosed 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 2 times, most recently from e6153af to 0a55eb7 Compare March 30, 2026 21:00
@renovate renovate Bot changed the title Update dependency fastify to v5 [SECURITY] Update dependency fastify to v5 [SECURITY] - autoclosed Apr 27, 2026
@renovate renovate Bot closed this Apr 27, 2026
@renovate renovate Bot changed the title Update dependency fastify to v5 [SECURITY] - autoclosed Update dependency fastify to v5 [SECURITY] Apr 27, 2026
@renovate renovate Bot reopened this Apr 27, 2026
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