Deserialization of Untrusted Data Affecting httpx package, versions >=0.21.0, <1.9.1


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.66% (53rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUBY-HTTPX-22742175
  • published23 Nov 2026
  • disclosed16 Nov 2026
  • creditNatan Nehorai

Introduced: 16 Nov 2026

NewCVE-2026-129784  (opens in a new tab)
CWE-502  (opens in a new tab)

How to fix?

Upgrade httpx to version 1.9.1 or higher.

Overview

Affected versions of this package are vulnerable to Deserialization of Untrusted Data in lib/httpx/transcoder/json.rb, whose json_load calls Oj.load(response.to_s) with no mode when the oj gem is the selected JSON backend, so parsing runs in Oj's default :object mode. A response document can then instantiate any already-loaded Ruby class through an "^o" directive and set its instance variables, or resolve a class reference through "^c". An attacker who controls or can influence a response body that the application passes to HTTPX::Response#json gains arbitrary object instantiation and instance-variable injection. Escalation to remote code execution is not inherent in this primitive and requires a suitable deserialization gadget, a class whose initialization or whose behavior when later used performs dangerous actions from its injected instance variables, to be already loaded in the process. This affects only applications that load the oj gem without multi_json, since the transcoder otherwise selects MultiJson or the safe standard-library JSON parser.

Workaround

This vulnerability can be avoided without upgrading by loading multi_json (which the transcoder selects ahead of Oj and which does not default to object mode) or by removing the oj gem so the standard-library JSON parser is used.

Details

Serialization is a process of converting an object into a sequence of bytes which can be persisted to a disk or database or can be sent through streams. The reverse process of creating object from sequence of bytes is called deserialization. Serialization is commonly used for communication (sharing objects between multiple hosts) and persistence (store the object state in a file or a database). It is an integral part of popular protocols like Remote Method Invocation (RMI), Java Management Extension (JMX), Java Messaging System (JMS), Action Message Format (AMF), Java Server Faces (JSF) ViewState, etc.

Deserialization of untrusted data (CWE-502) is when the application deserializes untrusted data without sufficiently verifying that the resulting data will be valid, thus allowing the attacker to control the state or the flow of the execution.

CVSS Base Scores

version 4.0
version 3.1