Staging Environment: Content and features may be unstable or change without notice.
Search for packages
Package details: pkg:gem/loofah@2.6.0
purl pkg:gem/loofah@2.6.0
Next non-vulnerable version None.
Latest non-vulnerable version None.
Risk 4.0
Vulnerabilities affecting this package (4)
Vulnerability Summary Fixed by
VCID-271j-gcn1-73c5
Aliases:
CVE-2022-23515
GHSA-228g-948r-83gx
GMS-2022-8287
Improper neutralization of data URIs may allow XSS in Loofah ## Summary Loofah `>= 2.1.0, < 2.19.1` is vulnerable to cross-site scripting via the `image/svg+xml` media type in data URIs. ## Mitigation Upgrade to Loofah `>= 2.19.1`. ## Severity The Loofah maintainers have evaluated this as [Medium Severity 6.1](https://www.first.org/cvss/calculator/3.0#CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N). ## References - [CWE - CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (4.9)](https://cwe.mitre.org/data/definitions/79.html) - [SVG MIME Type (image/svg+xml) is misleading to developers · Issue #266 · w3c/svgwg](https://github.com/w3c/svgwg/issues/266) - https://hackerone.com/reports/1694173 - https://github.com/flavorjones/loofah/issues/101 ## Credit This vulnerability was responsibly reported by Maciej Piechota (@haqpl).
2.19.1
Affected by 1 other vulnerability.
VCID-6qdt-my8d-rkd5
Aliases:
CVE-2022-23516
GHSA-3x8r-x6xp-q4vm
GMS-2022-8288
Uncontrolled Recursion in Loofah ## Summary 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. ## Mitigation Upgrade to Loofah `>= 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. ## Severity The Loofah maintainers have evaluated this as [High Severity 7.5 (CVSS3.1)](https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H). ## References - [CWE - CWE-674: Uncontrolled Recursion (4.9)](https://cwe.mitre.org/data/definitions/674.html)
2.19.1
Affected by 1 other vulnerability.
VCID-amsh-qpt1-9qb7
Aliases:
GHSA-46fp-8f5p-pf2m
Improper detection of disallowed URIs by Loofah `allowed_uri?` ## Summary `Loofah::HTML5::Scrub.allowed_uri?` does not correctly reject `javascript:` URIs when the scheme is split by HTML entity-encoded control characters such as `&#13;` (carriage return), `&#10;` (line feed), or `&#9;` (tab). ## Details The `allowed_uri?` method strips literal control characters before decoding HTML entities. Payloads like `java&#13;script:alert(1)` survive the control character strip, then `&#13;` is decoded to a carriage return, producing `java\rscript:alert(1)`. Note that the Loofah sanitizer's default `sanitize()` path is **not affected** because Nokogiri decodes HTML entities during parsing before Loofah evaluates the URI protocol. This issue only affects direct callers of the `allowed_uri?` string-level helper when passing HTML-encoded strings. ## Impact Applications that call `Loofah::HTML5::Scrub.allowed_uri?` to validate user-controlled URLs and then render approved URLs into `href` or other browser-interpreted URI attributes may be vulnerable to cross-site scripting (XSS). This only affects Loofah `2.25.0`. ## Mitigation Upgrade to Loofah >= `2.25.1`. ## Credit Responsibly reported by HackOne user `@smlee`.
2.25.1
Affected by 1 other vulnerability.
VCID-q52h-9tcw-zfab
Aliases:
CVE-2022-23514
GHSA-486f-hjj9-9vhh
GMS-2022-8289
Inefficient Regular Expression Complexity in Loofah ## Summary Loofah `< 2.19.1` contains an inefficient regular expression that is susceptible to excessive backtracking when attempting to sanitize certain SVG attributes. This may lead to a denial of service through CPU resource consumption. ## Mitigation Upgrade to Loofah `>= 2.19.1`. ## Severity The Loofah maintainers have evaluated this as [High Severity 7.5 (CVSS3.1)](https://www.first.org/cvss/calculator/3.1#CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H). ## References - [CWE - CWE-1333: Inefficient Regular Expression Complexity (4.9)](https://cwe.mitre.org/data/definitions/1333.html) - https://hackerone.com/reports/1684163 ## Credit This vulnerability was responsibly reported by @ooooooo-q (https://github.com/ooooooo-q).
2.19.1
Affected by 1 other vulnerability.
Vulnerabilities fixed by this package (0)
Vulnerability Summary Aliases
This package is not known to fix vulnerabilities.

Date Actor Action Vulnerability Source VulnerableCode Version
2026-04-16T22:18:05.846759+00:00 GitLab Importer Affected by VCID-q52h-9tcw-zfab https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/loofah/CVE-2022-23514.yml 38.4.0
2026-04-16T22:18:05.224803+00:00 GitLab Importer Affected by VCID-6qdt-my8d-rkd5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/loofah/CVE-2022-23516.yml 38.4.0
2026-04-16T22:17:56.866048+00:00 GitLab Importer Affected by VCID-271j-gcn1-73c5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/loofah/CVE-2022-23515.yml 38.4.0
2026-04-16T17:41:47.538072+00:00 Ruby Importer Affected by VCID-amsh-qpt1-9qb7 https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-46fp-8f5p-pf2m.yml 38.4.0
2026-04-11T23:35:37.382144+00:00 GitLab Importer Affected by VCID-q52h-9tcw-zfab https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/loofah/CVE-2022-23514.yml 38.3.0
2026-04-11T23:35:36.714936+00:00 GitLab Importer Affected by VCID-6qdt-my8d-rkd5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/loofah/CVE-2022-23516.yml 38.3.0
2026-04-11T23:35:26.735117+00:00 GitLab Importer Affected by VCID-271j-gcn1-73c5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/loofah/CVE-2022-23515.yml 38.3.0
2026-04-11T21:39:55.293008+00:00 Ruby Importer Affected by VCID-amsh-qpt1-9qb7 https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-46fp-8f5p-pf2m.yml 38.3.0
2026-04-02T23:40:13.996756+00:00 GitLab Importer Affected by VCID-q52h-9tcw-zfab https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/loofah/CVE-2022-23514.yml 38.1.0
2026-04-02T23:40:13.377317+00:00 GitLab Importer Affected by VCID-6qdt-my8d-rkd5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/loofah/CVE-2022-23516.yml 38.1.0
2026-04-02T23:40:04.936132+00:00 GitLab Importer Affected by VCID-271j-gcn1-73c5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/loofah/CVE-2022-23515.yml 38.1.0
2026-04-02T19:37:13.487902+00:00 Ruby Importer Affected by VCID-amsh-qpt1-9qb7 https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-46fp-8f5p-pf2m.yml 38.1.0
2026-04-01T18:02:45.051550+00:00 GitLab Importer Affected by VCID-q52h-9tcw-zfab https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/loofah/CVE-2022-23514.yml 38.0.0
2026-04-01T18:02:44.380092+00:00 GitLab Importer Affected by VCID-6qdt-my8d-rkd5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/loofah/CVE-2022-23516.yml 38.0.0
2026-04-01T18:02:34.974485+00:00 GitLab Importer Affected by VCID-271j-gcn1-73c5 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/gem/loofah/CVE-2022-23515.yml 38.0.0
2026-04-01T15:55:04.442850+00:00 Ruby Importer Affected by VCID-amsh-qpt1-9qb7 https://github.com/rubysec/ruby-advisory-db/blob/master/gems/loofah/GHSA-46fp-8f5p-pf2m.yml 38.0.0