Executive brief
@hapi/boom is a popular software library used by web developers to create standardized HTTP error messages. A security flaw in older versions of this library fails to properly clean error messages before displaying them to users. This could allow an attacker to trick a user's browser into executing malicious code, potentially leading to the theft of login sessions or sensitive information.
Technical details
@hapi/boom prior to version 0.3.8 is vulnerable to reflected Cross-Site Scripting (XSS). The vulnerability exists because the library fails to properly output-encode or escape error messages before they are rendered in a browser context. An attacker can craft a malicious payload that, when processed as part of an error object and displayed to a victim, executes arbitrary JavaScript in the context of the victim's session. This can lead to session hijacking or unauthorized actions on behalf of the user. The issue is resolved in version 0.3.8 by implementing proper XSS protections in the error message handling logic.
Affected products
- hapi @hapi/boom < 0.3.8
Timeline
- 2013-03-30: disclosed: Vulnerability first disclosed/introduced according to Snyk records
- 2020-01-09: advisory: Snyk advisory published
- 2020-09-04: advisory: GitHub advisory published