{"id":"CVE-2022-23516","published":"2022-12-14T13:26:11Z","modified":"2025-11-03T21:45:56Z","title":"Uncontrolled Recursion in Loofah","vendor":"flavorjones","product":"loofah","tier":"tail","description":{"text":"Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. Loofah >= 2.2.0, < 2.19.1 uses recursion for sanitizing CDATA sections, making it susceptible to stack exhaustion and raising a SystemStackError exception.  This may lead to a denial of service through CPU resource consumption. This issue is patched in version 2.19.1. Users who are unable to upgrade may be able to mitigate this vulnerability by limiting the length of the strings that are sanitized.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01173,"percentile":0.68261,"provenance":"source"},"cwes":[{"id":"CWE-674","name":"Uncontrolled Recursion"}],"references":[{"url":"https://github.com/flavorjones/loofah/security/advisories/GHSA-3x8r-x6xp-q4vm","tags":["x_refsource_CONFIRM"]},{"url":"https://lists.debian.org/debian-lts-announce/2023/09/msg00011.html","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2024/09/msg00044.html","tags":[]}],"priority":{"score":18.9,"factors":[{"name":"EPSS percentile","points":13.65},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"flavorjones","affectedVersions":[{"vendor":"flavorjones","product":"loofah","versions":[">= 2.2.0, < 2.19.1"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"partial","timestamp":"2025-04-18T18:19:29.547979Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"RubyGems","package":"loofah","vulnerableRanges":[">=2.2.0, <2.19.1"],"patched":["2.19.1"],"from":["GHSA-3x8r-x6xp-q4vm"],"provenance":"source"}],"summary":{"text":"The flaw is an uncontrolled recursion in the CDATA sanitization code of Loofah, a general-purpose library for manipulating HTML and XML documents and fragments built on Nokogiri. An attacker with network access and no authentication or user interaction can submit input containing CDATA sections that exhausts the stack, causing a SystemStackError and high CPU consumption that results in denial of service.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:33:46Z"},"euvd":{"id":"EUVD-2022-7493","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-flavorjones-loofah-cve-2018-8048","parents":[{"from":"CVE-2022-23514","to":"CVE-2022-23516","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["lib/loofah/html5/scrub.rb"],"commits":["https://github.com/flavorjones/loofah/commit/a6e0a1ab90675a17b1b2be189129d94139e4b143","https://github.com/flavorjones/loofah/commit/86f7f6364491b0099d215db858ecdc0c89ded040"],"basis":"rarely changed file"}]}]}}