# CVE-2022-32209: Rails::Html::Sanitizer vulnerable to Cross-site Scripting

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 6.1
- **CVSS:** 6.1 (v3.1, NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: Required; Scope: Changed (impact reaches other components); Confidentiality impact: Low; Integrity impact: Low; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 1.75% (percentile 78, 2026-11-26)
- **CWE:** CWE-79
- **Aliases:** GHSA-pg8v-g4xq-hww9
- **Published:** 2022-06-24T00:00:00.000Z
- **Modified:** 2026-06-17T04:46:52.383Z

## Who should check

- Projects that depend on RubyGems package rails-html-sanitizer (\< 1.4.3)
- Anyone running https://github.com/rails/rails-html-sanitizer v1.4.3

## Description

\# Possible XSS Vulnerability in Rails::Html::SanitizerThere is a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer.This vulnerability has been assigned the CVE identifier CVE-2022-32209.Versions Affected: ALLNot affected: NONEFixed Versions: v1.4.3\#\# ImpactA possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer may allow an attacker to inject content if the application developer has overridden the sanitizer's allowed tags to allow both \`select\` and \`style\` elements.Code is only impacted if allowed tags are being overridden. This may be done via application configuration:\`\`\`ruby\# In config/application.rbconfig.action\_view.sanitized\_allowed\_tags = \["select", "style"\]\`\`\`see https://guides.rubyonrails.org/configuring.html\#configuring-action-viewOr it may be done with a \`:tags\` option to the Action View helper \`sanitize\`:\`\`\`\<%= sanitize @comment.body, tags: \["select", "style"\] %\>\`\`\`see https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html\#method-i-sanitizeOr it may be done with Rails::Html::SafeListSanitizer directly:\`\`\`ruby\# class-level optionRails::Html::SafeListSanitizer.allowed\_tags = \["select", "style"\]\`\`\`or\`\`\`ruby\# instance-level optionRails::Html::SafeListSanitizer.new.sanitize(@article.body, tags: \["select", "style"\])\`\`\`All users overriding the allowed tags by any of the above mechanisms to include both "select" and "style" should either upgrade or use one of the workarounds immediately.\#\# ReleasesThe FIXED releases are available at the normal locations.\#\# WorkaroundsRemove either \`select\` or \`style\` from the overridden allowed tags.\#\# CreditsThis vulnerability was responsibly reported by \[windshock\](https://hackerone.com/windshock?type=user).

## Affected and fixed versions

- RubyGems `rails-html-sanitizer`: affected \< 1.4.3; fixed 1.4.3 (osv)
- https://github.com/rails/rails-html-sanitizer: v1.4.3 (cvelist)

## Mitigation

- Upgrade rails-html-sanitizer to 1.4.3 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-32209. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-32209.md
Affected: rails-html-sanitizer < 1.4.3
Fixed in: 1.4.3

Steps:
1. Search this machine and project for rails-html-sanitizer (RubyGems), https://github.com/rails/rails-html-sanitizer: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-32209 being exploited?

There is no confirmed exploitation: CVE-2022-32209 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 1.75% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-32209?

Medium: CVSS 6.1 (v3.1, scored by NVD). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.

### Which versions are affected by CVE-2022-32209?

rails-html-sanitizer \< 1.4.3.

### Is there a fix for CVE-2022-32209?

Yes. Fixed in 1.4.3. Upgrade rails-html-sanitizer to 1.4.3 or later.

### How do I check if I'm affected by CVE-2022-32209?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AGRLWBEB3S5AU3D4TTROIS7O6QPHDTRH/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NHDACMCLWE32BZZTSNWQPIFUAD5I6Q47/>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2022-32209>
- patch: <https://github.com/rails/rails-html-sanitizer/commit/45a5c10fed3d9aa141594c80afa06d748fa0967d>
- exploit: <https://hackerone.com/reports/1530898>
- other: <https://lists.debian.org/debian-lts-announce/2022/12/msg00012.html>
- other: <https://lists.debian.org/debian-lts-announce/2024/09/msg00045.html>
- other: <https://github.com/rails/rails-html-sanitizer>
- other: <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails-html-sanitizer/CVE-2022-32209.yml>
- other: <https://groups.google.com/g/rubyonrails-security/c/ce9PhUANQ6s>
- other: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AGRLWBEB3S5AU3D4TTROIS7O6QPHDTRH>
- other: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NHDACMCLWE32BZZTSNWQPIFUAD5I6Q47>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AGRLWBEB3S5AU3D4TTROIS7O6QPHDTRH>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NHDACMCLWE32BZZTSNWQPIFUAD5I6Q47>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-32209>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-pg8v-g4xq-hww9> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2022-32209> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-32209>
