{"answers":{"affected":"2 open source packages ship an affected version, including opensearch-ruby. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-31115 exists.","fix":"Upgrade opensearch-ruby to 2.0.2 or later.","what":"CVE-2022-31115 is a high-severity unsafe deserialization vulnerability in opensearch-project opensearch-ruby, published on 30 Jun 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2022-31115 and fix it if it is affected.\n\nWhat it is: CVE-2022-31115 is a high-severity unsafe deserialization vulnerability in opensearch-project opensearch-ruby, published on 30 Jun 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-31115 exists.\n\nAffected packages and fixed versions:\n- opensearch-ruby (RubyGems): affected from 2.0.0; fixed in 2.0.2\n- opensearch-ruby (RubyGems): affected from 2.0.0; fixed in 2.0.2\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-31115/ (Markdown: https://insights.sbomify.com/CVE-2022-31115/index.md)","id":"CVE-2022-31115","markdown":"https://insights.sbomify.com/CVE-2022-31115/index.md","name":"CVE-2022-31115","record":{"aliases":["GHSA-977c-63xq-cgw3"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"OpenSearch Ruby client","requires_auth":"none","summary":"Unsafe YAML deserialization in the opensearch-ruby library allows code execution if a victim connects to a malicious server.","user_interaction":"required","vuln_class":"deserialization"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"opensearch","vendor":"amazon"}],"cvss":{"score":8.8,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-502","name":"Deserialization of Untrusted Data"}],"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.","ecosystems":["RubyGems"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Unsafe YAML deserialization in opensearch-ruby","id":"CVE-2022-31115","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"RubyGems","product":null,"products":[],"type":"deserialization","year":"2022"},"n_packages":2,"n_references":3,"next":{"headline":"Incorrect handling of invalid surrogate pair characters in ujson","id":"CVE-2022-31116"},"packages":[{"ecosystem":"RubyGems","fixed":["2.0.2"],"introduced":["2.0.0"],"last_affected":[],"package":"opensearch-ruby","purl":null,"source":"GHSA-977c-63xq-cgw3"},{"ecosystem":"RubyGems","fixed":["2.0.2"],"introduced":["2.0.0"],"last_affected":[],"package":"opensearch-ruby","purl":"pkg:gem/opensearch-ruby","source":"GHSA-977c-63xq-cgw3"}],"prev":{"headline":"backpack/crud Vulnerable to Cross-site Scripting","id":"CVE-2022-31114"},"products":["opensearch-ruby"],"published":"2022-06-30","related":[{"cvss_score":8.3,"headline":"OpenSearch 3.2.0 - Nested Boolean/Disjunction asymmetric DoS","id":"CVE-2025-9624","kev_date_added":null,"published":"2025-11-25"},{"cvss_score":7.5,"headline":"OpenSearch vulnerable to Improper Authorization of Index Containing Sensitive Information","id":"CVE-2022-35980","kev_date_added":null,"published":"2022-08-12"},{"cvss_score":6.3,"headline":"Issue with fine-grained access control of indices backing data streams","id":"CVE-2022-41918","kev_date_added":null,"published":"2022-11-15"},{"cvss_score":5.7,"headline":"Issue in Anomaly Detection with document and field level rules in numerical feature aggregations","id":"CVE-2023-23933","kev_date_added":null,"published":"2023-02-03"},{"cvss_score":5.7,"headline":"Field-level security issue with .keyword fields in OpenSearch","id":"CVE-2023-23613","kev_date_added":null,"published":"2023-01-24"},{"cvss_score":5.4,"headline":"OpenSearch Issue with tenant read-only permissions","id":"CVE-2023-45807","kev_date_added":null,"published":"2023-10-16"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-04-22","vendors":["opensearch-project"]},"summary":"Unsafe YAML deserialization in the opensearch-ruby library allows code execution if a victim connects to a malicious server.","url":"https://insights.sbomify.com/CVE-2022-31115/"}