Junglewise Threat Intelligence

hapi Denial of Service in CORS request handler

Severity: info · Published 2020-09-03

Technologies: hapi (npm). Vendors: npm, Hapi.

Executive brief

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.

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

Related threats