CVE-2023-28120 — Possible XSS Security Vulnerability in activesupport
Possible XSS Security Vulnerability in SafeBuffer#bytesplice
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.16%). Schedule for your next planned update.
Does your project use an affected activesupport version?
Paste your Gemfile.lock to check it for CVE-2023-28120 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
There is a vulnerability in ActiveSupport if the new bytesplice method is called on a SafeBuffer with untrusted user input. This vulnerability has been assigned the CVE identifier CVE-2023-28120.
Versions Affected: All. Not affected: None Fixed Versions: 7.0.4.3, 6.1.7.3
Impact
ActiveSupport uses the SafeBuffer string subclass to tag strings as html_safe after they have been sanitized. When these strings are mutated, the tag is should be removed to mark them as no longer being html_safe.
Ruby 3.2 introduced a new bytesplice method which ActiveSupport did not yet understand to be a mutation. Users on older versions of Ruby are likely unaffected.
All users running an affected release and using bytesplice should either upgrade or use one of the workarounds immediately.
Workarounds
Avoid calling bytesplice on a SafeBuffer (html_safe) string with untrusted user input.
Advisory Timeline
- First published March 15, 2023 (1353 days ago).
- Last revised January 10, 2025 — 667 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install activesupport -v 7.0.4.3
gem install activesupport -v 6.1.7.3
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| activesupport RubyGems · Affected: 7.0.0, 7.0.1, 7.0.2, 7.0.2.1 (+8 more) | 7.0.4.3 |
| activesupport RubyGems · Affected: 1.0.0, 1.0.1, 1.0.2, 1.0.3 (+406 more) | 6.1.7.3 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-79Cross-site Scripting (XSS)MITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 5.3 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
References
- https://nvd.nist.gov/vuln/detail/CVE-2023-28120ADVISORY
- https://github.com/rails/rails/commit/3cf23c3f891e2e81c977ea4ab83b62bc2a444b70WEB
- https://discuss.rubyonrails.org/t/cve-2023-28120-possible-xss-security-vulnerability-in-safebuffer-bytesplice/82469WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activesupport/CVE-2023-28120.ymlWEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UPV6PVCX4VDJHLFFT42EXBBSGAWZICOWWEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZE5W4MH6IE4DV7GELDK6ISCSTFLHKSYOWEB
- https://security.netapp.com/advisory/ntap-20240202-0006WEB
- https://www.debian.org/security/2023/dsa-5389WEB
Frequently Asked Questions
- What is CVE-2023-28120?
- Possible XSS Security Vulnerability in SafeBuffer#bytesplice. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 5.3/10).
- How do I check if my project is affected by CVE-2023-28120?
- CVE-2023-28120 affects activesupport. It has a 1.2% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2023-28120 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This is an above-median EPSS score — 66.9% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2020-8165CRITICAL
ActiveSupport potentially unintended unmarshalling of user-provided objects in MemCacheStore and RedisCacheStore
- CVE-2026-126080HIGH
Active Support: Possible DoS vulnerability in Active Support safe_constantize
- CVE-2026-33176MEDIUM
Rails Active Support has a possible DoS vulnerability in its number helpers
- CVE-2026-128084MEDIUM
sqlite3-ruby: Possible SQL query truncation when a string is 4 GiB or larger
- CVE-2026-33170MEDIUM
Rails Active Support has a possible XSS vulnerability in SafeBuffer#%
- CVE-2026-33169MEDIUM
Rails Active Support has a possible ReDoS vulnerability in number_to_delimited
- CVE-2023-38037MEDIUM
Active Support Possibly Discloses Locally Encrypted Files
- CVE-2026-115472MEDIUM
Doorkeeper: When using public clients, any client can revoke any access token