CVE-2023-28362: Actionpack Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-4g8v-vg43-wpgf
CVSS 4.0
CWE-116
Published
Advisory Summary

CVE-2023-28362 is a MODERATE (CVSS 4.0) cross-site scripting vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting Actionpack libraries in the RubyGems ecosystem. The issue involves actionpack has possible cross-site scripting vulnerability via user supplied values to redirect_to. Remediation is available by upgrading affected packages to version 6.1.7.4, 7.0.5.1.

CVE-2023-28362 at a Glance

CVE Identifier CVE-2023-28362
GHSA Identifier GHSA-4g8v-vg43-wpgf
Severity MODERATE
CVSS v3.1 Base Score 4.0
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product Actionpack
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 4.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

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

How to Fix CVE-2023-28362

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

actionpack fixed: 6.1.7.4
Upgrade actionpack to 6.1.7.4
actionpack fixed: 7.0.5.1
Upgrade actionpack to 7.0.5.1
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 actionpack

How to Check if You Are Affected

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

inspect dependencies for actionpack

Analyze the terminal output to locate any version of Actionpack 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.4), 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-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In Actionpack, 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

The `redirect_to` method in Rails allows provided values to contain characters which are not legal in an HTTP header value. This results in the potential for downstream services which enforce RFC compliance on HTTP response headers to remove the assigned Location header. This vulnerability has been assigned the CVE identifier CVE-2023-28362. Versions Affected: All. Not affected: None Fixed Versions: 7.0.5.1, 6.1.7.4 # Impact This introduces the potential for a Cross-site-scripting (XSS) payload to be delivered on the now static redirection page. Note that this both requires user interaction and for a Rails app to be configured to allow redirects to external hosts (defaults to false in Rails >= 7.0.x). # Releases The FIXED releases are available at the normal locations. # Workarounds Avoid providing user supplied URLs with arbitrary schemes to the `redirect_to` method.

CVE-2023-28362 Affected Actionpack Versions

2 component(s)
Fixed Versions:
6.1.7.47.0.5.1
Product / Package Ecosystem Affected Versions Fixed Version
actionpack
RubyGems
< 6.1.7.4
6.1.7.4
actionpack
RubyGems
≥ 7.0.0
< 7.0.5.1
7.0.5.1

References

Frequently Asked Questions

What is CVE-2023-28362?
CVE-2023-28362 is a security vulnerability in Actionpack involving Actionpack has possible cross-site scripting vulnerability via User Supplied Values to redirect_to under CWE-116: Improper Encoding or Escaping of Output.
Which Actionpack versions are affected?
Affected versions include releases prior to 6.1.7.4, 7.0.5.1 across affected packages: actionpack.
What version fixes CVE-2023-28362?
Upgrading to 6.1.7.4, 7.0.5.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is actionpack affected?
Yes, actionpack is affected in releases prior to 6.1.7.4, 7.0.5.1. Upgrade your dependency to 6.1.7.4, 7.0.5.1 or later.
What is the CVSS score of CVE-2023-28362?
CVE-2023-28362 has a CVSS v3.1 base score of 4.0 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2023-28362?
CVE-2023-28362 is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check RubyGems dependencies for CVE-2023-28362?
Run the dependency tree command: 'inspect dependencies for actionpack'. 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-4g8v-vg43-wpgf",
  "modified" : "2025-05-05T17:10:34Z",
  "published" : "2023-06-29T15:03:16Z",
  "aliases" : [ "CVE-2023-28362" ],
  "summary" : "Actionpack has possible cross-site scripting vulnerability via User Supplied Values to redirect_to",
  "details" : "The `redirect_to` method in Rails allows provided values to contain characters which are not legal in an HTTP header value. This results in the potential for downstream services which enforce RFC compliance on HTTP response headers to remove the assigned Location header. This vulnerability has been assigned the CVE identifier CVE-2023-28362.\n\nVersions Affected: All. Not affected: None Fixed Versions: 7.0.5.1, 6.1.7.4\n\n# Impact\n\nThis introduces the potential for a Cross-site-scripting (XSS) payload to be delivered on the now static redirection page. Note that this both requires user interaction and for a Rails app to be configured to allow redirects to external hosts (defaults to false in Rails >= 7.0.x).\n\n# Releases\n\nThe FIXED releases are available at the normal locations.\n\n# Workarounds\n\nAvoid providing user supplied URLs with arbitrary schemes to the `redirect_to` method.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "actionpack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.1.7.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "actionpack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.0.5.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-28362"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/commit/1c3f93d1e90a3475f9ae2377ead25ccf11f71441"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/commit/69e37c84e3f77d75566424c7d0015172d6a6fac5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/commit/c9ab9b32bcdcfd8bcd55907f6c7b20b4e004cc23"
  }, {
    "type" : "WEB",
    "url" : "https://discuss.rubyonrails.org/t/cve-2023-28362-possible-xss-via-user-supplied-values-to-redirect-to/83132"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rails/rails"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/CVE-2023-28362.yml"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20250502-0009"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-29T15:03:16Z",
    "nvd_published_at" : "2025-01-09T01:15:07Z"
  }
}