Skip to content
Heist/ feed
Back to feed
Medium

ruby-rails-html-sanitizer — security advisory

Type: advisorySources: OSVAdvisory ID: UBUNTU-CVE-2022-23520

rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Prior to version 1.4.4, there is a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer due to an incomplete fix of CVE-2022-32209. 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 issue is patched in version 1.4.4. All users overriding the allowed tags to include both "select" and "style" should either upgrade or use this workaround: Remove either "select" or "style" from the overridden allowed tags. NOTE: Code is _not_ impacted if allowed tags are overridden using either the :tags option to the Action View helper method sanitize or the :tags option to the instance method SafeListSanitizer#sanitize.

Products
ruby-rails-html-sanitizer
Affected versions
1.0.2-1, 1.0.3-1, 1.0.3-2, 1.0.4-1, 1.3.0-1, 1.3.0-2, 1.4.2-1, 1.4.2-2, 1.4.4-1, 1.6.2-1, 1.7.0-2, 1.7.1-1
Fixed versions
Not specified
CVEs
CVE-2022-23520
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 00:45 UTC · Revision 1

Source evidence

UBUNTU-CVE-2022-23520

core-osv · Original source

Published 14 Dec 2022, 18:15 UTC

rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Prior to version 1.4.4, there is a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer due to an incomplete fix of CVE-2022-32209. 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 issue is patched in version 1.4.4. All users overriding the allowed tags to include both "select" and "style" should either upgrade or use this workaround: Remove either "select" or "style" from the overridden allowed tags. NOTE: Code is _not_ impacted if allowed tags are overridden using either the :tags option to the Action View helper method sanitize or the :tags option to the instance method SafeListSanitizer#sanitize.

osv:UBUNTU-CVE-2022-23520

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

ruby-rails-html-sanitizer

Fixed versions: Not specified

Complete source record
{
  "id": "e69ffb863b6d99a63db0b1618cb5a5e8697a80d269452e808a7ca6f7ebd39177",
  "url": "https://osv.dev/vulnerability/UBUNTU-CVE-2022-23520",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "UBUNTU-CVE-2022-23520",
    "summary": "rails-html-sanitizer is responsible for sanitizing HTML fragments in Rails applications. Prior to version 1.4.4, there is a possible XSS vulnerability with certain configurations of Rails::Html::Sanitizer due to an incomplete fix of CVE-2022-32209. 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 issue is patched in version 1.4.4. All users overriding the allowed tags to include both \"select\" and \"style\" should either upgrade or use this workaround: Remove either \"select\" or \"style\" from the overridden allowed tags. NOTE: Code is _not_ impacted if allowed tags are overridden using either the :tags option to the Action View helper method sanitize or the :tags option to the instance method SafeListSanitizer#sanitize.",
    "evidence": "osv:UBUNTU-CVE-2022-23520",
    "products": [
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.0.2-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.3-1",
            "evidence": "/affected/0/versions"
          },
          {
            "value": "1.0.3-2",
            "evidence": "/affected/0/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.0.3-2",
            "evidence": "/affected/1/versions"
          },
          {
            "value": "1.0.4-1",
            "evidence": "/affected/1/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.0.4-1",
            "evidence": "/affected/2/versions"
          },
          {
            "value": "1.3.0-1",
            "evidence": "/affected/2/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.3.0-2",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "1.4.2-1",
            "evidence": "/affected/3/versions"
          },
          {
            "value": "1.4.2-2",
            "evidence": "/affected/3/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/4/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.4.4-1",
            "evidence": "/affected/4/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/5/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.4.4-1",
            "evidence": "/affected/5/versions"
          },
          {
            "value": "1.6.2-1",
            "evidence": "/affected/5/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/6/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.6.2-1",
            "evidence": "/affected/6/versions"
          },
          {
            "value": "1.7.0-2",
            "evidence": "/affected/6/versions"
          },
          {
            "value": "1.7.1-1",
            "evidence": "/affected/6/versions"
          }
        ]
      },
      {
        "name": {
          "value": "ruby-rails-html-sanitizer",
          "evidence": "/affected/7/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": [
          {
            "value": "1.6.2-1",
            "evidence": "/affected/7/versions"
          }
        ]
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "UBUNTU-CVE-2022-23520",
      "aliases": [
        "UBUNTU-CVE-2022-23520"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
        },
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
        },
        {
          "type": "Ubuntu",
          "score": "medium"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=xenial",
            "ecosystem": "Ubuntu:16.04:LTS"
          },
          "versions": [
            "1.0.2-1",
            "1.0.3-1",
            "1.0.3-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-23520.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.0.3-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=bionic",
            "ecosystem": "Ubuntu:18.04:LTS"
          },
          "versions": [
            "1.0.3-2",
            "1.0.4-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-23520.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.0.4-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=focal",
            "ecosystem": "Ubuntu:20.04:LTS"
          },
          "versions": [
            "1.0.4-1",
            "1.3.0-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-23520.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.3.0-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=jammy",
            "ecosystem": "Ubuntu:22.04:LTS"
          },
          "versions": [
            "1.3.0-2",
            "1.4.2-1",
            "1.4.2-2"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-23520.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.4.2-2"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=noble",
            "ecosystem": "Ubuntu:24.04:LTS"
          },
          "versions": [
            "1.4.4-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-23520.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.4.4-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=questing",
            "ecosystem": "Ubuntu:25.10"
          },
          "versions": [
            "1.4.4-1",
            "1.6.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-23520.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.6.2-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=stonking",
            "ecosystem": "Ubuntu:26.10"
          },
          "versions": [
            "1.6.2-1",
            "1.7.0-2",
            "1.7.1-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-23520.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.7.1-1"
              }
            ]
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "ruby-rails-html-sanitizer",
            "purl": "pkg:deb/ubuntu/ruby-rails-html-sanitizer?arch=source&distro=resolute",
            "ecosystem": "Ubuntu:26.04:LTS"
          },
          "versions": [
            "1.6.2-1"
          ],
          "database_specific": {
            "source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-23520.json"
          },
          "ecosystem_specific": {
            "binaries": [
              {
                "binary_name": "ruby-rails-html-sanitizer",
                "binary_version": "1.6.2-1"
              }
            ]
          }
        }
      ],
      "modified": "2026-10-17T12:56:02.300117524Z",
      "provider": "osv",
      "upstream": [
        "CVE-2022-23520"
      ],
      "references": [
        "https://ubuntu.com/security/CVE-2022-23520",
        "https://github.com/rails/rails-html-sanitizer/security/advisories/GHSA-rrfc-7g8p-99q8",
        "https://hackerone.com/reports/1654310",
        "https://www.cve.org/CVERecord?id=CVE-2022-23520"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2022-23520",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 354644,
  "published_at": "2022-12-14T18:15:00+00:00"
}