CVE-2015-9236: Hapi Incorrect Handling Of CORS Preflight Vulnerability

MODERATE
Advisory Identifier: GHSA-vwrf-r5r4-7775
CWE-284
Published
Advisory Summary

CVE-2015-9236 is a MODERATE incorrect handling of cors preflight vulnerability (CWE-284: Improper Access Control) affecting Hapi libraries in the npm ecosystem. The issue involves incorrect handling of cors preflight request headers in hapi. Remediation is available by upgrading affected packages to version 11.0.0.

CVE-2015-9236 at a Glance

CVE Identifier CVE-2015-9236
GHSA Identifier GHSA-vwrf-r5r4-7775
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-284: Improper Access Control
Affected Product Hapi
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2015-9236

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

hapi fixed: 11.0.0
npm install hapi@11.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:

npm ls hapi

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2015-9236, inspect your project dependencies using npm:

npm ls hapi

Analyze the terminal output to locate any version of Hapi in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 11.0.0), your application is affected.

Note: The npm ls hapi command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Hapi, 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

Versions of `hapi` prior to 11.0.0 implement CORS incorrectly, allowing for configurations that at best return inconsistent headers, and at worst allow cross-origin activities that are expected to be forbidden. If the connection has CORS enabled but one route has it off, and the route is not GET, the OPTIONS prefetch request will return the default CORS headers and then the actual request will go through and return no CORS headers. This defeats the purpose of turning CORS on the route. ## Recommendation Update to version 11.0.0 or later.

CVE-2015-9236 Affected Hapi Versions

1 component(s)
Fixed Versions:
11.0.0
Product / Package Ecosystem Affected Versions Fixed Version
hapi
npm
< 11.0.0
11.0.0

References

Frequently Asked Questions

What is CVE-2015-9236?
CVE-2015-9236 is a security vulnerability in Hapi involving Incorrect handling of CORS preflight request headers in hapi under CWE-284: Improper Access Control.
Which Hapi versions are affected?
Affected versions include releases prior to 11.0.0 across affected packages: hapi.
What version fixes CVE-2015-9236?
Upgrading to 11.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hapi affected?
Yes, hapi is affected in releases prior to 11.0.0. Upgrade your dependency to 11.0.0 or later.
What CWE is associated with CVE-2015-9236?
CVE-2015-9236 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check npm dependencies for CVE-2015-9236?
Run the dependency tree command: 'npm ls hapi'. 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-vwrf-r5r4-7775",
  "modified" : "2020-08-31T18:09:06Z",
  "published" : "2018-06-07T19:43:25Z",
  "aliases" : [ "CVE-2015-9236" ],
  "summary" : "Incorrect handling of CORS preflight request headers in hapi",
  "details" : "Versions of `hapi` prior to 11.0.0 implement CORS incorrectly, allowing for configurations that at best return inconsistent headers, and at worst allow cross-origin activities that are expected to be forbidden. \n\nIf the connection has CORS enabled but one route has it off, and the route is not GET, the OPTIONS prefetch request will return the default CORS headers and then the actual request will go through and return no CORS headers. This defeats the purpose of turning CORS on the route.\n\n\n## Recommendation\n\nUpdate to version 11.0.0 or later.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "hapi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "11.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-9236"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapijs/hapi/issues/2840"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapijs/hapi/issues/2850"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-vwrf-r5r4-7775"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/45"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:58:39Z",
    "nvd_published_at" : null
  }
}