{"id":"GHSA-mf2j-8f84-cc9q","aliases":["CVE-2026-126205"],"title":"Loofah: Regular expression denial of service in the SVG local-reference check","titleSource":"OSV","descriptionSource":"OSV","declaredSeverity":"MODERATE","description":"## Summary\n\nLoofah's HTML5 sanitizer restricts the `href` and `xlink:href` attributes of SVG reference elements to local references. That check matched the attribute value against `/^\\s*[^#\\s].*/m`. In Ruby `^` anchors to every line start and `\\s` matches newlines, so an all-whitespace value made the engine rescan the value from each of its line starts, taking time quadratic in its length.\n\nOnly Ruby 3.1 and earlier are affected. Ruby 3.2 added linear-time regexp matching, which makes the pattern linear.\n\n## Impact\n\nAn attacker who supplies HTML to be sanitized can consume CPU out of proportion to the input size, by sending an SVG reference element whose `href` or `xlink:href` is a long run of whitespace.\n\nThe default safelist allows the elements in `SVG_ALLOW_LOCAL_HREF`, so no configuration change is required.\n\n## Mitigation\n\nUpgrade to Loofah >= 2.25.3. Applications that cannot upgrade should run Ruby 3.2 or later, which matches the pattern in linear time.\n\n## Credit\n\nReported by scyoon through the Rails HackerOne program.","severity":"medium","score":5.3,"published":"2026-11-12T20:41:25.574Z","modified":"2026-11-12T21:15:10.377Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"RubyGems","name":"loofah","sources":[{"name":"OSV · GHSA-mf2j-8f84-cc9q","url":"https://osv.dev/vulnerability/GHSA-mf2j-8f84-cc9q"}],"ranges":[{"events":[{"introduced":"0"},{"fixed":"2.25.3"}],"type":"ECOSYSTEM"}],"versions":["0.2.0","0.2.1","0.2.2","0.3.0","0.3.1","0.4.0","0.4.1","0.4.2","0.4.3","0.4.4","0.4.5","0.4.6","0.4.7","1.0.0","1.0.0.beta.1","1.1.0","1.2.0","1.2.1","2.0.0","2.0.1","2.0.2","2.0.3","2.1.0","2.1.0.rc1","2.1.0.rc2","2.1.1","2.10.0","2.11.0","2.12.0","2.13.0","2.14.0","2.15.0","2.16.0","2.17.0","2.18.0","2.19.0","2.19.1","2.2.0","2.2.1","2.2.2","2.2.3","2.20.0","2.21.0","2.21.0.rc1","2.21.1","2.21.2","2.21.3","2.21.4","2.22.0","2.23.0","2.23.1","2.24.0","2.24.1","2.25.0","2.25.1","2.25.2","2.3.0","2.3.1","2.4.0","2.5.0","2.6.0","2.7.0","2.8.0","2.9.0","2.9.1"],"fixed":["2.25.3"]}],"sourceAffected":[],"references":["https://github.com/flavorjones/loofah/security/advisories/GHSA-mf2j-8f84-cc9q","https://github.com/flavorjones/loofah/pull/324","https://github.com/flavorjones/loofah/commit/2f31e7fae36036c9882d3d0fae720e1014c57cd1","https://github.com/flavorjones/loofah","https://github.com/flavorjones/loofah/releases/tag/v2.25.3","https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-mf2j-8f84-cc9q.yml"],"sources":[{"name":"OSV","id":"GHSA-mf2j-8f84-cc9q","modified":"2026-11-12T21:15:10.377890075Z","url":"https://osv.dev/vulnerability/GHSA-mf2j-8f84-cc9q"},{"name":"CVE","id":"CVE-2026-126205","modified":"2026-11-12T20:41:25.574Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-126205"}],"assessments":[{"source":"OSV","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3},{"source":"GitHub_M","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3}],"cve":{"records":[{"id":"CVE-2026-126205","source":"GitHub_M","state":"PUBLISHED","reasons":[],"replacements":[],"disputed":false,"unsupportedWhenAssigned":false,"reserved":"2026-11-10T20:07:44.958Z","published":"2026-11-12T20:41:25.574Z","modified":"2026-11-12T20:41:25.574Z"}],"publishers":[{"name":"GitHub_M","role":"CNA","organizationId":"a0819718-46f1-4df5-94e2-005712e83aaa","modified":"2026-11-12T20:41:25.574Z"}],"references":[{"url":"https://github.com/flavorjones/loofah/security/advisories/GHSA-mf2j-8f84-cc9q","tags":["x_refsource_CONFIRM"],"source":"GitHub_M"},{"url":"https://github.com/flavorjones/loofah/pull/324","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/flavorjones/loofah/commit/2f31e7fae36036c9882d3d0fae720e1014c57cd1","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/flavorjones/loofah/releases/tag/v2.25.3","tags":["x_refsource_MISC"],"source":"GitHub_M"}],"weaknesses":[{"id":"CWE-400","description":"CWE-400: Uncontrolled Resource Consumption","source":"GitHub_M"},{"id":"CWE-1333","description":"CWE-1333: Inefficient Regular Expression Complexity","source":"GitHub_M"}],"applicability":[],"prioritization":[]},"products":[{"vendor":"flavorjones","name":"loofah","platforms":[],"versions":[{"version":"< 2.25.3","status":"affected"}],"cpes":[],"source":"GitHub_M","url":"https://www.cve.org/CVERecord?id=CVE-2026-126205"}],"remediation":[],"observedAt":"2026-11-13T07:23:31.841Z","kev":{"status":"not-listed","checkedAt":"2026-11-16T04:05:32.034Z"},"coverage":[{"source":"NVD","status":"available","checkedAt":"2026-11-12T23:05:33.169Z","attemptedAt":"2026-11-12T23:05:33.169Z"},{"source":"GHSA","status":"available","checkedAt":"2026-11-12T23:05:31.831Z","attemptedAt":"2026-11-12T23:05:31.831Z"},{"source":"EUVD","status":"available","checkedAt":"2026-11-12T23:05:33.169Z","attemptedAt":"2026-11-12T23:05:33.169Z"},{"source":"EPSS","status":"no-result","checkedAt":"2026-11-12T23:05:33.169Z","attemptedAt":"2026-11-12T23:05:33.169Z"}],"evidence":[{"source":"GitHub Advisory Database","id":"GHSA-mf2j-8f84-cc9q","url":"https://github.com/advisories/GHSA-mf2j-8f84-cc9q","modified":"2026-11-12T21:00:43Z","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","checkedAt":"2026-11-12T23:05:31.831Z"},{"source":"ENISA EUVD","id":"EUVD-2026-124678","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-124678","modified":"Nov 12, 2026, 8:41:25 PM","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","checkedAt":"2026-11-12T23:05:33.169Z"},{"source":"NVD","id":"CVE-2026-126205","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-126205","modified":"2026-11-12T22:09:39.233","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","checkedAt":"2026-11-12T23:05:33.169Z"}],"aiSummary":null}