{"id":"CVE-2026-33170","published":"2026-03-23T23:09:48Z","modified":"2026-03-25T19:20:28Z","title":"Rails Active Support has a possible XSS vulnerability in SafeBuffer#%","vendor":"rails","product":"activesupport","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"4.0","vector":"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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00381,"percentile":0.33015,"provenance":"source"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://github.com/rails/rails/security/advisories/GHSA-89vf-4333-qx8v","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/rails/rails/commit/50d732af3b7c8aaf63cbcca0becbc00279b215b7","tags":["x_refsource_MISC"]},{"url":"https://github.com/rails/rails/commit/6e8a81108001d58043de9e54a06fca58962fc2db","tags":["x_refsource_MISC"]},{"url":"https://github.com/rails/rails/commit/c1ad0e8e1972032f3395853a5e99cea035035beb","tags":["x_refsource_MISC"]},{"url":"https://github.com/rails/rails/releases/tag/v7.2.3.1","tags":["x_refsource_MISC"]},{"url":"https://github.com/rails/rails/releases/tag/v8.0.4.1","tags":["x_refsource_MISC"]},{"url":"https://github.com/rails/rails/releases/tag/v8.1.2.1","tags":["x_refsource_MISC"]}],"priority":{"score":10.3,"factors":[{"name":"EPSS percentile","points":6.6},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"rails","affectedVersions":[{"vendor":"rails","product":"activesupport","versions":[">= 8.1.0.beta1, < 8.1.2.1",">= 8.0.0.beta1, < 8.0.4.1","< 7.2.3.1"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2026-03-25T19:20:16.086015Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"RubyGems","package":"activesupport","vulnerableRanges":[">=8.1.0.beta1, <8.1.2.1",">=8.0.0.beta1, <8.0.4.1","<7.2.3.1"],"patched":["8.1.2.1","8.0.4.1","7.2.3.1"],"from":["GHSA-89vf-4333-qx8v"],"provenance":"source"}],"summary":{"text":"The flaw is in the SafeBuffer#% method of the activesupport component of Rails Active Support, which fails to carry the unsafe-HTML flag over to the buffer it returns. As a result, a SafeBuffer that was mutated in place (for example with gsub!) and then formatted with untrusted arguments can be reported as HTML-safe, which can bypass ERB auto-escaping; an attacker who can supply those arguments, with user interaction required to load the affected page, could achieve cross-site scripting, with no authentication or network access beyond reaching the application needed.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:08:52Z"},"euvd":{"id":"EUVD-2026-14624","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2023-28120","published":"2025-01-09","fixed":"7.0.4.3","kev":false},{"cve":"CVE-2023-38037","published":"2025-01-09","fixed":"7.0.7.1","kev":false,"link":{"from":"CVE-2023-38037","to":"CVE-2026-33170","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"RubyGems:activesupport","fromFixed":"7.0.7.1","toFixed":"7.2.3.1","daysApart":438}]}},{"cve":"CVE-2026-33169","published":"2026-03-23","fixed":"8.1.2.1","kev":false},{"cve":"CVE-2026-33170","published":"2026-03-23","fixed":"8.1.2.1","kev":false},{"cve":"CVE-2026-33176","published":"2026-03-23","fixed":"8.1.2.1","kev":false},{"cve":"CVE-2026-126075","published":"2026-11-10","fixed":"8.1.4.1","kev":false,"link":{"from":"CVE-2026-33170","to":"CVE-2026-126075","relation":"successor","confidence":"medium","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"RubyGems:activesupport","fromFixed":"8.1.2.1","toFixed":"8.1.4.1","daysApart":232},{"kind":"similar","provenance":"machine","score":0.44,"basis":"same package + description similarity"}]}},{"cve":"CVE-2026-126080","published":"2026-11-10","fixed":"8.1.4.1","kev":false,"link":{"from":"CVE-2026-33170","to":"CVE-2026-126080","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"RubyGems:activesupport","fromFixed":"8.1.2.1","toFixed":"8.1.4.1","daysApart":232}]}}],"package":"RubyGems:activesupport"}}