CVE-2023-28120: Activesupport Cross-Site Scripting Vulnerability
MODERATECVE-2023-28120 is a MODERATE (CVSS 5.3) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Activesupport libraries in the RubyGems ecosystem. The issue involves possible xss security vulnerability in safebuffer#bytesplice. Remediation is available by upgrading affected packages to version 7.0.4.3, 6.1.7.3.
CVE-2023-28120 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).
How to Fix CVE-2023-28120
To remediate this vulnerability, upgrade all affected Activesupport dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade activesupport to 7.0.4.3
Upgrade activesupport to 6.1.7.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for activesupport
How to Check if You Are Affected
To determine whether your application is affected by CVE-2023-28120, inspect your project dependencies for Activesupport:
inspect dependencies for activesupport
Analyze the terminal output to locate any version of Activesupport in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.0.4.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Activesupport, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-28120 Affected Activesupport Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
activesupport
|
RubyGems |
≥ 7.0.0
< 7.0.4.3
|
7.0.4.3
|
|
activesupport
|
RubyGems |
< 6.1.7.3
|
6.1.7.3
|
References
Frequently Asked Questions
What is CVE-2023-28120?
Which Activesupport versions are affected?
What version fixes CVE-2023-28120?
Is activesupport affected?
What is the CVSS score of CVE-2023-28120?
What CWE is associated with CVE-2023-28120?
How can I check RubyGems dependencies for CVE-2023-28120?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pj73-v5mw-pm9j",
"modified" : "2025-01-10T18:32:43Z",
"published" : "2023-03-15T21:36:01Z",
"aliases" : [ "CVE-2023-28120" ],
"summary" : "Possible XSS Security Vulnerability in SafeBuffer#bytesplice",
"details" : "There is a vulnerability in ActiveSupport if the new bytesplice method is called on a SafeBuffer with untrusted user input.\nThis vulnerability has been assigned the CVE identifier CVE-2023-28120.\n\nVersions Affected: All. Not affected: None Fixed Versions: 7.0.4.3, 6.1.7.3\n\n# Impact\n\nActiveSupport uses the SafeBuffer string subclass to tag strings as html_safe after they have been sanitized.\nWhen these strings are mutated, the tag is should be removed to mark them as no longer being html_safe.\n\nRuby 3.2 introduced a new bytesplice method which ActiveSupport did not yet understand to be a mutation.\nUsers on older versions of Ruby are likely unaffected.\n\nAll users running an affected release and using bytesplice should either upgrade or use one of the workarounds immediately.\n\n# Workarounds\n\nAvoid calling bytesplice on a SafeBuffer (html_safe) string with untrusted user input.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "activesupport"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.0.0"
}, {
"fixed" : "7.0.4.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "activesupport"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "6.1.7.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-28120"
}, {
"type" : "WEB",
"url" : "https://github.com/rails/rails/commit/3cf23c3f891e2e81c977ea4ab83b62bc2a444b70"
}, {
"type" : "WEB",
"url" : "https://discuss.rubyonrails.org/t/cve-2023-28120-possible-xss-security-vulnerability-in-safebuffer-bytesplice/82469"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activesupport/CVE-2023-28120.yml"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UPV6PVCX4VDJHLFFT42EXBBSGAWZICOW"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ZE5W4MH6IE4DV7GELDK6ISCSTFLHKSYO"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20240202-0006"
}, {
"type" : "WEB",
"url" : "https://www.debian.org/security/2023/dsa-5389"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-03-15T21:36:01Z",
"nvd_published_at" : "2025-01-09T01:15:07Z"
}
}