CVE-2026-129784: Insecure deserializaiton in the httpx Ruby gem via unsafe Oj object-mode
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 multijson is absent, the decoder falls back to jsonload, which calls Oj.load(response.tos) 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 Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
httpxto a version that resolves this vulnerability.Fixed in 1.9.1 - Configuration
If upgrading is not possible, pass mode: :strict to response.json, or set Oj.default_options = { mode: :strict } (or :rails) before parsing untrusted JSON.
HTTPX/Oj JSON decoding mode = :strict (or :rails for the process-wide default)
Event History
Frequently Asked Questions
Under what runtime conditions is the vulnerable decoder used?
The vulnerable path is used when the oj gem is loaded and multi_json is absent. In that case, HTTPX::Response#json reaches Oj.load without specifying a safe mode.
What does an attacker need to control to exploit this issue?
An attacker must control, or be able to influence, a URL that the application fetches with HTTPX.get(url).json. They also need to provide a crafted JSON response that reaches the affected decoding path.
Are all applications using HTTPX 1.9.0 equally exposed?
No. Exposure depends on whether the application parses responses with HTTPX::Response#json, has oj loaded, lacks multi_json, and fetches attacker-controlled or attacker-influenced URLs. Exploitation for code execution additionally depends on a suitable gadget chain already being available in the process.
How can I mitigate the issue if I cannot immediately upgrade?
Avoid calling .json on responses fetched from attacker-controlled or attacker-influenced URLs while oj is loaded and multi_json is absent. Removing oj from the affected runtime or ensuring multi_json is present prevents the described fallback to Oj.load object mode.
Which version resolves the vulnerability?
The issue affects httpx 1.9.0 and is fixed in version 1.9.1.