{"answers":{"affected":"2 open source packages ship an affected version, including nokogiri.","exploited":"There is no known exploitation of GHSA-353f-x4gh-cqq8 in the wild and no public exploit code.","fix":"Upgrade nokogiri to 1.18.9 or later.","what":"GHSA-353f-x4gh-cqq8 is a memory corruption vulnerability in nokogiri, published on 21 Jul 2025. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-353f-x4gh-cqq8 and fix it if it is affected.\n\nWhat it is: GHSA-353f-x4gh-cqq8 is a memory corruption vulnerability in nokogiri, published on 21 Jul 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-353f-x4gh-cqq8 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- nokogiri (RubyGems): affected all versions; fixed in 1.18.9\n- nokogiri (RubyGems): affected all versions; fixed in 1.18.9\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/GHSA-353f-x4gh-cqq8/ (Markdown: https://insights.sbomify.com/GHSA-353f-x4gh-cqq8/index.md)","id":"GHSA-353f-x4gh-cqq8","markdown":"https://insights.sbomify.com/GHSA-353f-x4gh-cqq8/index.md","name":"GHSA-353f-x4gh-cqq8","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Ruby XML library","requires_auth":"none","summary":"Nokogiri patches vendored libxml2 to fix memory corruption and denial of service vulnerabilities in XML parsing.","user_interaction":"not_required","vuln_class":"memory_corruption"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"## Summary\n\nNokogiri v1.18.9 patches the vendored libxml2 to address CVE-2025-6021, CVE-2025-6170, CVE-2025-49794, CVE-2025-49795, and CVE-2025-49796.\n\n## Impact and severity\n\n### CVE-2025-6021\n\nA flaw was found in libxml2's xmlBuildQName function, where integer overflows in buffer size calculations can lead to a stack-based buffer overflow. This issue can result in memory corruption or a denial of service when processing crafted input.\n\nNVD claims a severity of 7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)\n\nFixed by applying https://gitlab.gnome.org/GNOME/libxml2/-/commit/17d950ae\n\n### CVE-2025-6170\n\nA flaw was found in the interactive shell of the xmllint command-line tool, used for parsing XML files. When a user inputs an overly long command, the program does not check the input size properly, which can cause it to crash. This issue might allow attackers to run harmful code in rare configurations without modern protections.\n\nNVD claims a severity of 2.5 Low (CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:L)\n\nFixed by applying https://gitlab.gnome.org/GNOME/libxml2/-/commit/5e9ec5c1\n\n### CVE-2025-49794\n\nA use-after-free vulnerability was found in libxml2. This issue occurs when parsing XPath elements under certain circumstances when the XML schematron has the \u003csch:name path=\"...\"/\u003e schema elements. This flaw allows a malicious actor to craft a malicious XML document used as input for libxml, resulting in the program's crash using libxml or other possible undefined behaviors.\n\nNVD claims a severity of 9.1 Critical (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H)\n\nFixed by applying https://gitlab.gnome.org/GNOME/libxml2/-/commit/81cef8c5\n\n### CVE-2025-49795\n\nA NULL pointer dereference vulnerability was found in libxml2 when processing XPath XML expressions. This flaw allows an attacker to craft a malicious XML input to libxml2, leading to a denial of service.\n\nNVD claims a severity of 7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)\n\nFixed by applying https://gitlab.gnome.org/GNOME/libxml2/-/commit/62048278\n\n### CVE-2025-49796\n\nA vulnerability was found in libxml2. Processing certain sch:name elements from the input XML file can trigger a memory corruption issue. This flaw allows an attacker to craft a malicious XML input file that can lead libxml to crash, resulting in a denial of service or other possible undefined behavior due to sensitive data being corrupted in memory.\n\nNVD claims a severity of 9.1 Critical (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H)\n\nFixed by applying https://gitlab.gnome.org/GNOME/libxml2/-/commit/81cef8c5\n\n## Affected Versions\n\n- Nokogiri \u003c 1.18.9 when using CRuby (MRI) with vendored libxml2\n\n## Patched Versions\n\n- Nokogiri \u003e= 1.18.9\n\n## Mitigation\n\nUpgrade to Nokogiri v1.18.9 or later.\n\nUsers who are unable to upgrade Nokogiri may also choose a more complicated mitigation: compile and link Nokogiri against patched external libxml2 libraries which will also address these same issues.\n\n## References\n\n- https://github.com/sparklemotion/nokogiri/pull/3526\n- https://nvd.nist.gov/vuln/detail/CVE-2025-6021\n- https://nvd.nist.gov/vuln/detail/CVE-2025-6170\n- https://nvd.nist.gov/vuln/detail/CVE-2025-49794\n- https://nvd.nist.gov/vuln/detail/CVE-2025-49795\n- https://nvd.nist.gov/vuln/detail/CVE-2025-49796","ecosystems":["RubyGems"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Nokogiri patches vendored libxml2 to resolve multiple CVEs","id":"GHSA-353f-x4gh-cqq8","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"RubyGems","product":null,"products":[],"type":"memory_corruption","year":"2025"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"RubyGems","fixed":["1.18.9"],"introduced":["0"],"last_affected":[],"package":"nokogiri","purl":null,"source":"GHSA-353f-x4gh-cqq8"},{"ecosystem":"RubyGems","fixed":["1.18.9"],"introduced":["0"],"last_affected":[],"package":"nokogiri","purl":"pkg:gem/nokogiri","source":"GHSA-353f-x4gh-cqq8"}],"products":null,"published":"2025-07-21","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Nokogiri patches vendored libxml2 to fix memory corruption and denial of service vulnerabilities in XML parsing.","url":"https://insights.sbomify.com/GHSA-353f-x4gh-cqq8/"}