CVE-2026-129784 PUBLISHED

Insecure deserializaiton in the httpx Ruby gem via unsafe Oj object-mode

Assigner: JFROG
Reserved: 16.11.2026 Published: 16.11.2026 Updated: 16.11.2026

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.

Metrics

CVSS Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H
CVSS Score: 8.5

An application loads oj before httpx, does not have multi_json in its bundle, does not pin a safe process-wide Oj.default_options, the Ruby process contains a valid gadget chain, and calls response.json on a response from an attacker-influenced URL.

Product Status

Vendor os85
Product httpx
Versions Default: unaffected
  • affected from 1.9.0 to 1.9.1 (excl.)

Affected Configurations

Affects httpx 1.9.0 only when the oj gem is loaded (and loaded before httpx), multi_json is absent from the bundle, and the process has not pinned a safe Oj.default_options. Reaching code execution additionally requires a gadget chain and an attacker-influenced URL passed to response.json. Applications that keep multi_json, pin a safe Oj mode, or call response.json with an explicit safe mode are not exploitable.

Solutions

Upgrade to httpx 1.9.1, which calls Oj.load with an explicit { mode: :strict } default. If upgrading is not possible, pass a safe mode at the call site (response.json(mode: :strict)), or set a safe process-wide default such as Oj.default_options = { mode: :strict } (or :rails) before any untrusted JSON is parsed. Do not rely on Oj's shipped :object default for data that arrived over the network.

Credits

  • Natan Nehorai of the JFrog Vulnerability Research team finder
  • JFrog Security Research coordinator

References

Problem Types

  • CWE-502: Deserialization of Untrusted Data CWE