{"answers":{"affected":"6 open source packages ship an affected version, including activerecord. It affects 1 product.","exploited":"There is no known exploitation of CVE-2023-22794 in the wild and no public exploit code.","fix":"Upgrade activerecord to a fixed version for your release line: 6.0.6.1, 6.1.7.1 or 7.0.4.1.","what":"CVE-2023-22794 is a high-severity SQL injection vulnerability in https://github.com/rails/rails, published on 9 Feb 2023. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2023-22794 and fix it if it is affected.\n\nWhat it is: CVE-2023-22794 is a high-severity SQL injection vulnerability in https://github.com/rails/rails, published on 9 Feb 2023. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2023-22794 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- activerecord (RubyGems): affected from 6.0.0; fixed in 6.0.6.1\n- activerecord (RubyGems): affected from 6.0.0; fixed in 6.0.6.1\n- activerecord (RubyGems): affected from 6.1.0; fixed in 6.1.7.1\n- activerecord (RubyGems): affected from 6.1.0; fixed in 6.1.7.1\n- activerecord (RubyGems): affected from 7.0.0; fixed in 7.0.4.1\n- activerecord (RubyGems): affected from 7.0.0; fixed in 7.0.4.1\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-2023-22794/ (Markdown: https://insights.sbomify.com/CVE-2023-22794/index.md)","id":"CVE-2023-22794","markdown":"https://insights.sbomify.com/CVE-2023-22794/index.md","name":"CVE-2023-22794","record":{"aliases":["DEBIAN-CVE-2023-22794","GHSA-hq7p-j377-6v63","UBUNTU-CVE-2023-22794"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"Ruby on Rails","requires_auth":"low_privilege","summary":"Insufficient sanitization in ActiveRecord allows SQL injection via malicious input in query annotations or optimizer hints.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"hackerone","cpe":[{"product":"activerecord","vendor":"activerecord_project"}],"cvss":{"score":8.8,"severity":"high","source":"nvd","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"description":"A vulnerability in ActiveRecord \u003c6.0.6.1, v6.1.7.1 and v7.0.4.1 related to the sanitization of comments. If malicious user input is passed to either the `annotate` query method, the `optimizer_hints` query method, or through the QueryLogs interface which automatically adds annotations, it may be sent to the database withinsufficient sanitization and be able to inject SQL outside of the comment.","ecosystems":["RubyGems"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"SQL Injection Vulnerability via ActiveRecord comments","id":"CVE-2023-22794","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"RubyGems","product":null,"products":[],"type":"sql_injection","year":"2023"},"n_packages":6,"n_references":3,"next":{"headline":"ReDoS based DoS vulnerability in Action Dispatch","id":"CVE-2023-22795"},"packages":[{"ecosystem":"RubyGems","fixed":["6.0.6.1"],"introduced":["6.0.0"],"last_affected":[],"package":"activerecord","purl":null,"source":"GHSA-hq7p-j377-6v63"},{"ecosystem":"RubyGems","fixed":["6.0.6.1"],"introduced":["6.0.0"],"last_affected":[],"package":"activerecord","purl":"pkg:gem/activerecord","source":"GHSA-hq7p-j377-6v63"},{"ecosystem":"RubyGems","fixed":["6.1.7.1"],"introduced":["6.1.0"],"last_affected":[],"package":"activerecord","purl":null,"source":"GHSA-hq7p-j377-6v63"},{"ecosystem":"RubyGems","fixed":["6.1.7.1"],"introduced":["6.1.0"],"last_affected":[],"package":"activerecord","purl":"pkg:gem/activerecord","source":"GHSA-hq7p-j377-6v63"},{"ecosystem":"RubyGems","fixed":["7.0.4.1"],"introduced":["7.0.0"],"last_affected":[],"package":"activerecord","purl":null,"source":"GHSA-hq7p-j377-6v63"},{"ecosystem":"RubyGems","fixed":["7.0.4.1"],"introduced":["7.0.0"],"last_affected":[],"package":"activerecord","purl":"pkg:gem/activerecord","source":"GHSA-hq7p-j377-6v63"}],"prev":{"headline":"A vulnerability allowing an unauthenticated attacker to perform remote code execution (RCE) on servers running the Veeam Virtualization Exte","id":"CVE-2023-22793"},"products":["https://github.com/rails/rails"],"published":"2023-02-09","related":[{"cvss_score":9.8,"headline":"Active Record RCE bug with Serialized Columns","id":"CVE-2022-32224","kev_date_added":null,"published":"2022-12-05"},{"cvss_score":7.5,"headline":"Denial of Service Vulnerability in ActiveRecord's PostgreSQL adapter","id":"CVE-2022-44566","kev_date_added":null,"published":"2023-02-09"}],"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":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-02","vendors":["n/a"]},"summary":"Insufficient sanitization in ActiveRecord allows SQL injection via malicious input in query annotations or optimizer hints.","url":"https://insights.sbomify.com/CVE-2023-22794/"}