Vulnerabilities in pkg:gem/rack-protection

PACKAGE
Advisory Identifier: GHSA-688c-3x49-6rqj
Advisory Summary

CVE-2018-1000119 is a MODERATE (CVSS 5.9) rack-protection gem timing attack vulnerability vulnerability (CWE-203: Observable Discrepancy) affecting Rack protection libraries in the RubyGems ecosystem. The issue involves rack-protection gem timing attack vulnerability when validating csrf token. Remediation is available by upgrading affected packages to version 1.5.5, 2.0.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/rack-protection

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-688c-3x49-6rqj CVE-2018-1000119 MODERATE rack-protection gem timing attack vulnerability when validating CSRF token

CVE-2018-1000119 at a Glance

CVE Identifier CVE-2018-1000119
GHSA Identifier GHSA-688c-3x49-6rqj
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-203: Observable Discrepancy
Affected Product Rack protection
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 5.9

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

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

How to Fix CVE-2018-1000119

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

rack-protection fixed: 1.5.5
Upgrade rack-protection to 1.5.5
rack-protection fixed: 2.0.0
Upgrade rack-protection to 2.0.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 rack-protection

How to Check if You Are Affected

To determine whether your application is affected by CVE-2018-1000119, inspect your project dependencies for Rack protection:

inspect dependencies for rack-protection

Analyze the terminal output to locate any version of Rack protection in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.5), 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-203: Observable Discrepancy, where the product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor. In Rack protection, 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

Sinatra rack-protection versions 1.5.4 and 2.0.0.rc3 and earlier contains a timing attack vulnerability in the CSRF token checking that can result in signatures can be exposed. This attack appear to be exploitable via network connectivity to the ruby application. This vulnerability appears to have been fixed in 1.5.5 and 2.0.0.

CVE-2018-1000119 Affected Rack protection Versions

2 component(s)
Fixed Versions:
1.5.52.0.0
Product / Package Ecosystem Affected Versions Fixed Version
rack-protection
RubyGems
< 1.5.5
1.5.5
rack-protection
RubyGems
≥ 2.0.0.beta1
< 2.0.0
2.0.0

References

Frequently Asked Questions

What is CVE-2018-1000119?
CVE-2018-1000119 is a security vulnerability in Rack protection involving rack-protection gem timing attack vulnerability when validating CSRF token under CWE-203: Observable Discrepancy.
Which Rack protection versions are affected?
Affected versions include releases prior to 1.5.5, 2.0.0 across affected packages: rack-protection.
What version fixes CVE-2018-1000119?
Upgrading to 1.5.5, 2.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rack-protection affected?
Yes, rack-protection is affected in releases prior to 1.5.5, 2.0.0. Upgrade your dependency to 1.5.5, 2.0.0 or later.
What is the CVSS score of CVE-2018-1000119?
CVE-2018-1000119 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2018-1000119?
CVE-2018-1000119 is classified under CWE-203: Observable Discrepancy (The product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor.).
How can I check RubyGems dependencies for CVE-2018-1000119?
Run the dependency tree command: 'inspect dependencies for rack-protection'. 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-688c-3x49-6rqj",
  "modified" : "2023-08-29T15:23:28Z",
  "published" : "2018-03-07T22:22:22Z",
  "aliases" : [ "CVE-2018-1000119" ],
  "summary" : "rack-protection gem timing attack vulnerability when validating CSRF token",
  "details" : "Sinatra rack-protection versions 1.5.4 and 2.0.0.rc3 and earlier contains a timing attack vulnerability in the CSRF token checking that can result in signatures can be exposed. This attack appear to be exploitable via network connectivity to the ruby application. This vulnerability appears to have been fixed in 1.5.5 and 2.0.0.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack-protection"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack-protection"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0.beta1"
      }, {
        "fixed" : "2.0.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.0.0.rc3"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-1000119"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sinatra/rack-protection/pull/98"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sinatra/sinatra/commit/8aa6c42ef724f93ae309fb7c5668e19ad547eceb#commitcomment-27964109"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:1060"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack-protection/CVE-2018-1000119.yml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sinatra/rack-protection"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2018/dsa-4247"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-203" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:18:34Z",
    "nvd_published_at" : null
  }
}