# CVE-2022-31115: Unsafe YAML deserialization in opensearch-ruby

- Priority: **Prioritise**
- Reason: Public exploit (reference, Date unknown)
- Next step: Check applicability and the vendor advisory: no fix release is recorded here
- Status: published
- Published: 2022-06-30 · Modified: 2025-04-22
- Aliases: GHSA-977c-63xq-cgw3
- Record: https://cvemate.com/vulnerability/CVE-2022-31115 · JSON: https://cvemate.com/vulnerability/CVE-2022-31115/json

## Description

```text
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.
```

## Signals

- CVSS: 8.8 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- EPSS: 1.642%, percentile 77.245%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (reference)

## Affected

- amazon opensearch: \< 2.0.2
- RubyGems opensearch-ruby (RubyGems): ≥ 2.0.0, \< 2.0.2
- opensearch-project opensearch-ruby: \< 2.0.1

## References

- <https://github.com/opensearch-project/opensearch-ruby/security/advisories/GHSA-977c-63xq-cgw3>
- <https://github.com/opensearch-project/opensearch-ruby/pull/77>
- <https://staaldraad.github.io/post/2021-01-09-universal-rce-ruby-yaml-load-updated/>
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31115>
- <https://github.com/opensearch-project/opensearch-ruby/commit/d74a98b45c037671e8819fa87f6a6423458ab08a>
- <https://github.com/opensearch-project/opensearch-ruby>
- <https://github.com/opensearch-project/opensearch-ruby/compare/v2.0.1...v2.0.2>
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/opensearch-ruby/CVE-2022-31115.yml>
- <https://staaldraad.github.io/post/2021-01-09-universal-rce-ruby-yaml-load-updated>

---

Data as of 2026-12-05T06:33:31.093Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
