Rails Active Support has a possible XSS vulnerability in SafeBuffer#%
Package
Affected versions
>= 8.1.0.beta1, < 8.1.2.1
>= 8.0.0.beta1, < 8.0.4.1
< 7.2.3.1
Patched versions
8.1.2.1
8.0.4.1
7.2.3.1
Description
Published to the GitHub Advisory Database
Mar 23, 2026
Reviewed
Mar 23, 2026
Published by the National Vulnerability Database
Mar 24, 2026
Last updated
Apr 10, 2026
Impact
SafeBuffer#%does not propagate the@html_unsafeflag to the newly created buffer. If aSafeBufferis mutated in place (e.g. viagsub!) and then formatted with%using untrusted arguments, the result incorrectly reportshtml_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
References