CVE-2023-23913: Actionview Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-xp5h-f8jf-rc8q
CVSS 6.3
CWE-79
Published
Advisory Summary

CVE-2023-23913 is a MODERATE (CVSS 6.3) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Actionview libraries in the RubyGems ecosystem. The issue involves rails-ujs vulnerable to dom based cross-site scripting contenteditable html elements. Remediation is available by upgrading affected packages to version 6.1.7.3, 7.0.4.3.

CVE-2023-23913 at a Glance

CVE Identifier CVE-2023-23913
GHSA Identifier GHSA-xp5h-f8jf-rc8q
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Actionview
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 6.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:R/S:U/C:L/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2023-23913

To remediate this vulnerability, upgrade all affected Actionview dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

actionview fixed: 6.1.7.3
Upgrade actionview to 6.1.7.3
actionview fixed: 7.0.4.3
Upgrade actionview to 7.0.4.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for actionview

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-23913, inspect your project dependencies for Actionview:

inspect dependencies for actionview

Analyze the terminal output to locate any version of Actionview in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.1.7.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 Actionview, 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

NOTE: rails-ujs is part of Rails/actionview since 5.1.0. There is a potential DOM based cross-site scripting issue in rails-ujs which leverages the Clipboard API to target HTML elements that are assigned the contenteditable attribute. This has the potential to occur when pasting malicious HTML content from the clipboard that includes a data-method, data-remote or data-disable-with attribute. This vulnerability has been assigned the CVE identifier CVE-2023-23913. Not affected: < 5.1.0 Versions Affected: >= 5.1.0 Fixed Versions: 6.1.7.3, 7.0.4.3 Impact If the specified malicious HTML clipboard content is provided to a contenteditable element, this could result in the arbitrary execution of javascript on the origin in question. Releases The FIXED releases are available at the normal locations. Workarounds We recommend that all users upgrade to one of the FIXED versions. In the meantime, users can attempt to mitigate this vulnerability by removing the contenteditable attribute from elements in pages that rails-ujs will interact with. Patches To aid users who aren’t able to upgrade immediately we have provided patches for the two supported release series. They are in git-am format and consist of a single changeset. * rails-ujs-data-method-contenteditable-6-1.patch - Patch for 6.1 series * rails-ujs-data-method-contenteditable-7-0.patch - Patch for 7.0 series Please note that only the 7.0.Z and 6.1.Z series are supported at present, and 6.0.Z for severe vulnerabilities. Users of earlier unsupported releases are advised to upgrade as soon as possible as we cannot guarantee the continued availability of security fixes for unsupported releases. Credits We would like to thank ryotak 15 for reporting this! * rails-ujs-data-method-contenteditable-6-1.patch (8.5 KB) * rails-ujs-data-method-contenteditable-7-0.patch (8.5 KB) * rails-ujs-data-method-contenteditable-main.patch (8.9 KB)

CVE-2023-23913 Affected Actionview Versions

2 component(s)
Fixed Versions:
6.1.7.37.0.4.3
Product / Package Ecosystem Affected Versions Fixed Version
actionview
RubyGems
≥ 5.1.0
< 6.1.7.3
6.1.7.3
actionview
RubyGems
≥ 7.0.0
< 7.0.4.3
7.0.4.3

References

Frequently Asked Questions

What is CVE-2023-23913?
CVE-2023-23913 is a security vulnerability in Actionview involving rails-ujs vulnerable to DOM Based Cross-site Scripting contenteditable HTML Elements under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Actionview versions are affected?
Affected versions include releases prior to 6.1.7.3, 7.0.4.3 across affected packages: actionview.
What version fixes CVE-2023-23913?
Upgrading to 6.1.7.3, 7.0.4.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is actionview affected?
Yes, actionview is affected in releases prior to 6.1.7.3, 7.0.4.3. Upgrade your dependency to 6.1.7.3, 7.0.4.3 or later.
What is the CVSS score of CVE-2023-23913?
CVE-2023-23913 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2023-23913?
CVE-2023-23913 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check RubyGems dependencies for CVE-2023-23913?
Run the dependency tree command: 'inspect dependencies for actionview'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-xp5h-f8jf-rc8q",
  "modified" : "2025-01-09T18:57:25Z",
  "published" : "2023-06-09T22:41:16Z",
  "aliases" : [ "CVE-2023-23913" ],
  "summary" : "rails-ujs vulnerable to DOM Based Cross-site Scripting contenteditable HTML Elements",
  "details" : "NOTE: rails-ujs is part of Rails/actionview since 5.1.0.\n\nThere is a potential DOM based cross-site scripting issue in rails-ujs\nwhich leverages the Clipboard API to target HTML elements that are\nassigned the contenteditable attribute. This has the potential to\noccur when pasting malicious HTML content from the clipboard that\nincludes a data-method, data-remote or data-disable-with attribute.\n\nThis vulnerability has been assigned the CVE identifier CVE-2023-23913.\n\nNot affected: < 5.1.0\nVersions Affected: >= 5.1.0\nFixed Versions: 6.1.7.3, 7.0.4.3\n\nImpact\n  If the specified malicious HTML clipboard content is provided to a\n  contenteditable element, this could result in the arbitrary execution\n  of javascript on the origin in question.\n\nReleases\n  The FIXED releases are available at the normal locations.\n\nWorkarounds\n  We recommend that all users upgrade to one of the FIXED versions.\n  In the meantime, users can attempt to mitigate this vulnerability\n  by removing the contenteditable attribute from elements in pages\n  that rails-ujs will interact with.\n\nPatches\n  To aid users who aren’t able to upgrade immediately we have provided\n  patches for the two supported release series. They are in git-am\n  format and consist of a single changeset.\n\n* rails-ujs-data-method-contenteditable-6-1.patch - Patch for 6.1 series\n* rails-ujs-data-method-contenteditable-7-0.patch - Patch for 7.0 series\n\nPlease note that only the 7.0.Z and 6.1.Z series are\nsupported at present, and 6.0.Z for severe vulnerabilities.\n\nUsers of earlier unsupported releases are advised to upgrade as\nsoon as possible as we cannot guarantee the continued availability\nof security fixes for unsupported releases.\n\nCredits\n  We would like to thank ryotak 15 for reporting this!\n\n* rails-ujs-data-method-contenteditable-6-1.patch (8.5 KB)\n* rails-ujs-data-method-contenteditable-7-0.patch (8.5 KB)\n* rails-ujs-data-method-contenteditable-main.patch (8.9 KB)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "actionview"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.1.0"
      }, {
        "fixed" : "6.1.7.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "actionview"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.0.4.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-23913"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/commit/5037a13614d71727af8a175063bcf6ba1a74bdbd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/commit/73009ea59a811b28e8ec2a9c9bc24635aa891214"
  }, {
    "type" : "WEB",
    "url" : "https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1033263"
  }, {
    "type" : "WEB",
    "url" : "https://discuss.rubyonrails.org/t/cve-2023-23913-dom-based-cross-site-scripting-in-rails-ujs-for-contenteditable-html-elements/82468"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rails/rails"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionview/CVE-2023-23913.yml"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240605-0007"
  }, {
    "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-06-09T22:41:16Z",
    "nvd_published_at" : "2025-01-09T01:15:07Z"
  }
}