Incorrect handling of CORS preflight request headers

Module: hapi

Published: October 20th, 2015

Reported by: Eran Hammer

CVE-NONE

CWE-NONE

Vulnerable: <11.0.0
Patched: >=11.0.0

Overview

Hapi versions less than 11.0.0 implement CORS incorrectly and allowed for configurations that at best returned inconsistent headers and at worst allowed cross-origin activities that were expected to be forbidden. [1]

'If 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.' [2]

Remediation

Updated to hapi version 11.0.0 or greater

References

Sign up FREE for
nsp Continuous Security

Free for open source and the first private repo,
then just $1/mo per private repo