Skip to content

url: check syntax before applying default-protocol - #23273

Closed
bagder wants to merge 3 commits into
masterfrom
bagder/default-scheme
Closed

bagder wants to merge 3 commits into
masterfrom
bagder/default-scheme

Conversation

@bagder

@bagder bagder commented Oct 5, 2026

Copy link
Copy Markdown
Member

Otherwise a non-conformant URL could be turned into a valid one by prepending the scheme, causing surprises.

Verified by test 4039

Reported-by: Samuel Henrique

@github-actions github-actions Bot added the tests label Oct 5, 2026
@bagder
bagder marked this pull request as ready for review October 5, 2026 15:09
@bagder
bagder requested a balanced review from Copilot October 5, 2026 15:09

This comment was marked as outdated.

@testclutch

Copy link
Copy Markdown

Analysis of PR #23273 at ba3e7b9f:

Test 1146 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 72 different CI jobs (the link just goes to one of them).

Generated by Testclutch

@bagder
bagder force-pushed the bagder/default-scheme branch from ba3e7b9 to fe4e0bd Compare October 5, 2026 20:17
@bagder
bagder requested a balanced review from Copilot October 5, 2026 20:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The supplied URL-handle path still bypasses full file-URL validation when applying the default scheme.

Review effort: Balanced
Findings: None

Resolved since last review (3)

@bagder
bagder requested a balanced review from Copilot October 5, 2026 21:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

A guessed-scheme CURLOPT_CURLU handle can receive a duplicate scheme prefix, changing the destination host.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Comment thread lib/url.c Resolved
Otherwise a non-conformant URL could be turned into a valid one by
prepending the scheme, causing surprises.

Verified by test 4039 and 4040

Reported-by: Samuel Henrique

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Scheme lookup allocation errors must be propagated rather than silently ignored.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
Resolved since last review (1)

Comment thread lib/url.c Resolved
Comment thread lib/url.c Resolved
Add logging for applied default protocol when scheme is prepended.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@bagder bagder closed this in 0673aa2 Oct 6, 2026
@bagder
bagder deleted the bagder/default-scheme branch October 6, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants