CVE-2026-126075: Active Support: Possible XSS vulnerability in Active Support MessagePack serializer
Impact ActiveSupport::MessagePack serializes an ActiveSupport::SafeBuffer as its bytes alone and deserializes it as a new SafeBuffer, so a buffer that is no longer htmlsafe? (for example, one mutated in place with gsub!) is restored as htmlsafe. If such a buffer holds untrusted input and is stored through a MessagePack serializer, rendering it after it is loaded bypasses ERB auto-escaping, possibly leading to XSS.
Published Nov 10, 2026
Affected packages
activesupport
- Ecosystem
- RubyGems
- Affected
- >= 8.1.0.beta1, < 8.1.4.1
- Fixed in
- 8.1.4.1
- Check
bundle info activesupport
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
ActiveSupport::MessagePack serializes an ActiveSupport::SafeBuffer as its bytes alone and deserializes it as a new SafeBuffer, so a buffer that is no longer html_safe? (for example, one mutated in place with gsub!) is restored as html_safe. If such a buffer holds untrusted input and is stored through a MessagePack serializer, rendering it after it is loaded bypasses ERB auto-escaping, possibly leading to XSS.
Applications on Rails 8.1 are affected if they use a MessagePack serializer, such as config.action_dispatch.cookies_serializer = :message_pack or :message_pack_allow_marshal, or serializer: :message_pack for Rails.cache, ActiveSupport::MessageVerifier or ActiveSupport::MessageEncryptor, and store a SafeBuffer that was mutated in place with untrusted input. Rails 8.0 and earlier do not serialize SafeBuffer with MessagePack and are not affected.
Details
The fixed releases serialize a SafeBuffer that is not html_safe? with a marker and deserialize it as a String; a SafeBuffer that is html_safe? keeps the existing format. Versions without the fix cannot read an unsafe buffer serialized by the fixed releases, so during a rolling deploy a cookie or cache entry holding one could fail to load on a process that has not been upgraded.
Workarounds
Applications that cannot upgrade can convert a SafeBuffer to a String with to_str before storing it in a value that a MessagePack serializer writes.
Releases
The fixed releases are available at the normal locations.
Patches for those who cannot upgrade at once:
- 8.1: https://github.com/rails/rails/commit/4ca090665976e6fbc471c38689b399f84b43cdc7.patch
Credit
This issue was responsibly reported by HackerOne researcher jcwilk.
References
- https://github.com/rails/rails/security/advisories/GHSA-2w9f-fxwj-w2qf
- https://github.com/rails/rails/commit/4ca090665976e6fbc471c38689b399f84b43cdc7
- https://github.com/rails/rails/releases/tag/v8.1.4.1
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activesupport/GHSA-2w9f-fxwj-w2qf.yml
- https://github.com/advisories/GHSA-2w9f-fxwj-w2qf
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More RubyGems vulnerabilities
All RubyGems entriesCVE-2026-126080
Active Support: Possible DoS vulnerability in Active Support safe_constantize
high7.5Nov 10, 2026CVE-2026-33169
Rails Active Support has a possible ReDoS vulnerability in number_to_delimited
medium6.9Mar 23, 2026CVE-2026-33170
Rails Active Support has a possible XSS vulnerability in SafeBuffer#%
medium5.3Mar 23, 2026CVE-2026-33176
Rails Active Support has a possible DoS vulnerability in its number helpers
medium6.6Mar 23, 2026
