Skip to content

[main] Restore slash-only PathString boundaries (CVE-2026-114156) - #70447

Merged
wtgodbe merged 1 commit into
dotnet:mainfrom
rbhanda:security/nov2026-114156
Nov 11, 2026
Merged

wtgodbe merged 1 commit into
dotnet:mainfrom
rbhanda:security/nov2026-114156

Conversation

@rbhanda

@rbhanda rbhanda commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Addresses CVE-2026-114156.

Testing

Not run locally. The focused repository test setup was blocked before compilation because the required .NET 12 SDK needs MSBuild 18.7 or newer, while this machine has MSBuild 17.15. CI validation is required.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: fdac132c-0926-4fda-8c97-88ae5b59b9fd
@github-actions github-actions Bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Nov 10, 2026
@rbhanda
rbhanda requested a review from halter73 November 10, 2026 18:41
@DeagleGross
DeagleGross marked this pull request as ready for review November 10, 2026 19:56
Copilot AI balanced review requested due to automatic review settings November 10, 2026 19:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Regression coverage is missing for rejecting leading backslashes and backslash segment boundaries, including empty matched and remaining outputs on failure.

2 open issues
What changed in this PR

Restores slash-only PathString behavior in HTTP abstractions, reversing the backslash handling introduced by #67093.

Changes:

  • Requires non-empty paths to begin with / and restores slash-only segment matching and concatenation.
  • Removes backslash-specific API remarks and updates the constructor error message.
  • Updates the constructor test and removes tests expecting backslash boundary behavior.
File Description
src/​Http/​Http.Abstractions/​test/​PathStringTests.cs Updates the expected error and removes backslash-handling cases.
src/​Http/​Http.Abstractions/​src/​Resources.resx Restores the slash-only validation resource name and message.
src/​Http/​Http.Abstractions/​src/​PathString.cs Restores slash-only construction, matching, concatenation, and documentation.

Review effort: Balanced

if (value1.StartsWith(value2, comparisonType))
{
return value1.Length == value2.Length || value1[value2.Length] is '/' or '\\';
return value1.Length == value2.Length || value1[value2.Length] == '/';
Comment on lines +13 to +16
public void CtorThrows_IfPathDoesNotHaveLeadingSlash()
{
ExceptionAssert.ThrowsArgument(() => new PathString("hello"), "value", "The path in 'value' must start with '/' or '\\'.");
// Act and Assert
ExceptionAssert.ThrowsArgument(() => new PathString("hello"), "value", "The path in 'value' must start with '/'.");
@wtgodbe

wtgodbe commented Nov 11, 2026

Copy link
Copy Markdown
Member

CodeCheck failure is a false positive

@wtgodbe
wtgodbe merged commit 7f65d4b into dotnet:main Nov 11, 2026
27 of 31 checks passed
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool November 11, 2026 16:40 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool November 11, 2026 16:40 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool November 11, 2026 16:41 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool November 11, 2026 16:43 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool November 11, 2026 16:44 — with GitHub Actions Inactive
@wtgodbe
wtgodbe temporarily deployed to copilot-pat-pool November 11, 2026 16:45 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ This pull request wasn't processed automatically.

This change requires specialized review. Please confirm whether documentation updates are needed and handle them through the appropriate process.

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 9fef36c6 Deployed Nov 11, 2026 by wtgodbe via conclusion #299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants