{"id":"CVE-2022-31115","aliases":["EUVD-2022-6303","GHSA-977c-63xq-cgw3"],"status":"published","title":"Unsafe YAML deserialization in opensearch-ruby","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.","severity":{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.01617,"percentile":0.76341,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-502"],"published":"2022-06-30T21:55:11Z","modified":"2026-10-28T02:30:58Z","fixes":[{"ecosystem":"RubyGems","package":"opensearch-ruby","fixed_in":["2.0.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"RubyGems","package":"opensearch-ruby","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.0.0"},{"fixed":"2.0.2"}]}]},{"source":"osv","ecosystem":"RubyGems","package":"opensearch-ruby","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.0.0"},{"fixed":"2.0.2"}]}],"versions":["2.0.0","2.0.1"]}],"products":[{"vendor":"amazon","product":"opensearch"},{"vendor":"opensearch-project","product":"opensearch-ruby"}],"references":[{"url":"https://github.com/opensearch-project/opensearch-ruby/security/advisories/GHSA-977c-63xq-cgw3","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://github.com/opensearch-project/opensearch-ruby/pull/77","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://staaldraad.github.io/post/2021-01-09-universal-rce-ruby-yaml-load-updated/","tags":["x_refsource_MISC","x_transferred","Exploit","Third Party Advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31115","tags":["advisory"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/opensearch-ruby/CVE-2022-31115.yml","tags":["web"]},{"url":"https://github.com/opensearch-project/opensearch-ruby/commit/d74a98b45c037671e8819fa87f6a6423458ab08a","tags":["web"]},{"url":"https://github.com/opensearch-project/opensearch-ruby/compare/v2.0.1...v2.0.2","tags":["web"]},{"url":"https://github.com/advisories/GHSA-977c-63xq-cgw3"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31115.json","tags":["advisory"]},{"url":"https://github.com/opensearch-project/opensearch-ruby","tags":["package"]},{"url":"https://staaldraad.github.io/post/2021-01-09-universal-rce-ruby-yaml-load-updated","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2022-31115","title":"Unsafe YAML deserialization in opensearch-ruby","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.","status":"published","published":"2022-06-30T21:55:11Z","modified":"2025-04-22T17:52:35.694Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T14:34:35.279735Z"}],"euvd":[{"id":"EUVD-2022-6303","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.","status":"published","published":"2022-06-30T21:55:11Z","modified":"2025-04-22T17:52:35Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T20:52:15.540112Z"}],"ghsa":[{"id":"GHSA-977c-63xq-cgw3","title":"opensearch-ruby 2.x before 2.0.2 vulnerable to unsafe YAML deserialization","description":"### Impact\nA YAML deserialization in opensearch-ruby 2.0.0 can lead to unsafe deserialization using YAML.load if the response is of type YAML.\n\n### Patches\nThe problem has been patched in opensearch-ruby gem version 2.0.2.\n\n### Workarounds\nNo viable workaround.  Please upgrade to 2.0.2\n\n### References\nhttps://github.com/opensearch-project/opensearch-ruby/pull/77\nhttps://staaldraad.github.io/post/2021-01-09-universal-rce-ruby-yaml-load-updated/\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [opensearch-ruby](https://github.com/opensearch-project/opensearch-ruby)\n","status":"published","published":"2022-07-05T20:41:26Z","modified":"2023-03-31T15:39:38Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T14:36:48.905887Z"}],"nvd":[{"id":"CVE-2022-31115","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.","status":"published","published":"2022-06-30T22:15:08.773Z","modified":"2026-06-17T04:44:50.043Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"secondary"},{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"primary"},{"version":"2.0","score":6.8,"vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T14:07:22.966735Z"}],"osv":[{"id":"CVE-2022-31115","title":"Unsafe YAML deserialization in opensearch-ruby","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.","status":"published","published":"2022-06-30T21:55:11Z","modified":"2026-10-28T02:30:58.513544826Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T15:44:25.516981Z"},{"id":"GHSA-977c-63xq-cgw3","title":"opensearch-ruby 2.x before 2.0.2 vulnerable to unsafe YAML deserialization","description":"### Impact\nA YAML deserialization in opensearch-ruby 2.0.0 can lead to unsafe deserialization using YAML.load if the response is of type YAML.\n\n### Patches\nThe problem has been patched in opensearch-ruby gem version 2.0.2.\n\n### Workarounds\nNo viable workaround.  Please upgrade to 2.0.2\n\n### References\nhttps://github.com/opensearch-project/opensearch-ruby/pull/77\nhttps://staaldraad.github.io/post/2021-01-09-universal-rce-ruby-yaml-load-updated/\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [opensearch-ruby](https://github.com/opensearch-project/opensearch-ruby)\n","status":"published","published":"2022-07-05T20:41:26Z","modified":"2024-02-22T05:30:03.876682Z","cvss":[{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T15:46:43.524801Z"}]}}
