CVE-2015-9236: hapi CORS preflight request header handling bypass

CVE-2015-9236 · Severity: info · Published 2018-06-07

hapi is a popular Node.js web application framework. Versions prior to 11.0.0 incorrectly implement Cross-Origin Resource Sharing (CORS) security controls, allowing requests that should be blocked by CORS policies to proceed. An attacker can exploit inconsistent CORS header handling to bypass cross-origin restrictions and perform unauthorized actions from malicious websites against applications using vulnerable hapi versions.

Technologies: hapi (npm). Vendors: npm.

Quick answers

Is CVE-2015-9236 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2015-9236 being exploited in the wild.
How severe is CVE-2015-9236?
Informational severity, published 7 June 2018.
Which products and versions are affected?
hapi (npm) SEMVER:introduced=0,fixed=11.0.0.
Is there a fix for CVE-2015-9236?
Yes. hapi (npm): upgrade to 11.0.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2015-9236 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2015-9236?
Check whether you run hapi (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • hapi (npm): upgrade to 11.0.0 or later
    npm install hapi@11.0.0

Technical details

The vulnerability stems from incorrect CORS implementation in hapi prior to version 11.0.0. When a connection has CORS enabled globally but a specific route has it disabled (and the route method is not GET), the OPTIONS preflight request incorrectly returns default CORS headers, while the subsequent actual request returns no CORS headers. This inconsistency allows browser-based attackers to bypass CORS restrictions through HTTP preflight handling. The attack requires the attacker to trick a user's browser into making cross-origin requests to a vulnerable hapi application, but no authentication is required. The fix is to update to hapi version 11.0.0 or later, which properly handles route-specific CORS overrides and consistency between preflight and actual request responses.

Affected products

  • hapi hapi before 11.0.0

Identifiers

  • CVE-2015-9236
  • GHSA-vwrf-r5r4-7775

Timeline

  • 2015-10-14: disclosed
  • 2015: patched: Fix released in version 11.0.0
  • 2018-06-07: advisory

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.