VDB
KO
MEDIUM 5.4

GHSA-9hf4-67fc-4vf4

Puma's header normalization allows for client to clobber proxy set headers

Details

### Impact

Clients could clobber values set by intermediate proxies (such as X-Forwarded-For) by providing a underscore version of the same header (X-Forwarded_For). Any users trusting headers set by their proxy may be affected. Attackers may be able to downgrade connections to HTTP (non-SSL) or redirect responses, which could cause confidentiality leaks if combined with a separate MITM attack.

### Patches v6.4.3/v5.6.9 now discards any headers using underscores if the non-underscore version also exists. Effectively, allowing the proxy defined headers to always win.

### Workarounds Nginx has a [underscores_in_headers](https://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers) configuration variable to discard these headers at the proxy level.

Any users that are implicitly trusting the proxy defined headers for security or availability should immediately cease doing so until upgraded to the fixed versions.

Are you affected?

Enter the version of the package you're using.

Affected packages

RubyGems / puma
Introduced in: 0 Fixed in: 5.6.9
Fix bundle update puma
RubyGems / puma
Introduced in: 6.0.0 Fixed in: 6.4.3
Fix bundle update puma

References