CVE-2015-9236: Hapi Incorrect Handling Of CORS Preflight Vulnerability
MODERATECVE-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
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.
npm install hapi@11.0.0
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
CVE-2015-9236 Affected Hapi Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
hapi
|
npm |
< 11.0.0
|
11.0.0
|
References
Frequently Asked Questions
What is CVE-2015-9236?
Which Hapi versions are affected?
What version fixes CVE-2015-9236?
Is hapi affected?
What CWE is associated with CVE-2015-9236?
How can I check npm dependencies for CVE-2015-9236?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}