Vulnerabilities/

follow-redirects leaks Custom Authentication Headers to Cross-Domain Redirect Targets

Severity:
Medium

Description

When an HTTP request follows a cross-domain redirect (301/302/307/308), follow-redirects only strips authorization, proxy-authorization, and cookie headers (matched by regex at index.js:469-476). Any custom authentication header (e.g., X-API-Key, X-Auth-Token, Api-Key, Token) is forwarded verbatim to the redirect target.

Recommendation

Update the follow-redirects package to the latest compatible version. Followings are version details:

References

Related Issues

Tags:
npm
follow-redirects
Anything's wrong? Let us know Last updated on April 14, 2026