Add cryptographic security note to System.Random API docs#12481
Merged
Add cryptographic security note to System.Random API docs#12481
Conversation
Agent-Logs-Url: https://github.com/dotnet/dotnet-api-docs/sessions/864bf564-cbba-4176-b4fa-a901073a6b7c Co-authored-by: GrabYourPitchforks <1746272+GrabYourPitchforks@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update System.Random documentation to include cryptographic note
Add cryptographic security note to System.Random API docs
Apr 2, 2026
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones |
GrabYourPitchforks
approved these changes
Apr 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a cryptographic safety caveat to the System.Random API reference documentation so users aren’t misled into using Random for security-sensitive scenarios.
Changes:
- Replaced the one-line
<remarks>with a markdown<format>block. - Added a
[!NOTE]callout pointing users toSystem.Security.Cryptography.RandomNumberGeneratorfor cryptographically secure randomness. - Reformatted the existing supplemental remarks link as a markdown link.
gewarren
approved these changes
Apr 2, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The main
System.RandomAPI reference lacked the security caveat present in the supplementary docs, leaving users unaware thatSystem.Randomis unsuitable for cryptographic use.Changes
xml/System/Random.xml: Expanded the type-level<remarks>from a bare supplementary-docs link into a<format type="text/markdown">block containing:[!NOTE]callout directing users toSystem.Security.Cryptography.RandomNumberGeneratorfor cryptographically secure random numbersThe rendered note will read: