CVE-2026-33170: Ruby on Rails Active Support XSS in SafeBuffer

CVE-2026-33170 · Severity: medium · CVSS 4 · Published 2026-03-23

A vulnerability in the Ruby on Rails Active Support library could allow attackers to perform Cross-Site Scripting (XSS) attacks. Active Support provides essential utility functions for the Rails web framework, including tools for safely handling web content. An exploit could allow an attacker to inject malicious scripts into web pages viewed by other users, potentially leading to unauthorized actions or data theft.

Technologies: activesupport (RubyGems). Vendors: Ruby on Rails, RubyGems.

Quick answers

Is CVE-2026-33170 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-33170 being exploited in the wild.
How severe is CVE-2026-33170?
Medium severity, with a CVSS score of 4, published 23 March 2026.
Which products and versions are affected?
activesupport (RubyGems) ECOSYSTEM:introduced=8.1.0.beta1,fixed=8.1.2.1.
Is there a fix for CVE-2026-33170?
Yes. activesupport (RubyGems): upgrade to 8.1.2.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-33170 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-33170?
Check whether you run Ruby on Rails Active Support or activesupport (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • activesupport (RubyGems): upgrade to 8.1.2.1 or later
    bundle update activesupport

Technical details

A vulnerability exists in Active Support's SafeBuffer#% method where it fails to correctly propagate the @html_unsafe flag to newly created buffers. If a SafeBuffer is mutated in place (using methods like gsub!) and subsequently formatted using the % operator with untrusted arguments, the resulting object incorrectly identifies as html_safe. This flaw allows an attacker to bypass ERB auto-escaping mechanisms, leading to reflected or stored XSS. The issue is resolved in versions 8.1.2.1, 8.0.4.1, and 7.2.3.1.

Affected products

  • Ruby on Rails activesupport >= 8.1.0.beta1, < 8.1.2.1
  • Ruby on Rails activesupport >= 8.0.0.beta1, < 8.0.4.1
  • Ruby on Rails activesupport < 7.2.3.1

Identifiers

  • CVE-2026-33170
  • GHSA-89vf-4333-qx8v

Timeline

  • 2026-03-23: disclosed
  • 2026-03-23: advisory
  • 2026-03-23: patched

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.