CVE-2023-22797: Actionpack Open Redirect Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-9445-4cr6-336r
CVSS 6.1
CWE-601
Published
Advisory Summary

CVE-2023-22797 is a MODERATE (CVSS 6.1) open redirect vulnerability vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Actionpack libraries in the RubyGems ecosystem. The issue involves open redirect vulnerability in action pack. Remediation is available by upgrading affected packages to version 7.0.4.1.

CVE-2023-22797 at a Glance

CVE Identifier CVE-2023-22797
GHSA Identifier GHSA-9445-4cr6-336r
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Actionpack
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 6.1

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:C/C:L/I:L/A:N).

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

How to Fix CVE-2023-22797

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: 7.0.4.1
Upgrade actionpack to 7.0.4.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-22797, 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 7.0.4.1), 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-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. 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

There is a vulnerability in Action Controller’s redirect_to. This vulnerability has been assigned the CVE identifier CVE-2023-22797. Versions Affected: >= 7.0.0 Not affected: < 7.0.0 Fixed Versions: 7.0.4.1 Impact There is a possible open redirect when using the redirect_to helper with untrusted user input. Vulnerable code will look like this: ``` redirect_to(params[:some_param]) ``` Rails 7.0 introduced protection against open redirects from calling redirect_to with untrusted user input. In prior versions the developer was fully responsible for only providing trusted input. However the check introduced could be bypassed by a carefully crafted URL. All users running an affected release should either upgrade or use one of the workarounds immediately. Releases The FIXED releases are available at the normal locations. Workarounds There are no feasible workarounds for this issue. 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. 7-0-Fix-sec-issue-with-_url_host_allowed.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.

CVE-2023-22797 Affected Actionpack Versions

1 component(s)
Fixed Versions:
7.0.4.1
Product / Package Ecosystem Affected Versions Fixed Version
actionpack
RubyGems
≥ 7.0.0
< 7.0.4.1
7.0.4.1

References

Frequently Asked Questions

What is CVE-2023-22797?
CVE-2023-22797 is a security vulnerability in Actionpack involving Open Redirect Vulnerability in Action Pack under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Actionpack versions are affected?
Affected versions include releases prior to 7.0.4.1 across affected packages: actionpack.
What version fixes CVE-2023-22797?
Upgrading to 7.0.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is actionpack affected?
Yes, actionpack is affected in releases prior to 7.0.4.1. Upgrade your dependency to 7.0.4.1 or later.
What is the CVSS score of CVE-2023-22797?
CVE-2023-22797 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2023-22797?
CVE-2023-22797 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check RubyGems dependencies for CVE-2023-22797?
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-9445-4cr6-336r",
  "modified" : "2023-06-26T22:33:39Z",
  "published" : "2023-01-18T18:21:23Z",
  "aliases" : [ "CVE-2023-22797" ],
  "summary" : "Open Redirect Vulnerability in Action Pack",
  "details" : "There is a vulnerability in Action Controller’s redirect_to. This vulnerability has been assigned the CVE identifier CVE-2023-22797.\n\nVersions Affected: >= 7.0.0 Not affected: < 7.0.0 Fixed Versions: 7.0.4.1\nImpact \n\nThere is a possible open redirect when using the redirect_to helper with untrusted user input.\n\nVulnerable code will look like this:\n```\nredirect_to(params[:some_param])\n```\n\nRails 7.0 introduced protection against open redirects from calling redirect_to with untrusted user input. In prior versions the developer was fully responsible for only providing trusted input. However the check introduced could be bypassed by a carefully crafted URL.\n\nAll users running an affected release should either upgrade or use one of the workarounds immediately.\nReleases\n\nThe FIXED releases are available at the normal locations.\nWorkarounds\n\nThere are no feasible workarounds for this issue.\nPatches\n\nTo 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.\n\n    7-0-Fix-sec-issue-with-_url_host_allowed.patch - Patch for 7.0 series\n\nPlease 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "actionpack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.0.4.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-22797"
  }, {
    "type" : "WEB",
    "url" : "https://discuss.rubyonrails.org/t/cve-2023-22799-possible-redos-based-dos-vulnerability-in-globalid/82127"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rails/rails"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/rails/releases/tag/v7.0.4.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/actionpack/CVE-2023-22797.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-01-18T18:21:23Z",
    "nvd_published_at" : "2023-02-09T20:15:00Z"
  }
}