Vulnerabilities in pkg:gem/rack-cors

PACKAGE
Advisory Identifier: GHSA-785g-282q-pwvx
Advisory Summary

CVE-2024-27456 is a MODERATE rack cors middleware has insecure vulnerability (General Security Weakness) affecting Rack cors libraries in the RubyGems ecosystem. The issue involves rack cors middleware has insecure file permissions. Remediation is available by upgrading affected packages to version 2.0.2.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/rack-cors

3 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-785g-282q-pwvx CVE-2024-27456 MODERATE Rack CORS Middleware has Insecure File Permissions
GHSA-2j9c-9vmv-7m39 CVE-2017-11173 HIGH Missing Regex anchor in Rack-Cors allows malicious third party site to perform CORS request
GHSA-pf8f-w267-mq2h CVE-2019-18978 MODERATE The rack-cors rubygem may allow directory traveral

CVE-2024-27456 at a Glance

CVE Identifier CVE-2024-27456
GHSA Identifier GHSA-785g-282q-pwvx
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Rack cors
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2024-27456

To remediate this vulnerability, upgrade all affected Rack cors 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-cors fixed: 2.0.2
Upgrade rack-cors to 2.0.2
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-cors

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-27456, inspect your project dependencies for Rack cors:

inspect dependencies for rack-cors

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

rack-cors (aka Rack CORS Middleware) 2.0.1 has 0666 permissions for the .rb files.

CVE-2024-27456 Affected Rack cors Versions

1 component(s)
Fixed Versions:
2.0.2
Product / Package Ecosystem Affected Versions Fixed Version
rack-cors
RubyGems
≥ 2.0.1
< 2.0.2
All 1 versions
2.0.1
2.0.2

References

Frequently Asked Questions

What is CVE-2024-27456?
CVE-2024-27456 is a security vulnerability in Rack cors involving Rack CORS Middleware has Insecure File Permissions under General Security Weakness.
Which Rack cors versions are affected?
Affected versions include releases prior to 2.0.2 across affected packages: rack-cors.
What version fixes CVE-2024-27456?
Upgrading to 2.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is rack-cors affected?
Yes, rack-cors is affected in releases prior to 2.0.2. Upgrade your dependency to 2.0.2 or later.
What CWE is associated with CVE-2024-27456?
CVE-2024-27456 is classified under General Security Weakness.
How can I check RubyGems dependencies for CVE-2024-27456?
Run the dependency tree command: 'inspect dependencies for rack-cors'. 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-785g-282q-pwvx",
  "modified" : "2024-03-04T18:51:48Z",
  "published" : "2024-02-26T18:30:31Z",
  "aliases" : [ "CVE-2024-27456" ],
  "summary" : "Rack CORS Middleware has Insecure File Permissions",
  "details" : "rack-cors (aka Rack CORS Middleware) 2.0.1 has 0666 permissions for the .rb files.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "rack-cors"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.1"
      }, {
        "fixed" : "2.0.2"
      } ]
    } ],
    "versions" : [ "2.0.1" ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-27456"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cyu/rack-cors/issues/274"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-785g-282q-pwvx"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cyu/rack-cors"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/cyu/rack-cors/blob/878063987bd1ca956282dda95697fd821bf24d2e/CHANGELOG.md#changed"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rack-cors/CVE-2024-27456.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-26T22:15:06Z",
    "nvd_published_at" : "2024-02-26T16:28:00Z"
  }
}