Vulnerability DatabaseGHSA-36j3-rh89-4gm2

GHSA-36j3-rh89-4gm2: 
Ruby vulnerability analysis and mitigation

Impact

Fetching an attacker-controlled URL can cause excessive memory consumption and denial of service. Affected versions of MetaInspector buffer complete HTTP responses and decompress gzip/deflate bodies in memory before checking max_html_bytes in the HTML parser. Additional copies are made during response processing and parsing. A small compressed response can therefore exhaust the application's memory even when a finite max_html_bytes value is configured. A server can return Content-Encoding: gzip despite the default Accept-Encoding: identity request header. Applications do not need to enable compression explicitly to be affected. Uncompressed responses are also buffered without an early byte limit, although an attacker must transmit the full body in that case. The demonstrated impact is availability loss; no confidentiality or integrity impact has been identified. Exploitability depends on an application fetching a URL whose response is controlled by an attacker.

Affected versions

The vulnerability has been confirmed in published versions 5.21.0 and 5.21.1. The listed affected range is restricted to these confirmed releases. Earlier releases have not been fully assessed and should not be assumed safe. The redirect credential fix in 5.21.1 does not address this vulnerability.

Patches

Upgrade to 5.21.2 and configure a finite max_html_bytes limit:

MetaInspector.new(url, max_html_bytes: 2 * 1024 * 1024)

In 5.21.2, this option limits received response chunks before accumulation and gzip/deflate output chunks during decompression, before charset processing and parsing. The limit applies separately to each response, including redirect bodies, each decompression stage, and processed HTML before parsing. Cached responses are checked against the current request's limit. Exceeding the limit raises MetaInspector::ParserError. With a finite limit, other content encodings are rejected with MetaInspector::RequestError instead of being passed to an unbounded decoder. The 5.x default remains nil (unlimited). Upgrading alone does not impose a response-size limit: applications must also configure a finite value. This bounds response buffers, not total process memory or DOM construction time. The fix is provided for 5.x; no backports to older major versions are provided by this release.

Reproduction and validation

A local HTTP server returned gzip despite Accept-Encoding: identity. Approximately 400 KiB of compressed response data expanded to 400 MiB. With max_html_bytes: 2 * 1024 * 1024, version 5.21.0 still expanded the complete body before raising MetaInspector::ParserError; the recorded process RSS rose from approximately 54 MiB to 858 MiB. Version 5.21.1 was separately confirmed affected with a 16 MiB decoded response and the same 2 MiB limit: RSS rose from approximately 52 MiB to 104 MiB before rejection. With 5.21.2, the 400 MiB reproduction was rejected with RSS rising from approximately 53 MiB to 65 MiB. Regression coverage includes early download termination, bounded gzip/deflate decompression, raw deflate, concatenated gzip members, charset preservation, HEAD, redirects and HTTP cache reads/writes. The stable release passed 614 examples with no failures. All 131 packaged files were verified against the reviewed source. The RubyGems artifact SHA-256 matches the verified package: dd52df762299896a3a825ad68d4654075eacafc1c2bbffae43aa2fc8a9a9d957.

Workarounds

In affected releases, do not rely on max_html_bytes, read timeouts or Accept-Encoding: identity to bound decompression memory. Restrict fetching to trusted responses, or isolate fetching in a separately supervised process with enforced memory limits until the upgrade and finite limit are in place.

References


Source: NVD

Related Ruby vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-4859-2mvh-r787HIGH7.1
  • Ruby logoRuby
  • phlex
NoYesNov 23, 2026
GHSA-6gjg-cqh9-p2xmMEDIUM5.9
  • Ruby logoRuby
  • phlex
NoYesNov 23, 2026
GHSA-jjpx-qcfc-pqwpMEDIUM5.9
  • Ruby logoRuby
  • phlex
NoYesNov 23, 2026
GHSA-fxxw-9rf3-3f2wMEDIUM5.9
  • Ruby logoRuby
  • phlex
NoYesNov 23, 2026
GHSA-wcp8-qw9q-vjppMEDIUM4.9
  • Ruby logoRuby
  • doorkeeper-openid_connect
NoYesNov 23, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management