Skip to main content

Fastify 5.12.8

Release Date: November 2, 2026

Fastify 5.12.8 shipped on November 2, 2026, and the first line of the release notes is a warning sign, not a feature list. This is a security backport. If you are running Fastify with streaming responses and a handler timeout configured, the practical answer is to patch now and read the details afterwards.

The advisory behind it is GHSA-3qgw-9275-xf8w, filed as CVE-2026-120216 and rated medium. A handler that had already started streaming could blow past handlerTimeout, and the timeout path ended up throwing where nothing caught it. The result is not a 500 response. The result is a process that goes down, which is a denial of service with extra steps for anyone operating the thing.

What the fix actually changes

The timeout handling is the headline, but the backport list is longer than the advisory suggests, and a few entries change observable behaviour. Two deserve attention before you roll this out.

  • Error status codes are clamped. An error carrying a statusCode outside 400 to 599 now falls back to 500 instead of being passed through.
  • Content type parsers can no longer throw synchronously. A custom parser that raised instead of calling back could take the request lifecycle somewhere it was never designed to go. It is contained now.

If you own a custom parser, that second item is the one to test. The failure mode before this patch was ugly enough that nobody sane depended on it, but parsers written defensively around a synchronous throw may now behave differently, and the release notes give you one sentence where you might want a paragraph.

Streaming and trailers

Two reply-layer fixes are worth the upgrade on their own. Reply trailers are now flushed after the stream actually finishes rather than somewhere near it, which is the sort of ordering bug that shows up as a missing trailer in gRPC-shaped setups and is invisible in local testing. Types were also repaired around route shorthand hooks so the this context is no longer lost, and socket path strings are accepted in addresses again.

The new bits, such as they are

routerOptions.compile exposes find-my-way's compiler mode, which lets you trade startup work for faster matching on large route tables. The onClose hook now supports disposables, so a resource that needs cleanup can be registered directly instead of wrapped in a closure that returns a function. Neither is a reason to upgrade; both are pleasant once you are there.

Underneath, the decorator getter is evaluated once instead of on every read, and the port regex moved to module scope. Small, unglamorous, correct.

The caveats nobody puts in the changelog

The backport list also includes ten documentation and test commits, which tells you the branch is being maintained by the book rather than as an afterthought. That is good. What it does not tell you is whether the 5.12 line is where you should be living. Fastify has taken several advisories this autumn, including high severity authentication and validation bypasses in September that were fixed in earlier patches. Staying on a 5.12.x that is behind 5.12.8 means you are carrying fixes you did not collect.

There is no migration guide for this release because there is nothing to migrate. Bump the dependency, then run three checks in order: confirm your streaming endpoints still time out cleanly under load, exercise any custom content type parser, and look for handlers that throw custom status codes outside the 400 to 599 range, because those responses just changed. Fifteen minutes of verification against a release that closes a crash vector is a trade worth making.

Other Versions

We use cookies for ads and analytics.