|
| 1 | +--- |
| 2 | +gem: puma |
| 3 | +ghsa: x646-wp7c-h9mg |
| 4 | +url: https://github.com/puma/puma/security/advisories/GHSA-x646-wp7c-h9mg |
| 5 | +title: Client that stops reading a TLS or file response holds |
| 6 | + a worker thread indefinitely |
| 7 | +date: 2026-11-13 |
| 8 | +description: | |
| 9 | + ## Impact |
| 10 | +
|
| 11 | + An unauthenticated client can hold a Puma worker thread indefinitely |
| 12 | + when Puma sends it a TLS response, or a file response larger than |
| 13 | + 64 KB. With enough connections, it can take the server offline. |
| 14 | +
|
| 15 | + The client sends a request and then stops reading the response. |
| 16 | + Puma's write timeout (10 seconds) should then free the worker |
| 17 | + thread. In two cases it never fires, and the thread stays blocked |
| 18 | + until the client disconnects: |
| 19 | +
|
| 20 | + * TLS: MiniSSL::Socket#write_nonblock performs a blocking write. |
| 21 | + This has been the case since v3.9.0 (#1274). |
| 22 | +
|
| 23 | + * File bodies over 64 KB, on any bind: Puma sends File bodies, and |
| 24 | + bodies that respond to to_path, with IO.copy_stream, which has no |
| 25 | + write timeout. This has been the case since v6.0.0 (#2896). |
| 26 | + Rack::Files, Rails static file serving, and Rails send_file return |
| 27 | + these bodies. |
| 28 | +
|
| 29 | + An attacker who opens max_threads such connections per worker leaves |
| 30 | + no threads to serve requests. The attack needs very little bandwidth |
| 31 | + and no CPU on the server. |
| 32 | +
|
| 33 | + Two kinds of deployment are affected: |
| 34 | +
|
| 35 | + * Deployments where Puma terminates TLS itself, with an ssl:// |
| 36 | + bind or ssl_bind: |
| 37 | +
|
| 38 | + * ssl_bind "0.0.0.0", "9292", cert: "/path/to/cert.pem", key: |
| 39 | + "/path/to/key.pem" |
| 40 | +
|
| 41 | + * Applications that serve a file larger than 64 KB through Puma, on |
| 42 | + any bind. Puma's default configuration is affected in this case. |
| 43 | +
|
| 44 | + Deployments behind a proxy that buffers responses are not affected |
| 45 | + for files that fit in the proxy's buffer. nginx buffers by default |
| 46 | + (proxy_buffering on), up to 1 GB per response in a temporary file. |
| 47 | +
|
| 48 | + ## Acknowledgements |
| 49 | +
|
| 50 | + Thanks to @wtn and @SounLabs, who reported this issue |
| 51 | + independently, and to @wtn for the fix. |
| 52 | +cvss_v4: 8.7 |
| 53 | +unaffected_versions: |
| 54 | + - "< 3.9.0" |
| 55 | +patched_versions: |
| 56 | + - "~> 7.2.2" |
| 57 | + - ">= 8.0.3" |
| 58 | +related: |
| 59 | + url: |
| 60 | + - https://rubygems.org/gems/puma/versions/8.0.3 |
| 61 | + - https://github.com/puma/puma/blob/main/History.md#803--2026-11-13 |
| 62 | + - https://rubygems.org/gems/puma/versions/7.2.2 |
| 63 | + - https://github.com/puma/puma/blob/main/History.md#722--2026-11-13 |
| 64 | + - https://github.com/puma/puma/pull/1274 |
| 65 | + - https://github.com/puma/puma/pull/2896 |
| 66 | + - https://github.com/puma/puma/security/advisories/GHSA-x646-wp7c-h9mg |
| 67 | +notes: | |
| 68 | + - No CVE from GHSA URL. |
| 69 | + - cvss_v4 from GHSA URL. |
| 70 | + - No gap between 7.2.2 and 8.0.0 releases. |
0 commit comments