CVE-2026-33170: Activesupport Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-89vf-4333-qx8v
CWE-79
Published
Advisory Summary

CVE-2026-33170 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Activesupport libraries in the RubyGems ecosystem. The issue involves rails active support has a possible xss vulnerability in safebuffer#%. Remediation is available by upgrading affected packages to version 8.1.2.1, 8.0.4.1, 7.2.3.1.

CVE-2026-33170 at a Glance

CVE Identifier CVE-2026-33170
GHSA Identifier GHSA-89vf-4333-qx8v
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Activesupport
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2026-33170

To remediate this vulnerability, upgrade all affected Activesupport dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

activesupport fixed: 8.1.2.1
Upgrade activesupport to 8.1.2.1
activesupport fixed: 8.0.4.1
Upgrade activesupport to 8.0.4.1
activesupport fixed: 7.2.3.1
Upgrade activesupport to 7.2.3.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for activesupport

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-33170, inspect your project dependencies for Activesupport:

inspect dependencies for activesupport

Analyze the terminal output to locate any version of Activesupport in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.1.2.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Activesupport, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact `SafeBuffer#%` does not propagate the `@html_unsafe` flag to the newly created buffer. If a `SafeBuffer` is mutated in place (e.g. via `gsub!`) and then formatted with `%` using untrusted arguments, the result incorrectly reports `html_safe? == true`, bypassing ERB auto-escaping and possibly leading to XSS. ### Releases The fixed releases are available at the normal locations. ### Credit This issue was responsibly reported by @ch4n3-yoon

CVE-2026-33170 Affected Activesupport Versions

3 component(s)
Fixed Versions:
8.1.2.18.0.4.17.2.3.1
Product / Package Ecosystem Affected Versions Fixed Version
activesupport
RubyGems
≥ 8.1.0.beta1
< 8.1.2.1
8.1.2.1
activesupport
RubyGems
≥ 8.0.0.beta1
< 8.0.4.1
8.0.4.1
activesupport
RubyGems
< 7.2.3.1
7.2.3.1

References

Frequently Asked Questions

What is CVE-2026-33170?
CVE-2026-33170 is a security vulnerability in Activesupport involving Rails Active Support has a possible XSS vulnerability in SafeBuffer#% under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Activesupport versions are affected?
Affected versions include releases prior to 8.1.2.1, 8.0.4.1, 7.2.3.1 across affected packages: activesupport.
What version fixes CVE-2026-33170?
Upgrading to 8.1.2.1, 8.0.4.1, 7.2.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is activesupport affected?
Yes, activesupport is affected in releases prior to 8.1.2.1, 8.0.4.1, 7.2.3.1. Upgrade your dependency to 8.1.2.1, 8.0.4.1, 7.2.3.1 or later.
What CWE is associated with CVE-2026-33170?
CVE-2026-33170 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check RubyGems dependencies for CVE-2026-33170?
Run the dependency tree command: 'inspect dependencies for activesupport'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-89vf-4333-qx8v",
  "modified" : "2026-05-13T16:15:43Z",
  "published" : "2026-03-23T20:53:28Z",
  "aliases" : [ "CVE-2026-33170" ],
  "summary" : "Rails Active Support has a possible XSS vulnerability in SafeBuffer#%",
  "details" : "### Impact\n`SafeBuffer#%` does not propagate the `@html_unsafe` flag to the newly created buffer. If a `SafeBuffer` is mutated in place (e.g. via `gsub!`) and then formatted with `%` using untrusted arguments, the result incorrectly reports `html_safe? == true`, bypassing ERB auto-escaping and possibly leading to XSS.\n\n### Releases\nThe fixed releases are available at the normal locations.\n\n### Credit\nThis issue was responsibly reported by @ch4n3-yoon",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "activesupport"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.1.0.beta1"
      }, {
        "fixed" : "8.1.2.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "activesupport"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0.beta1"
      }, {
        "fixed" : "8.0.4.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "activesupport"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.2.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/security/advisories/GHSA-89vf-4333-qx8v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33170"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/commit/50d732af3b7c8aaf63cbcca0becbc00279b215b7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/commit/6e8a81108001d58043de9e54a06fca58962fc2db"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/commit/c1ad0e8e1972032f3395853a5e99cea035035beb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rails/rails"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/releases/tag/v7.2.3.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/releases/tag/v8.0.4.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/releases/tag/v8.1.2.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activesupport/CVE-2026-33170.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-23T20:53:28Z",
    "nvd_published_at" : "2026-03-24T00:16:28Z"
  }
}