Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(Headers): don't forward secure headers on protocol change - #1599

#1599
Merged
jimmywarting merged 2 commits into
node-fetch:mainnode-fetch/node-fetch:mainfrom
max-stytch:max/headers-protocol-downgrademax-stytch/node-fetch:max/headers-protocol-downgradeCopy head branch name to clipboard
Jul 18, 2022
Merged

fix(Headers): don't forward secure headers on protocol change#1599
jimmywarting merged 2 commits into
node-fetch:mainnode-fetch/node-fetch:mainfrom
max-stytch:max/headers-protocol-downgrademax-stytch/node-fetch:max/headers-protocol-downgradeCopy head branch name to clipboard

Conversation

@max-stytch

Copy link
Copy Markdown
Contributor

Purpose

Resolves https://www.huntr.dev/bounties/db31e05b-ff10-4057-81a3-37445bf161cd/ by validating that the URL protocol remains the same when determining whether to send secure headers on a redirect.
This prevents MITM attacks from sniffing secure headers when a redirect downgrades a https:// to a http://

Changes

Adds an additional check to the redirect follow step to determine whether to send secure headers or not.

Additional information


  • I updated readme
  • I added unit test(s)

@jimmywarting
jimmywarting requested review from LinusU and gr2m July 12, 2022 16:32

@gr2m gr2m left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great PR 👍🏼

@jimmywarting
jimmywarting merged commit e87b093 into node-fetch:main Jul 18, 2022
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.2.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

@victal

victal commented Jul 19, 2022

Copy link
Copy Markdown

Sorry if this is the wrong place to ask, but since this PR is a fix for a security issue, will (or should) it be backported to the 2.x branch as it was done for #1449?

Is this done automatically or should I (or someone else interested in the fix) open another PR targeting the 2.x branch for that?

@jimmywarting

Copy link
Copy Markdown
Collaborator

if you @victal could create a PR to the v2 branch then that would be grate!

@victal

victal commented Jul 19, 2022

Copy link
Copy Markdown

Just created #1605 for it, thanks!

jimmywarting pushed a commit that referenced this pull request Jul 19, 2022
backport for #1599 to the 2.x branch

Co-authored-by: Guilherme Victal <guilherme.a@dasa.com.br>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.