{"id":"CVE-2026-126075","aliases":["CVE-2026-126075","GHSA-2w9f-fxwj-w2qf"],"related":[],"kind":"vulnerability","state":"published","title":"Active Support: Possible XSS vulnerability in Active Support MessagePack serializer","summary":"Active Support is a collection of utility classes and standard library extensions used by Rails and other Ruby projects. From 8.1 until 8.1.4.1, 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. This issue is fixed in version 8.1.4.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Active Support is a collection of utility classes and standard library extensions used by Rails and other Ruby projects. From 8.1 until 8.1.4.1, 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. This issue is fixed in version 8.1.4.1.","source":"cvelist"},{"lang":"en","text":"### Impact\n`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.\n\nApplications 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.\n\n### Details\nThe 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.\n\n### Workarounds\nApplications that cannot upgrade can convert a `SafeBuffer` to a `String` with `to_str` before storing it in a value that a MessagePack serializer writes.\n\n### Releases\nThe fixed releases are available at the normal locations.\n\nPatches for those who cannot upgrade at once:\n- 8.1: https://github.com/rails/rails/commit/4ca090665976e6fbc471c38689b399f84b43cdc7.patch\n\n### Credit\nThis issue was responsibly reported by HackerOne researcher [jcwilk](https://hackerone.com/jcwilk).","format":"markdown","source":"ghsa"}],"published":"2026-11-10T20:50:44.522Z","modified":"2026-11-12T22:09:39.233Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","score":4.7,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","score":4.7,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","score":4.7,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":">= 8.1, < 8.1.4.1","status":"affected"}],"vendor":"rails","product":"rails","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"8.1.0.beta1","status":"affected","fixed":"8.1.4.1"}],"ecosystem":"RubyGems","package":"activesupport","purl":"pkg:gem/activesupport","source":"ghsa"}],"references":[{"url":"https://github.com/rails/rails/security/advisories/GHSA-2w9f-fxwj-w2qf","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rails/rails/commit/4ca090665976e6fbc471c38689b399f84b43cdc7","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rails/rails/releases/tag/v8.1.4.1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rails/rails","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activesupport/GHSA-2w9f-fxwj-w2qf.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-12T19:04:03.818Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-126075","url":"https://www.cve.org/CVERecord?id=CVE-2026-126075","licence":"CVE Terms of Use","modified":"2026-11-12T19:04:25.068Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2w9f-fxwj-w2qf","url":"https://github.com/advisories/GHSA-2w9f-fxwj-w2qf","licence":"CC-BY-4.0","modified":"2026-11-10T21:45:04.318Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-126075","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-126075","licence":"Public domain","modified":"2026-11-12T22:09:39.233Z"}],"updatedAt":"2026-11-25T22:59:50.274Z","epss":{"score":0.00332,"percentile":0.28409,"date":"2026-12-01T12:00:22.000Z"}}