@hapi/wreck
Affected
- introduced
0, fixed18.1.2(semver)
Fixed versions
18.1.2
Fix
- Fixed version
18.1.2npm install @hapi/[email protected]
Advisory
Also known as: CVE-2026-48022
@hapi/wreck: Sensitive credential headers leak across cross-port and cross-scheme redirects
Impact
Wreck strips credential headers (Authorization, Cookie, Proxy-Authorization) before following a cross-origin redirect, but the origin check compares hostnames only and ignores scheme and port. As a result, credentials are forwarded intact across same-host port changes and HTTPS-to-HTTP downgrades, allowing a co-tenant on an adjacent port or a network-position attacker capable of forging a redirect to capture bearer tokens, session cookies, and proxy credentials and impersonate the victim against the upstream service. The fix replaces the hostname comparison with a full-origin comparison (scheme, host, and port), aligning the behavior with the WHATWG Fetch same-origin definition used by browsers.
Patches
Upgrade to >= 18.1.2.
Workarounds
redirects: 0 (default) and handle redirects manually with a strict origin check.beforeRedirect hook to inspect the redirect target and abort or strip sensitive headers before the follow-on request.Medium Basis: The source's own band: MODERATE
0, fixed 18.1.2 (semver)18.1.2
18.1.2npm install @hapi/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0