8.8high
Unsafe YAML deserialization in opensearch-ruby
- Severity
- 8.8high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.64% (higher than 77% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-977c-63xq-cgw3
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| opensearch-project opensearch-ruby | < 2.0.1 | CVE List |
| opensearch-ruby (RubyGems) | from 2.0.0 before 2.0.2 | GitHub Advisory Database |
| amazon opensearch | before 2.0.2 | NVD |
All scores
| GitHub_M | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 6.8medium CVSS:2.0 | AV:N/AC:M/Au:N/C:P/I:P/A:P |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.
What each source says
CVE List
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.
GitHub Advisory Database
Impact
A YAML deserialization in opensearch-ruby 2.0.0 can lead to unsafe deserialization using YAML.load if the response is of type YAML.
Patches
The problem has been patched in opensearch-ruby gem version 2.0.2.
Workarounds
No viable workaround. Please upgrade to 2.0.2
References
https://github.com/opensearch-project/opensearch-ruby/pull/77 https://staaldraad.github.io/post/2021-01-09-universal-rce-ruby-yaml-load-updated/
For more information
If you have any questions or comments about this advisory:
- Open an issue in opensearch-ruby
NVD (es)
opensearch-ruby es una bifurcación de código abierto impulsada por la comunidad de elasticsearch-ruby. En versiones anteriores a 2.0.1 era usada la función ruby "YAML.load" en lugar de "YAML.safe_load". Como resultado, opensearch-ruby versiones 2.0.0 y anteriores, pueden conllevar a una deserialización no segura usando YAML.load si la respuesta es de tipo YAML. Un atacante debe tener el control de un servidor opensearch y convencer a la víctima de que sea conectado a él para poder explotar esta vulnerabilidad. El problema ha sido parcheado en versión 2.0.1 de la gema opensearch-ruby. Es recomendado a usuarios actualizar. No se presentan mitigaciones conocidas para este problema
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-31115 changed 2025-04-22 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-977c-63xq-cgw3 changed 2024-02-22 | CC-BY-4.0 |
| NVD | CVE-2022-31115 changed 2026-06-17 | Public domain |