Merging internal commits for release/9.0 - #130722
Merged
Merged
Conversation
Fix CRLF encoding in EightBitStream ---- #### AI description (iteration 1) #### PR Classification Bug fix to correctly handle CRLF encoding across write boundaries in `EightBitStream`. #### PR Summary Fixes delayed CR handling so CRLF detection and dot-stuffing remain correct when a write ends with `\r`. - `src/libraries/System.Net.Mail/src/System/Net/Mime/EightBitStream.cs`: Refactored `EncodeLines` to process a `ReadOnlySpan<byte>` and added `_lastWriteEndedWithCr` state to defer writing `\r` until confirming a following `\n`. - `src/libraries/System.Net.Mail/src/System/Net/Mime/EightBitStream.cs`: Added `Dispose` override to flush a pending trailing `\r` to the underlying stream. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> ---- #### AI description (iteration 1) #### PR Classification Bug fix addressing incorrect CRLF (carriage return line feed) encoding handling in the EightBitStream class. #### PR Summary Fixes a bug in CRLF encoding by deferring the writing of CR characters until determining if they're part of a CRLF sequence, preventing incorrect line ending handling when CR and LF bytes are split across buffer boundaries. - `EightBitStream.cs`: Added `_lastWriteEndedWithCr` flag to track when a write operation ends with a CR byte, enabling proper CRLF detection across buffer boundaries - `EightBitStream.cs`: Modified `EncodeLines()` method to defer writing CR bytes until the next byte is examined to confirm CRLF sequence - `EightBitStream.cs`: Implemented `Dispose()` method override to write any deferred CR byte during stream disposal - `EightBitStream.cs`: Changed `EncodeLines()` signature to accept `ReadOnlySpan<byte>` instead of separate buffer, offset, and count parameters
…S packets Fix SslStream handshake with malformed TLS packets ---- #### AI description (iteration 1) #### PR Classification Bug fix for handling malformed TLS packets during SSL/TLS handshake to prevent potential security issues. #### PR Summary This pull request fixes a security vulnerability where malformed TLS packets during handshake could cause improper error handling. The fix ensures that invalid TLS frame headers are properly detected and throw appropriate exceptions instead of silently failing. - `TlsFrameHelper.cs`: Added explicit `return false` for unknown TLS frame formats instead of continuing with invalid data - `SslStream.IO.cs`: Enhanced frame validation in `ProcessTlsFrame` to throw `AuthenticationException` when `TryGetFrameHeader` fails, and consolidated error handling in `ReadFrameAsync` to use consistent exception types - `SslStreamStreamToStreamTest.cs`: Added test `MalformedPacketsDuringHandshake_ThrowsIOException` to verify that malformed TLS packets during handshake properly throw `AuthenticationException` <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
…ed on unsupported platforms. Throw PNSE when Extended Protection is used on unsupported platforms. ---- #### AI description (iteration 1) #### PR Classification Bug fix to throw PlatformNotSupportedException when Extended Protection is used on platforms that don't support it. #### PR Summary This PR adds platform validation to prevent the use of Extended Protection on unsupported platforms (non-Windows) by throwing a PlatformNotSupportedException when PolicyEnforcement.Always is configured. - `NegotiateAuthentication.cs`: Added validation check to throw PlatformNotSupportedException when Extended Protection policy enforcement is set to Always on platforms that don't support it - `NegotiateAuthenticationTests.cs`: Added unit test to verify PlatformNotSupportedException is thrown on Unix platforms when Extended Protection is enabled - `Strings.resx`: Added error message resource string for Extended Protection not supported scenario <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
…2 PING ACKs Add metrics for outstanding PING and SETTING ACK packet count. ---- #### AI description (iteration 1) #### PR Classification This is a new feature that adds metrics and safeguards to track and limit the count of pending PING and SETTINGS ACKs in HTTP/2 connections. #### PR Summary Implements tracking of in-flight PING and SETTINGS ACKs with a configurable maximum limit to prevent resource exhaustion in HTTP/2 connections. When the limit is exceeded, the connection is aborted with an error. - `Http2Connection.cs`: Added `_pendingReplies` counter with a maximum limit of 10,000 untransmitted ACKs - `Http2Connection.cs`: Modified `SendSettingsAckAsync()` and `SendPingAsync()` methods to increment the counter before writing and decrement after successful write - `Http2Connection.cs`: Implemented `IncrementAcksInFlight()` and `DecrementAcksInFlight()` helper methods with overflow protection that aborts the connection when the limit is exceeded <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Resolves https://dev.azure.com/devdiv/DevDiv/_workitems/edit/3004352 ---- #### AI description (iteration 2) #### PR Classification Security fix to prevent potential cross-site scripting (XSS) vulnerabilities by HTML-encoding user-controlled parameters before rendering them in debug error pages. #### PR Summary This pull request adds HTML encoding to incoming URL parameters before they are displayed in the debug proxy error pages to prevent XSS attacks. The changes ensure that `targetApplicationUrl` and `debuggerTabsListUrl` are properly sanitized before being rendered in HTML responses. - `WebAssemblyNetDebugProxyAppBuilderExtensions.cs`: Added HTML encoding for `targetApplicationUrl` and `debuggerTabsListUrl` variables at the beginning of error handling logic - `WebAssemblyNetDebugProxyAppBuilderExtensions.cs`: Replaced inline `WebUtility.HtmlEncode()` calls with pre-encoded variables throughout the error page HTML responses <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
…plicate check Port of https://dev.azure.com/dnceng/internal/_git/dotnet-runtime/pullrequest/59533 (limits in the tests are relaxed comparing to originally reviewed version due to CI and 6.0 begin slower and wanting to keep the code consistent - original PR will be adjusted shortly) ---- #### AI description (iteration 1) #### PR Classification Performance optimization to fix a quadratic-time algorithm in XML attribute duplicate checking logic. #### PR Summary This PR addresses a performance bottleneck in the XML attribute duplicate checking mechanism by replacing a quadratic O(n²) sorting-based approach with a linear O(n) HashSet-based approach, and adds comprehensive performance tests to validate the improvement. - `XmlTextReaderImpl.cs`: Replaced `_attrDuplSortingArray` with `_attrDuplSet` (HashSet) for duplicate attribute detection, and reduced `MaxAttrDuplWalkCount` from 250 to 64 to trigger optimized path earlier - `XmlTextReaderImplHelpers.cs`: Added `AtomizedNameEqualityComparer` inner class to enable HashSet-based duplicate checking using reference equality for atomized strings - `XPathNodeInfoAtom.cs`: Improved `GetHashCode()` implementation to include all fields checked by `Equals()` using `RuntimeHelpers.GetHashCode()` for consistent hashing of reference types - `AttributeReadingPerformanceTests.cs`: Added new test file with multiple test cases validating linear scaling behavior across different scenarios (various attribute counts, URI lengths, and reader types) <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
…ity fixes for 7B #### AI description (iteration 1) #### PR Classification Security fixes to address vulnerabilities related to processing large transform types and excessive encrypted elements in XML digital signatures. #### PR Summary This PR adds security mitigations to prevent denial-of-service attacks in `System.Security.Cryptography.Xml` by implementing limits on transform type sizes and the number of decrypted data elements, along with comprehensive test coverage for these new protections. - `SignedXml_SignatureMethodAlgorithm.cs`: Added test `SignedXml_LargeTransformType_ThrowsCryptographicException` to verify that excessively large transform type names (100k nested types) now throw `CryptographicException` instead of potentially causing process crashes. - `SignedXml_SignatureMethodAlgorithm.cs`: Added tests to validate default limit of 100 encrypted elements and verify `CryptographicException` is thrown when exceeded. - `SignedXml_SignatureMethodAlgorithm.cs`: Added tests to verify configurable AppContext switch `MaxDecryptedDataElementsAppContextSwitch` allows customizing the encrypted element limit, including disabling it entirely with value 0. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
…-merge-9.0-2026-07-14-2017
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security |
Member
|
/ba-g Created tracking WI for newly introduced test timeout. Rest of them looks like ios failures common these days which do not releate to any change. |
mrek-msft
approved these changes
Jul 16, 2026
This was referenced Aug 13, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.