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

Source: https://junglewise.ai/threats/cve-2015-9236-hapi-cors-preflight-request-header-handling-bypass  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2018-06-07. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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)](https://junglewise.ai/threats/technologies/hapi). Vendors: [npm](https://junglewise.ai/threats/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

  ```sh
  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

- [https://github.com/hapijs/hapi/issues/2840](https://github.com/hapijs/hapi/issues/2840)

## Related threats

- [hapi Denial of Service in CORS request handler](https://junglewise.ai/threats/hapi-denial-of-service-in-cors-request-handler-015ee3b1)
- [hapi CORS configuration merge vulnerability](https://junglewise.ai/threats/cve-2015-9243-hapi-cors-configuration-merge-vulnerability)
- [hapijs hapi Rosetta-Flash JSONP vulnerability](https://junglewise.ai/threats/cve-2014-4671-hapijs-hapi-rosetta-flash-jsonp-vulnerability)
- [hapi denial of service via malformed accept-encoding header](https://junglewise.ai/threats/cve-2017-16013-hapi-denial-of-service-via-malformed-accept-encoding-header)
- [hapi denial of service in date header parsing](https://junglewise.ai/threats/cve-2015-9241-hapi-denial-of-service-in-date-header-parsing)
