@hapi/wreck: Sensitive credential headers leak across cross-port and cross-scheme redirects
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
@hapi/wrecknpm | < 18.1.2 | 18.1.2 |
Affected products
9- osv-coords8 versionspkg:apk/chainguard/kibana-9.3pkg:apk/chainguard/kibana-9.3-iamguardedpkg:apk/chainguard/kibana-9.4pkg:apk/chainguard/kibana-9.4-iamguardedpkg:apk/chainguard/opensearch-dashboards-3-fipspkg:apk/chainguard/opensearch-dashboards-3-fips-security-dashboards-pluginpkg:apk/chainguard/opensearch-dashboards-3-security-dashboards-pluginpkg:apk/wolfi/opensearch-dashboards-3-security-dashboards-plugin
< 9.3.5-r3+ 7 more
- (no CPE)range: < 9.3.5-r3
- (no CPE)range: < 9.3.5-r3
- (no CPE)range: < 9.4.2-r3
- (no CPE)range: < 9.4.2-r3
- (no CPE)range: < 3.7.0-r2
- (no CPE)range: < 3.7.0-r0
- (no CPE)range: < 3.7.0-r0
- (no CPE)range: < 3.7.0-r0
Patches
Vulnerability mechanics
References
3News mentions
0No linked articles in our index yet.