CVE-2022-31115 json
Unsafe YAML deserialization in opensearch-ruby
published 2022-06-30 4 y ago modified 2026-06-17 4 mo ago also GHSA-977c-63xq-cgw3 , EUVD-2022-6303
- cvss
- 8.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.6%
- EPSS 1.6% chance of exploitation in 30 days, percentile 76%
- public exploits
- 0
- none known
Summary
opensearch-ruby is a community-driven, open source fork of elasticsearch-ruby. In versions prior to 2.0.1 the ruby `YAML.load` function was used instead of `YAML.safe_load`. As a result opensearch-ruby 2.0.0 and prior can lead to unsafe deserialization using YAML.load if the response is of type YAML. An attacker must be in control of an opensearch server and convince the victim to connect to it in order to exploit this vulnerability. The problem has been patched in opensearch-ruby gem version 2.0.1. Users are advised to upgrade. There are no known workarounds for this issue.
Patch / fix
- rubygems opensearch-ruby 2.0.2
- amazon opensearch 2.0.2
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- total
- Assessed
- 18 mo ago
Exploit prediction
1.62% chance of exploitation in the next 30 days, higher than 76% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- staaldraad.github.io https://staaldraad.github.io/post/2021-01-09-universal-rce-ruby-yaml-load-updated/ referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 6.8 | AV:N/AC:M/Au:N/C:P/I:P/A:P |
| GitHub | 3.1 | 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| rubygems | opensearch-ruby | >=2.0.0, <2.0.2 |
2.0.2 |
Affected products
- opensearch-project opensearch-ruby
Classification
- Weakness
-
- CWE-502 Deserialization of Untrusted Data
References
-
github.com
/opensearch-project/opensearch-ruby/pull/77
web, patch, third-party-advisory
-
github.com
/opensearch-project/opensearch-ruby/commit/d74a98b45c037671e8819fa87f6a6423458ab08a
web
-
staaldraad.github.io
/post/2021-01-09-universal-rce-ruby-yaml-load-updated/
exploit, third-party-advisory
-
github.com
/opensearch-project/opensearch-ruby/security/advisories/GHSA-977c-63xq-cgw3
web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2022-31115
advisory
-
github.com
/opensearch-project/opensearch-ruby
package
-
github.com
/opensearch-project/opensearch-ruby/compare/v2.0.1...v2.0.2
web
-
github.com
/rubysec/ruby-advisory-db/blob/master/gems/opensearch-ruby/CVE-2022-31115.yml
web
-
staaldraad.github.io
/post/2021-01-09-universal-rce-ruby-yaml-load-updated
web
Sources
- CVE List CVE-2022-31115
- GitHub Advisory GHSA-977c-63xq-cgw3
- NVD CVE-2022-31115
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.