Descrizione
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.
Come correggere
Priorità: Media — correggere nel prossimo ciclo di patch. Motivazione: CVSS 8.5, EPSS 0.7% (percentile 52).
Versioni da aggiornare
- os85 httpx: vulnerabili le versioni dalla
1.9.0precedenti alla1.9.1→ aggiornare alla1.9.1o successiva.
Indicazioni del vendor
Soluzione (testo originale del vendor):
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.
Mitigazioni temporanee
Da applicare solo se non è possibile aggiornare subito:
- Bloccare l'accesso esterno agli endpoint che ricevono oggetti serializzati e, se supportato, abilitare una allowlist delle classi deserializzabili.
Verifica
- Individuare tutti gli asset con il prodotto interessato (inventario, scanner di vulnerabilità, CMDB).
- Confrontare la versione installata con quelle indicate sopra.
- Applicare l'aggiornamento in un ambiente di test, poi in produzione; riavviare i servizi se richiesto.
- Ripetere la scansione per confermare la correzione.
Configurazioni interessate
| Vendor | Prodotto | Versioni vulnerabili | Corretta in |
|---|---|---|---|
| os85 | httpx | ≥ 1.9.0 < 1.9.1 | 1.9.1 |
Riferimenti
- Riferimentohttps://github.com/HoneyryderChuck/httpx
- Riferimentohttps://github.com/HoneyryderChuck/httpx/commit/eeb785d3250eee9379494fb62c37c315a31e327c
- Riferimentohttps://github.com/HoneyryderChuck/httpx/releases/tag/v1.9.1
- Riferimentohttps://github.com/ohler55/oj/blob/develop/pages/Security.md
- Riferimentohttps://gitlab.com/os85/httpx
- Riferimentohttps://gitlab.com/os85/httpx/-/commit/eeb785d3250eee9379494fb62c37c315a31e327c
- Riferimentohttps://rubygems.org/gems/httpx