# CVE-2026-33170: Rails Active Support has a possible XSS vulnerability in SafeBuffer#%

- Severity: Medium 5.3 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.38%, higher than 34% of CVEs (2026-12-01)
- Published: 2026-03-23T20:53:28.000Z
- Modified: 2026-09-10T03:50:38.175Z
- Also known as: GHSA-89vf-4333-qx8v
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

Active Support is a toolkit of support libraries and Ruby core extensions extracted from the Rails framework. Prior to versions 8.1.2.1, 8.0.4.1, and 7.2.3.1, `SafeBuffer#%` does not propagate the `@html_unsafe` flag to the newly created buffer. If a `SafeBuffer` is mutated in place (e.g. via `gsub!`) and then formatted with `%` using untrusted arguments, the result incorrectly reports `html_safe? == true`, bypassing ERB auto-escaping and possibly leading to XSS. Versions 8.1.2.1, 8.0.4.1, and 7.2.3.1 contain a patch.

(As written by CVE List.)

## Affected

- rails activesupport: >= 8.1.0.beta1, < 8.1.2.1; >= 8.0.0.beta1, < 8.0.4.1; < 7.2.3.1
- activesupport (RubyGems): from 8.1.0.beta1 before 8.1.2.1; from 8.0.0.beta1 before 8.0.4.1; before 7.2.3.1
- rubyonrails rails: before 7.2.3.1; from 8.0.0 before 8.0.4.1; from 8.1.0 before 8.1.2.1

## Every score

- GitHub_M: CVSS:4.0 5.3 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N`
- GitHub: CVSS:4.0 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/rails/rails/security/advisories/GHSA-89vf-4333-qx8v> (vendor-advisory, web)
- <https://github.com/rails/rails/commit/50d732af3b7c8aaf63cbcca0becbc00279b215b7> (patch, web)
- <https://github.com/rails/rails/commit/6e8a81108001d58043de9e54a06fca58962fc2db> (patch, web)
- <https://github.com/rails/rails/commit/c1ad0e8e1972032f3395853a5e99cea035035beb> (patch, web)
- <https://github.com/rails/rails/releases/tag/v7.2.3.1> (release-notes, web)
- <https://github.com/rails/rails/releases/tag/v8.0.4.1> (release-notes, web)
- <https://github.com/rails/rails/releases/tag/v8.1.2.1> (release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-33170> (advisory)
- <https://github.com/rails/rails> (package)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activesupport/CVE-2026-33170.yml> (web)

## Sources

- CVE List: [CVE-2026-33170](https://www.cve.org/CVERecord?id=CVE-2026-33170), CVE Terms of Use, modified 2026-03-25
- GitHub Advisory Database: [GHSA-89vf-4333-qx8v](https://github.com/advisories/GHSA-89vf-4333-qx8v), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-33170](https://nvd.nist.gov/vuln/detail/CVE-2026-33170), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2026-33170 · Whole record: https://cve.day/CVE-2026-33170.json · Rebuilt by cve.day 2026-11-25T22:59:16.508Z
