# hapi Denial of Service in CORS request handler

Source: https://junglewise.ai/threats/hapi-denial-of-service-in-cors-request-handler-015ee3b1  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2020-09-03. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: info · Published 2020-09-03

hapi is a popular Node.js framework used to build web applications and APIs. The framework's CORS (Cross-Origin Resource Sharing) request handler contains a flaw that causes it to crash if an attacker sends specially crafted HTTP headers, potentially allowing an attacker to shut down the service entirely if error handling is not properly configured.

Technologies: [hapi (npm)](https://junglewise.ai/threats/technologies/hapi). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Informational severity, published 3 September 2020.

**Which products and versions are affected?** hapi (npm) SEMVER:introduced=0.0.0.

**Is there a fix for This vulnerability?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** 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.

## Technical details

The vulnerability is a Denial of Service flaw in the CORS request handler of all versions of hapi. When the handler processes invalid values in HTTP headers, it throws an unhandled system exception. If the application lacks proper exception handling, this unhandled error will cause the process to terminate, resulting in service unavailability. An attacker can trigger this by sending requests with malformed CORS-related headers over the network, requiring no authentication or user interaction. The fix is to migrate to @hapi/hapi, the maintained successor package.

## Affected products

- hapi hapi All versions

## Timeline

- 2020-09-03: disclosed

## References

- [https://www.npmjs.com/advisories/1481](https://www.npmjs.com/advisories/1481)

## Related threats

- [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 CORS preflight request header handling bypass](https://junglewise.ai/threats/cve-2015-9236-hapi-cors-preflight-request-header-handling-bypass)
- [hapi denial of service in date header parsing](https://junglewise.ai/threats/cve-2015-9241-hapi-denial-of-service-in-date-header-parsing)
