Vulnerabilities in pkg:gem/clearance

PACKAGE
Advisory Identifier: GHSA-4hpq-rjcx-7vj9
Advisory Summary

CVE-2021-23435 is a HIGH (CVSS 7.6) clearance gem open redirect vulnerability vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Clearance libraries in the RubyGems ecosystem. The issue involves clearance gem open redirect vulnerability. Remediation is available by upgrading affected packages to version 2.5.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/clearance

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/clearance. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-4hpq-rjcx-7vj9 CVE-2021-23435 HIGH Clearance Gem Open Redirect Vulnerability

CVE-2021-23435 at a Glance

CVE Identifier CVE-2021-23435
GHSA Identifier GHSA-4hpq-rjcx-7vj9
Severity HIGH
CVSS v3.1 Base Score 7.6
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Clearance
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.6

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:H).

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 High (A:H)

How to Fix CVE-2021-23435

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

clearance fixed: 2.5.0
Upgrade clearance to 2.5.0
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 clearance

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-23435, inspect your project dependencies for Clearance:

inspect dependencies for clearance

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

This affects the package clearance before 2.5.0. The vulnerability can be possible when users are able to set the value of `session[:return_to]`. If the value used for return_to contains multiple leading slashes (`/////example.com`) the user ends up being redirected to the external domain that comes after the slashes (`http://example.com`).

CVE-2021-23435 Affected Clearance Versions

1 component(s)
Fixed Versions:
2.5.0
Product / Package Ecosystem Affected Versions Fixed Version
clearance
RubyGems
< 2.5.0
2.5.0

References

Frequently Asked Questions

What is CVE-2021-23435?
CVE-2021-23435 is a security vulnerability in Clearance involving Clearance Gem Open Redirect Vulnerability under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Clearance versions are affected?
Affected versions include releases prior to 2.5.0 across affected packages: clearance.
What version fixes CVE-2021-23435?
Upgrading to 2.5.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is clearance affected?
Yes, clearance is affected in releases prior to 2.5.0. Upgrade your dependency to 2.5.0 or later.
What is the CVSS score of CVE-2021-23435?
CVE-2021-23435 has a CVSS v3.1 base score of 7.6 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H.
What CWE is associated with CVE-2021-23435?
CVE-2021-23435 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-2021-23435?
Run the dependency tree command: 'inspect dependencies for clearance'. 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-4hpq-rjcx-7vj9",
  "modified" : "2023-08-25T20:56:57Z",
  "published" : "2021-09-13T20:05:09Z",
  "aliases" : [ "CVE-2021-23435" ],
  "summary" : "Clearance Gem Open Redirect Vulnerability",
  "details" : "This affects the package clearance before 2.5.0. The vulnerability can be possible when users are able to set the value of `session[:return_to]`. If the value used for return_to contains multiple leading slashes (`/////example.com`) the user ends up being redirected to the external domain that comes after the slashes (`http://example.com`).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "clearance"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.5.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23435"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/thoughtbot/clearance/pull/945"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-4hpq-rjcx-7vj9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/clearance/CVE-2021-23435.yml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/thoughtbot/clearance"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-RUBY-CLEARANCE-1577284"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-09-13T19:07:07Z",
    "nvd_published_at" : null
  }
}