Skip to content

Conversation

jkoritzinsky
Copy link
Member

Fixes Issue #119566

main PR #119568

Description

Customer Impact

Prevents crashes when a path in deps.json or a framework name in runtimeconfig.json contains a '%' character.

Regression

Yes, introduced by #102295

Testing

Manual validation with testing

Risk

Low risk. This is a standard fix for this scenario, and it's only reachable on .NET 9 with an opt-in COREHOST_TRACE=1 environment variable.

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

@Copilot Copilot AI review requested due to automatic review settings September 16, 2025 22:54
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a format injection vulnerability in the hosting Windows PAL printf functions when output is redirected to a file. The issue occurs when paths in deps.json or framework names in runtimeconfig.json contain '%' characters, which are interpreted as format specifiers and can cause crashes.

  • Replaces direct pal::file_vprintf call with a safer file_printf wrapper that uses %s format specifier
  • Adds a new file_printf helper function to properly handle string formatting
  • Prevents format injection attacks when trace output is redirected to files

@JulieLeeMSFT
Copy link
Member

Approved. Please get code review and check test results.

Copy link
Member

@JulieLeeMSFT JulieLeeMSFT left a comment

Choose a reason for hiding this comment

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

LGTM.

@JulieLeeMSFT JulieLeeMSFT added the Servicing-consider Issue for next servicing release review label Sep 16, 2025
@JulieLeeMSFT
Copy link
Member

CC @jeffschwMSFT.

@rbhanda rbhanda modified the milestones: 9.0.x, 9.0.11 Oct 2, 2025
@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 2, 2025
@jkoritzinsky
Copy link
Member Author

/azp run runtime

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jkoritzinsky
Copy link
Member Author

/ba-g failures matched to existing issue, but BA is not green because this is a servicing branch

@jkoritzinsky jkoritzinsky merged commit 836cc98 into dotnet:release/9.0-staging Oct 7, 2025
150 of 154 checks passed
@jkoritzinsky jkoritzinsky deleted the 9.0-host-printf branch October 7, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants