CVE-2026-126075: Active Support: Possible XSS vulnerability in Active Support MessagePack serializer
Published 2026-11-10 · Updated 2026-11-10 · Also known as GHSA-2w9f-fxwj-w2qf
Summary
Active Support MessagePack serialization improperly deserializes mutated SafeBuffer objects as html_safe, bypassing ERB auto-escaping and risking XSS. Rails 8.1 applications using MessagePack serializers should update immediately.
Who is affected
Applications on Rails 8.1 are vulnerable if they use a MessagePack serializer (such as for cookies, cache, ActiveSupport::MessageVerifier, or ActiveSupport::MessageEncryptor) and store a SafeBuffer that was mutated in place with untrusted input using methods like gsub!. When rendered after loading, this bypasses ERB auto-escaping. Rails 8.0 and earlier are not affected.
Exploitability
The vulnerability carries a CVSS 3.1 base score of 4.7 (MEDIUM) with a vector of CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N, indicating network attack vectors, high attack complexity, no privileges required, user interaction required, and a changed scope. The EPSS score is 0.003 and it is not listed in the CISA Known Exploited Vulnerabilities catalog.
Remediation
- Upgrade the activesupport gem to version 8.1.4.1 or later.
- As a workaround if unable to upgrade, convert SafeBuffer objects to a String using to_str before storing them in values written by a MessagePack serializer.
How to check your project
- Check Gemfile.lock or bundle list to see if activesupport version 8.1.0.beta1 through the affected range is installed.
- Search the codebase for usages of MessagePack serializers like config.action_dispatch.cookies_serializer = :message_pack or Rails.cache with serializer: :message_pack.
Automated analysis of the published advisory data, generated 2026-11-18. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| RubyGems | activesupport |
>= 8.1.0.beta1, < 8.1.4.1 | 8.1.4.1 | bundle update activesupport |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N
| Attack vector | Network |
|---|---|
| Attack complexity | High |
| Privileges required | None |
| User interaction | Required |
| Scope | Changed |
| Confidentiality | Low |
| Integrity | Low |
| Availability | None |
FAQ
Which Rails versions are affected?
Only Rails 8.1 (introduced in version 8.1.0.beta1) is affected because earlier versions do not serialize SafeBuffer with MessagePack.
What causes the vulnerability?
ActiveSupport::MessagePack serializes SafeBuffer objects by bytes alone without preserving their html_safe? status, causing unsafe buffers mutated in place to be incorrectly restored as html_safe.
Are there any considerations during a rolling deploy?
Yes. Versions without the fix cannot read an unsafe buffer serialized by the fixed releases, so a cookie or cache entry holding one could fail to load on a process that has not yet been upgraded.
Original advisory description
References
- WEB https://github.com/rails/rails/security/advisories/GHSA-2w9f-fxwj-w2qf
- WEB https://github.com/rails/rails/commit/4ca090665976e6fbc471c38689b399f84b43cdc7
- PACKAGE https://github.com/rails/rails
- WEB https://github.com/rails/rails/releases/tag/v8.1.4.1
- WEB https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activesupport/GHSA-2w9f-fxwj-w2qf.yml
Source records: GHSA-2w9f-fxwj-w2qf (OSV.dev) · EPSS by FIRST, 2026-11-21.