Skip to content

[release/11.0-rc1] Reject malformed UTF-8 number separators - #132471

Merged
tannergooding merged 1 commit into
release/11.0-rc1from
backport/pr-132417-to-release/11.0-rc1
Aug 19, 2026
Merged

[release/11.0-rc1] Reject malformed UTF-8 number separators#132471
tannergooding merged 1 commit into
release/11.0-rc1from
backport/pr-132417-to-release/11.0-rc1

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Backport of #132417 to release/11.0-rc1

/cc @tannergooding

Customer Impact

  • Customer reported
  • Found internally

Malformed UTF-8 can be accepted as valid numeric input when a standalone 0xA0 continuation byte occurs where a configured number-format symbol contains an ASCII space. The expected behavior is to reject the malformed input. This affects culture-aware parsing across the CoreLib numeric types and the separate BigInteger shared-source instantiation.

Regression

  • Yes
  • No

Introduced by #123783 in February 2026. That change intentionally made space/NBSP normalization bidirectional for UTF-16, but inadvertently applied Unicode normalization to individual UTF-8 bytes as well.

Testing

Regression tests were added for both the CoreLib numeric parser (Int32) and BigInteger; each failed before the fix and passed afterward. A checked CoreLib build succeeded, as did the complete System.Runtime.Tests suite (77,366 tests) and System.Runtime.Numerics.Tests suite (8,426 tests).

The issue was missed because #123783 tested only UTF-16 input even though the modified shared implementation also instantiates over one-byte UTF-8 elements.

Risk

Low. The production change restricts Unicode compatibility normalization to the UTF-16 specialization. Exact UTF-8 matching is unchanged, malformed mismatched bytes are rejected, and the intended bidirectional UTF-16 behavior remains intact. Both shared-source instantiations and their complete test suites were validated.

Note

This pull request description was drafted by GitHub Copilot.

`MatchChars<TChar>` currently applies UTF-16 NBSP normalization directly
to UTF-8 bytes. This allows a standalone `0xA0` continuation byte to
match an ASCII space in a configured number separator, so malformed
UTF-8 can parse successfully.

Restrict the compatibility normalization to UTF-16 while preserving
exact UTF-8 matching. Regression tests cover both the CoreLib numeric
parser and the separate `BigInteger` shared-source instantiation.

This regressed in #123783.

> [!NOTE]
> This pull request description was drafted by GitHub Copilot.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

@tannergooding

Copy link
Copy Markdown
Member

CC. @jeffhandley, @artl93

@artl93 artl93 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Core functionality regression. Approved.

@artl93 artl93 added the Servicing-consider Issue for next servicing release review label Aug 18, 2026
@tannergooding tannergooding added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Aug 18, 2026
@tannergooding

Copy link
Copy Markdown
Member

/ba-g System.Net.HttpListener.Tests timeout

@tannergooding
tannergooding merged commit 5214d79 into release/11.0-rc1 Aug 19, 2026
95 of 101 checks passed
@tannergooding
tannergooding deleted the backport/pr-132417-to-release/11.0-rc1 branch August 19, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Numerics Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants