Is sanitize 4.2 vulnerable?

RubyGems · 1 release from 4.2.0 to 4.2.0 · latest sanitize is 7.0.2 · checked 18 Nov 2026

Yes: 3 known advisories

Yes. sanitize 4.2.0, the last 4.2 release, is affected by 3 known security advisories (3 high), including CVE-2023-36823, CVE-2020-4054, CVE-2018-3740. Upgrade to 6.0.2 or later to fix all of them.

Upgrade with:bundle update --conservative sanitize # Gemfile: '>= 6.0.2'

Is your project on an affected sanitize?

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

Advisories affecting sanitize 4.2.0

  • HighCVE-2023-36823GHSA-f5ww-cq3m-q3g76 Jul 2023

    Sanitize vulnerable to Cross-site Scripting via insufficient neutralization of `style` element content

    Affected
    >=3.0.0 <6.0.2
    Fixed in
    6.0.2
  • HighCVE-2020-4054GHSA-p4x4-rw2p-8j8m16 Jun 2020

    Cross-site Scripting in Sanitize

    Affected
    >=3.0.0 <5.2.1
    Fixed in
    5.2.1
  • HighCVE-2018-3740GHSA-7f42-p84j-f58p21 Mar 2018

    Sanitize vulnerable to Improper Input Validation and Cross-site Scripting

    Affected
    >=3.0.0 <4.6.3
    Fixed in
    4.6.3

Which of your client projects are still on sanitize 4.2?

NPMscan reads the lockfiles in every GitHub repo you pick, finds the exact sanitize version each one installs, and checks it against these advisories. Each finding comes with the command that fixes it.

Other sanitize versions

Advisory data from OSV.dev (opens OSV.dev in a new tab), which includes the GitHub Advisory Database. Release list from the RubyGems registry. Refreshed daily.