Skip to content

🚨 [security] Update puma 7.2.1 β†’ 8.0.2 (major) - #1477

Open
depfu[bot] wants to merge 1 commit into
rmt_3from
depfu/update/puma-8.0.2
Open

🚨 [security] Update puma 7.2.1 β†’ 8.0.2 (major)#1477
depfu[bot] wants to merge 1 commit into
rmt_3from
depfu/update/puma-8.0.2

Conversation

@depfu

@depfu depfu Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ puma (7.2.1 β†’ 8.0.2) Β· Repo Β· Changelog

Security Advisories 🚨

🚨 Puma PROXY Protocol v1 Accepts Repeated Protocol Headers on Persistent Connections

Impact

Puma is vulnerable to source IP spoofing when set_remote_address proxy_protocol: :v1 is enabled and persistent connections are used.

PROXY protocol v1 is a connection-level protocol. Support was added to Puma in v5.5.0. A proxy sends one PROXY header at the beginning of a TCP connection, before any HTTP data. Puma incorrectly re-parsed PROXY protocol headers after each keep-alive request on the same connection. An attacker able to send HTTP requests through a trusted proxy could therefore inject a second PROXY header between HTTP requests. Puma would treat the injected header as authoritative for the next request and overwrite REMOTE_ADDR.

This can mislead applications or middleware that use REMOTE_ADDR for security decisions, rate limiting, auditing, or allow/deny lists.

Only deployments that explicitly enable PROXY protocol v1 are affected, and will have set:

set_remote_address proxy_protocol: :v1

Puma's default configuration is not affected. Deployments that do not use persistent connections to Puma are also not expected to be affected by this issue.

Patches

Users should upgrade to versions 7.2.1 or 8.0.2.

Workarounds

Disable PROXY protocol v1 parsing if it is not required:

  # remove/comment this:
  # set_remote_address proxy_protocol: :v1

Users can also disable persistent connections to Puma, for example:

enable_keep_alives false

References

🚨 Puma PROXY Protocol v1 Parser Allows Remote Memory Exhaustion

Impact

PROXY protocol support for Puma was added in version 5.5.0.

When PROXY protocol v1 support is enabled, Puma reads incoming bytes into an internal buffer. It waits for "\r\n" to determine whether a PROXY v1 line is present. If an attacker opens a TCP connection and continuously sends bytes without CRLF, Puma keeps appending to this pre-parse buffer.

This can cause unbounded in-process memory growth and additional CPU cost from repeatedly scanning the growing buffer for CRLF. A single, unauthenticated TCP connection can drive significant memory growth and may cause process/container OOM or degraded availability.

Only Puma servers using the following non-default config are affected:

   set_remote_address proxy_protocol: :v1

Patches

Users should upgrade to versions 7.2.1 or 8.0.2.

Workarounds

  • Disable PROXY protocol v1 parsing if it is not required:
  # remove/comment this:
  # set_remote_address proxy_protocol: :v1
  • Restrict direct network access to Puma listeners using PROXY protocol:
    • Only allow trusted load balancers/reverse proxies to connect.
    • Block arbitrary client TCP access with firewall/security group rules.

Resources

Release Notes

8.0.2

  • Bugfixes
    • Anchor PROXY protocol v1 regex to string start and enforce max line length to prevent injection via crafted request bodies ([#3944])
    • Parse PROXY protocol header only on the first request per connection to prevent spoofing on keep-alive connections ([#3944])

Security advisories

8.0.1

  • Bugfixes

    • Fix prune_bundler stripping user-configured BUNDLE_* env vars (e.g. BUNDLE_WITHOUT) on re-exec, which caused workers to crash on boot ([#3929])
  • Performance

    • Use blocks for debug logging to avoid creating log messages when debug is disabled ([#3920])
  • Docs

    • Fix incorrect hook names in gRPC docs ([#3923])
    • Reword v8 upgrade guide IPv6 bullet for clarity ([#3928])

8.0.0

image

Read our Version 8 Upgrade Guide.

  • Features

    • Add env["puma.mark_as_io_bound"] API and max_io_threads config to allow IO-bound requests to exceed the thread pool max, enabling better handling of mixed workloads ([#3816], [#3894])
    • Add single and cluster DSL hooks for mode-specific configuration ([#3621])
    • Add on_force option to shutdown_debug to only dump thread backtraces on forced (non-graceful) shutdown ([#3671])
    • Add API to dynamically update min and max thread counts at runtime via update_thread_pool_min_max and ServerPluginControl ([#3658])
    • Use SIGPWR for thread backtrace dumps on Linux/JRuby where SIGINFO is unavailable ([#3829])
  • Bugfixes

    • Fix phased restart for fork_worker to avoid forking from stale worker 0 when it has been replaced ([#3853])
  • Performance

    • JRuby HTTP parser improvements: pre-allocated header keys, perfect hash lookup, reduced memory copies ([#3838])
    • Cache downcased header key in str_headers to avoid redundant String#downcase calls, reducing allocations by ~50% per response ([#3874])
  • Refactor

    • Collect env processing into dedicated client_env.rb module ([#3582])
    • Move event to default configuration ([#3872])
  • Docs

    • Add gRPC guide for configuring gRPC lifecycle hooks in clustered mode ([#3885])
    • Add 7.0 upgrade guide, move 5.0/6.0 upgrade guides to docs directory ([#3900])
    • Correct default values for persistent_timeout and worker_boot_timeout in DSL docs ([#3912])
    • Add file descriptor limit warning in test helper for contributors ([#3893])
  • Breaking changes

    • Default production bind address changed from 0.0.0.0 to :: (IPv6) when a non-loopback IPv6 interface is available; falls back to 0.0.0.0 if IPv6 is unavailable ([#3847])

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfu depfu Bot added the depfu label May 28, 2026
@depfu depfu Bot changed the title Update puma 6.6.1 β†’ 8.0.2 (major) 🚨 [security] Update puma 6.6.1 β†’ 8.0.2 (major) Jun 9, 2026
@depfu
depfu Bot changed the base branch from master to rmt_3 July 23, 2026 15:33
@depfu
depfu Bot force-pushed the depfu/update/puma-8.0.2 branch from 091461c to 0c6a55b Compare July 23, 2026 15:55
@depfu depfu Bot changed the title 🚨 [security] Update puma 6.6.1 β†’ 8.0.2 (major) 🚨 [security] Update puma 7.1.0 β†’ 8.0.2 (major) Jul 23, 2026
@rtamalin

rtamalin commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Note that this proposal moves forward to Puma v8.0.2, but comes with the risk of pulling in a potentially breaking changed as part of the v8.x stream.

The associated advisory for Remote Memory Exhaustion issue suggests that v7.2.1 can also be used to address this issue, which could, potentially, be done first to avoid a potential breaking change?

@rtamalin

Copy link
Copy Markdown
Collaborator

@depfu rebase

@depfu
depfu Bot force-pushed the depfu/update/puma-8.0.2 branch from 0c6a55b to d565dbb Compare August 11, 2026 12:55
@depfu depfu Bot changed the title 🚨 [security] Update puma 7.1.0 β†’ 8.0.2 (major) 🚨 [security] Update puma 7.2.1 β†’ 8.0.2 (major) Aug 11, 2026
@rtamalin

Copy link
Copy Markdown
Collaborator

@depfu rebase

@depfu
depfu Bot force-pushed the depfu/update/puma-8.0.2 branch from d565dbb to 74ace58 Compare August 11, 2026 19:59
@mssola mssola mentioned this pull request Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant