Skip to main content

CVE-2023-28120 — Possible XSS Security Vulnerability in activesupport

MEDIUM

Possible XSS Security Vulnerability in SafeBuffer#bytesplice

Published March 15, 2023Updated January 10, 2025Source: OSV

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.

Check my Gemfile.lock

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.

Bundler
Update activesupport to 7.0.4.3 or later
gem install activesupport -v 7.0.4.3
Bundler
Update activesupport to 6.1.7.3 or later
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).

PackageFixed 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-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 5.3 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

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

CVSS Score
5.3

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
1.16%
EPSS percentile: 66.9

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

GHSA-pj73-v5mw-pm9j

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Gemfile.lock