Skip to content

docs: clarify disabling request decompression with globalDecompression: false - #439

Open
javier20dev25 wants to merge 2 commits into
fastify:mainfrom
javier20dev25:docs/security-decompression-hardening
Open

javier20dev25 wants to merge 2 commits into
fastify:mainfrom
javier20dev25:docs/security-decompression-hardening

Conversation

@javier20dev25

Copy link
Copy Markdown

Description

This PR clarifies the documentation under the Usage - Decompress request payloads section:

  1. Clarify Flag Distinction: Clarifies that { global: false }\ disables both response compression and request decompression, whereas { globalDecompression: false }\ specifically disables request payload decompression while preserving response compression.
  2. Security Guidance: Adds a recommendation note explaining that applications serving compressed responses without expecting compressed request payloads should explicitly configure { globalDecompression: false }\ to minimize untrusted decompression attack surface (e.g. mitigating vectors like the recent Brotli decoder advisory CVE-2026-111497 on unpatched Node.js runtimes).

Addresses the documentation recommendation in #438.


Identified and submitted during security hygiene audit using the Sentinel Security Ecosystem by @javier20dev25.

Comment thread README.md Outdated
### Global hook

The global request decompression hook is enabled by default. To disable it, pass `{ global: false }`:
The global request decompression hook is enabled by default (`globalDecompression: true`).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment thread README.md Outdated

> [!TIP]
> **Security Consideration (Request Decompression Attack Surface)**:
> Ingestion of compressed request payloads exposes applications to untrusted decompression processing (such as CVE-2026-111497 in Node.js Brotli decoder). If an application only serves compressed responses and does not expect compressed request bodies, explicitly configuring `{ globalDecompression: false }` reduces attack surface by ensuring incoming request streams bypass decompression hooks.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
> Ingestion of compressed request payloads exposes applications to untrusted decompression processing (such as CVE-2026-111497 in Node.js Brotli decoder). If an application only serves compressed responses and does not expect compressed request bodies, explicitly configuring `{ globalDecompression: false }` reduces attack surface by ensuring incoming request streams bypass decompression hooks.
> Ingestion of compressed request payloads exposes applications to untrusted decompression processing (such as [CVE-2026-111497](https://app.opencve.io/cve/CVE-2026-111497) in Node.js Brotli decoder). If an application only serves compressed responses and does not expect compressed request bodies, explicitly configuring `{ globalDecompression: false }` reduces attack surface by ensuring incoming request streams bypass decompression hooks.

@Puppo Puppo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall LGTM, just address the Eomm comments

This branch has not been deployed

No deployments
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.

3 participants