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

- Severity: High 8.8 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.64%, higher than 77% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-06-30T21:55:11.000Z
- Modified: 2026-06-17T04:44:50.043Z
- Also known as: GHSA-977c-63xq-cgw3
- Weaknesses: CWE-502
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- opensearch-project opensearch-ruby: < 2.0.1
- opensearch-ruby (RubyGems): from 2.0.0 before 2.0.2
- amazon opensearch: before 2.0.2

## Every score

- GitHub_M: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 6.8 Medium `AV:N/AC:M/Au:N/C:P/I:P/A:P`

## References

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

## Sources

- CVE List: [CVE-2022-31115](https://www.cve.org/CVERecord?id=CVE-2022-31115), CVE Terms of Use, modified 2025-04-22
- GitHub Advisory Database: [GHSA-977c-63xq-cgw3](https://github.com/advisories/GHSA-977c-63xq-cgw3), CC-BY-4.0, modified 2024-02-22
- NVD: [CVE-2022-31115](https://nvd.nist.gov/vuln/detail/CVE-2022-31115), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-31115 · Whole record: https://cve.day/CVE-2022-31115.json · Rebuilt by cve.day 2026-11-25T22:58:12.657Z
