GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — url: improve port validation by Trott · Pull Request #45012 · nodejs/node

Conversation

@Trott

@Trott Trott commented Oct 15, 2022

Copy link
Copy Markdown
Member

If a port is not a number, throw rather than treating the : that delineates the port as part of the path. This is consistent with WHATWG URL and also mitigates hostname-spoofing.

Concerns about hostname-spoofing were raised and presented in excellent detail by pyozzi-toss ([email protected]/Security-Tech Team in Toss).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss, pyozzi-toss, and JHansol reacted with thumbs up emoji
All reactions
  • 👍 3 reactions
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. url Issues and PRs related to the legacy built-in url module. labels Oct 15, 2022
@Trott Trott added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 15, 2022
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 15, 2022
@nodejs-github-bot

nodejs-github-bot commented Oct 15, 2022

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/47277/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Oct 15, 2022

Copy link
Copy Markdown
Member Author

As with #45011, this could be considered a semver-major breaking change, but we may want to consider this is a bugfix instead. Out of caution, though, we should run CITGM. We should also definitely make sure that git+ssh URLs continue to work (or continue to not work) in npm before and after this change.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

RafaelGSS
RafaelGSS approved these changes Oct 15, 2022
View reviewed changes
anonrig
anonrig requested changes Oct 15, 2022
View reviewed changes
Comment thread lib/url.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/url.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Trott added 2 commits October 15, 2022 09:52
@Trott
url: improve port validation
c48ebb7
If a port is not a number, throw rather than treating the `:` that
delineates the port as part of the path. This is consistent with WHATWG
URL and also mitigates hostname-spoofing.

Concerns about hostname-spoofing were raised and presented in excellent
detail by pyozzi-toss ([email protected]/Security-Tech Team in Toss).
@Trott
fixup! url: improve port validation
991d54c
@Trott
Trott force-pushed the toss-2 branch from e2d26c3 to 991d54c Compare October 15, 2022 17:29
@Trott
fixup! fixup! url: improve port validation
82bef86
@Trott Trott added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 15, 2022
anonrig
anonrig approved these changes Oct 15, 2022
View reviewed changes
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 15, 2022
@nodejs-github-bot

nodejs-github-bot commented Oct 15, 2022

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/47282/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Oct 15, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/3019/ (It will 404 until job 3018 finishes, though.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aduh95
aduh95 approved these changes Oct 15, 2022
View reviewed changes
jasnell
jasnell approved these changes Oct 15, 2022
View reviewed changes
@Trott

Trott commented Oct 15, 2022

Copy link
Copy Markdown
Member Author

CITGM results look good to me

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott Trott added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Oct 15, 2022
@anonrig anonrig added the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 17, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Oct 17, 2022
@nodejs-github-bot
nodejs-github-bot merged commit 5f7730e into nodejs:main Oct 17, 2022
@nodejs-github-bot

nodejs-github-bot commented Oct 17, 2022

Copy link
Copy Markdown
Collaborator

Landed in 5f7730e

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

RafaelGSS pushed a commit that referenced this pull request Nov 1, 2022
@Trott @RafaelGSS
url: improve port validation
4ecad09
If a port is not a number, throw rather than treating the `:` that
delineates the port as part of the path. This is consistent with WHATWG
URL and also mitigates hostname-spoofing.

Concerns about hostname-spoofing were raised and presented in excellent
detail by pyozzi-toss ([email protected]/Security-Tech Team in Toss).

PR-URL: #45012
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Nov 1, 2022
v19.1.0 proposal #45269
Merged
RafaelGSS pushed a commit that referenced this pull request Nov 10, 2022
@Trott @RafaelGSS
url: improve port validation
84e7388
If a port is not a number, throw rather than treating the `:` that
delineates the port as part of the path. This is consistent with WHATWG
URL and also mitigates hostname-spoofing.

Concerns about hostname-spoofing were raised and presented in excellent
detail by pyozzi-toss ([email protected]/Security-Tech Team in Toss).

PR-URL: #45012
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@merceyz merceyz mentioned this pull request Nov 17, 2022
test: fix constraints test to handle paths containing spaces yarnpkg/berry#5073
Merged
3 tasks done
@merceyz

merceyz commented Nov 17, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

As with #45011, this could be considered a semver-major breaking change, but we may want to consider this is a bugfix instead. Out of caution, though, we should run CITGM. We should also definitely make sure that git+ssh URLs continue to work (or continue to not work) in npm before and after this change.

This ended up breaking git+ssh URLs in Yarn.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott
Trott deleted the toss-2 branch November 19, 2022 13:12
This was referenced Nov 19, 2022
node 19.1 breaks url.parse #45514
Closed
url: improve url.parse() compliance with WHATWG URL #45011
Merged
@Trott Trott added baking-for-lts PRs whose changes need more time before an LTS backport. dont-land-on-v14.x labels Nov 19, 2022
@Trott Trott mentioned this pull request Nov 19, 2022
Revert "url: improve port validation" #45517
Merged
Trott added a commit to Trott/io.js that referenced this pull request Nov 19, 2022
@Trott
Revert "url: improve port validation"
d6439fd
This reverts commit 5f7730e.

This change broke too many edge cases in the ecosystem. Reverting it
re-introduces some host-spoofing possibilities, so we won't want to
revert forever, but the issue is long-lived enough and not sufficiently
critical that we can't wait for a major release to introduce it as a
breaking change. After this lands, I plan to re-introduce this as a
change that throws a warning rather than an error, after which we can
land a semver-major that re-introduces the error and try to get the word
out to maintainers of likely-affected packages.

Closes: nodejs#45514
Refs: nodejs#45012
@richardlau richardlau removed the baking-for-lts PRs whose changes need more time before an LTS backport. label Nov 19, 2022
@richardlau

richardlau commented Nov 19, 2022

Copy link
Copy Markdown
Member

Given the ecosystem breakage I can't see how this can land in LTS so I've removed the baking-for-lts label.

Trott reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nodejs-github-bot pushed a commit that referenced this pull request Nov 19, 2022
@Trott
Revert "url: improve port validation"
bd965aa
This reverts commit 5f7730e.

This change broke too many edge cases in the ecosystem. Reverting it
re-introduces some host-spoofing possibilities, so we won't want to
revert forever, but the issue is long-lived enough and not sufficiently
critical that we can't wait for a major release to introduce it as a
breaking change. After this lands, I plan to re-introduce this as a
change that throws a warning rather than an error, after which we can
land a semver-major that re-introduces the error and try to get the word
out to maintainers of likely-affected packages.

Closes: #45514
Refs: #45012
PR-URL: #45517
Fixes: #45514
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
ruyadorno pushed a commit that referenced this pull request Nov 21, 2022
@Trott @ruyadorno
Revert "url: improve port validation"
6bdd2c3
This reverts commit 5f7730e.

This change broke too many edge cases in the ecosystem. Reverting it
re-introduces some host-spoofing possibilities, so we won't want to
revert forever, but the issue is long-lived enough and not sufficiently
critical that we can't wait for a major release to introduce it as a
breaking change. After this lands, I plan to re-introduce this as a
change that throws a warning rather than an error, after which we can
land a semver-major that re-introduces the error and try to get the word
out to maintainers of likely-affected packages.

Closes: #45514
Refs: #45012
PR-URL: #45517
Fixes: #45514
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
@merceyz merceyz mentioned this pull request Nov 26, 2022
fix(git): normalize repo url without legacy url.parse yarnpkg/berry#5100
Merged
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
@anonrig anonrig anonrig approved these changes
@aduh95 aduh95 aduh95 approved these changes
@RafaelGSS RafaelGSS RafaelGSS approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. needs-ci PRs that need a full CI run. url Issues and PRs related to the legacy built-in url module.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@Trott @nodejs-github-bot @merceyz @richardlau @jasnell @anonrig @aduh95 @RafaelGSS
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.