GitHub Advisoryadvisory · npm
GHSA-x426-x7cc-3fpc @hapi/wreck: Sensitive credential headers leak across cross-port and cross-scheme redirects
MEDIUM
Official page ↗
- Aliases
- CVE-2026-48022
- Ecosystem
- npm
- Packages
- @hapi/wreck
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
- Weaknesses
- CWE-200, CWE-319, CWE-346, CWE-522, CWE-940
- Reviewed
- 2026-06-11
Affected packages
• npm @hapi/wreck: < 18.1.2 → fixed in 18.1.2
Description
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
• Set `redirects: 0` (default) and handle redirects manually with a strict origin check.
• Use the `beforeRedirect` hook to inspect the redirect target and abort or strip sensitive headers before the follow-on request.
Related
Alias · CVE (1)
- CVE-2026-48022 @hapi/wreck is an HTTP client utility. vulnerability
Weakness · CWE (5)
- CWE-200 Exposure of Sensitive Information to an Unauthorized Actor weakness
- CWE-319 Cleartext Transmission of Sensitive Information weakness
- CWE-346 Origin Validation Error weakness
- CWE-522 Insufficiently Protected Credentials weakness
- CWE-940 Improper Verification of Source of a Communication Channel weakness