loofah vulnerabilities

Loofah is a general library for manipulating and transforming HTML/XML documents and fragments, built on top of Nokogiri. Loofah also includes some HTML sanitizers based on `html5lib`'s safelist, which are a specific application of the general transformation functionality.

Registry
RubyGems
Latest
2.25.3
License
MIT

17 known advisories

The latest version, 2.25.3, is not affected by any of them. Projects on older versions may be.

Update to the latest version:bundle update --conservative loofah # Gemfile: '>= 2.25.3'

Is your project on an affected loofah?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Security advisories for loofah

  • MediumCVE-2026-126208GHSA-345x-3rq2-jfrm12 Nov 2026

    Loofah: SVG `<textPath>` and `<mpath>` bypass local-reference restriction

    Affected
    <2.25.3
    Fixed in
    2.25.3
  • MediumCVE-2026-126209GHSA-p9wj-w8xq-vjx612 Nov 2026

    Loofah allowed_uri? treats javascript&#x3a alert(1) as safe

    Affected
    >=2.25.0 <2.25.3
    Fixed in
    2.25.3
  • MediumCVE-2026-126207GHSA-m3x9-938q-576712 Nov 2026

    Loofah: CSS url() sanitization bypass via escaped parentheses

    Affected
    <2.25.3
    Fixed in
    2.25.3
  • MediumCVE-2026-126205GHSA-mf2j-8f84-cc9q12 Nov 2026

    Loofah: Regular expression denial of service in the SVG local-reference check

    Affected
    <2.25.3
    Fixed in
    2.25.3
  • MediumCVE-2026-126206GHSA-jcff-cj73-4w4f12 Nov 2026

    Loofah allowed_uri? treats data:text&sol;html as safe text/plain

    Affected
    >=2.25.2 <2.25.3
    Fixed in
    2.25.3
  • MediumCVE-2026-126203GHSA-h6v6-rg66-fqj412 Nov 2026

    Loofah: Mutation XSS in the HTML5 scrubbers through unescaped attribute values

    Affected
    >=2.21.0 <2.25.3
    Fixed in
    2.25.3
  • LowCVE-2026-73492GHSA-5qhf-9phg-95m221 Jul 2026

    Loofah `allowed_uri?` does not detect `javascript:` URIs split by numeric character references without semicolons

    Affected
    >=2.25.0 <2.25.2
    Fixed in
    2.25.2
  • MediumCVE-2026-73490GHSA-9wjq-cp2p-hrgf21 Jul 2026

    Loofah: SVG `href` attribute bypasses local-reference restriction

    Affected
    <2.25.2
    Fixed in
    2.25.2
  • LowCVE-2026-73491GHSA-8whx-365g-h9vv21 Jul 2026

    Loofah `allowed_uri?` does not detect `javascript:` URIs split by named whitespace character references

    Affected
    >=2.25.0 <2.25.2
    Fixed in
    2.25.2
  • LowGHSA-2j22-pr5w-6gq826 Mar 2026

    Loofah has improper detection of disallowed URIs via `allowed_uri?`

    Affected
    >=2.25.0 <2.25.1
    Fixed in
    2.25.1
  • LowGHSA-46fp-8f5p-pf2m18 Mar 2026

    Improper detection of disallowed URIs by Loofah `allowed_uri?`

    Affected
    >=2.25.0 <2.25.1
    Fixed in
    2.25.1
  • HighCVE-2022-23516GHSA-3x8r-x6xp-q4vm13 Dec 2022

    Uncontrolled Recursion in Loofah

    Affected
    >=2.2.0 <2.19.1
    Fixed in
    2.19.1
  • MediumCVE-2022-23515GHSA-228g-948r-83gx13 Dec 2022

    Improper neutralization of data URIs may allow XSS in Loofah

    Affected
    >=2.1.0 <2.19.1
    Fixed in
    2.19.1
  • HighCVE-2022-23514GHSA-486f-hjj9-9vhh13 Dec 2022

    Inefficient Regular Expression Complexity in Loofah

    Affected
    <2.19.1
    Fixed in
    2.19.1
  • MediumCVE-2019-15587GHSA-c3gv-9cxf-6f575 Nov 2019

    Loofah Allows Cross-site Scripting

    Affected
    <2.3.1
    Fixed in
    2.3.1
  • MediumCVE-2018-16468GHSA-g4xq-jx4w-4cjv1 Nov 2018

    Loofah Cross-site Scripting vulnerability

    Affected
    <2.2.3
    Fixed in
    2.2.3
  • MediumCVE-2018-8048GHSA-x7rv-cr6v-4vm421 Mar 2018

    Cross-site Scripting in loofah

    Affected
    <2.2.1
    Fixed in
    2.2.1

Is your loofah version vulnerable?

Which of your client projects still run an old loofah?

NPMscan reads the Gemfile.lock in every GitHub repo you pick and checks each installed version against these advisories, including the packages your packages pull in. Each finding comes with the command that fixes it.

Other RubyGems packages

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily. Package details from the RubyGems registry.