Description
The httpx Ruby gem parses JSON response bodies through its transcoder layer. HTTPX::Response#json delegates to Transcoder::JSON.decode, and when the oj gem is loaded and multi_json is absent, the decoder falls back to json_load, which calls Oj.load(response.to_s) with no mode option. Oj.load defaults to :object mode, in which a response document can allocate any already-loaded Ruby class ("^o":"ClassName") and set its instance variables, or resolve a class or module reference ("^c":"Name"). An attacker who controls, or can influence, the URL an application fetches with HTTPX.get(url).json therefore controls object instantiation in the victim process. With a matching gadget chain, this issue can potentially cause remote code execution. Affects httpx 1.9.0; fixed in 1.9.1.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| os85 | httpx | 1.9.0 – < 1.9.1 | 1.9.1 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | ruby-httpx | No fix yet | — |
References
- https://github.com/HoneyryderChuck/httpx product
- https://rubygems.org/gems/httpx product
- Fix commit: json: fix oj integration to avoid RCE mode patch
- https://github.com/HoneyryderChuck/httpx/releases/tag/v1.9.1 patch
- Oj security documentation: :object mode and safe loading technical-description
- https://gitlab.com/os85/httpx product
- https://gitlab.com/os85/httpx/-/commit/eeb785d3250eee9379494fb62c37c315a31e327c patch