Reword some regex safety warnings#54621
Open
GrabYourPitchforks wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the .NET regular expression security guidance to avoid implying that timeouts alone protect against all hostile scenarios, and it adds clearer cross-links between related sections.
Changes:
- Rewords the shared regex warning include to focus on ReDoS risk and point readers to the best-practices guidance.
- Adds targeted warnings clarifying that NonBacktracking and timeouts mitigate expensive input, not malicious patterns.
- Updates the external reference from CISA DoS guidance to OWASP’s ReDoS-focused material.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| includes/regex.md | Updates the reusable warning text to reference OWASP ReDoS guidance and link to the best-practices page. |
| docs/standard/base-types/regular-expression-options.md | Adds a warning in the NonBacktracking section clarifying threat model and linking to trusted-pattern guidance. |
| docs/standard/base-types/best-practices-regex.md | Adds a consolidated security warning up front and a timeout-specific warning clarifying limitations vs. malicious patterns. |
Member
Author
|
I'm intentionally ignoring the markdownlint violations since I don't believe I changed the newlines in the file. (The original file started with a stray newline, and it didn't end with a newline.) If the reviewers want these addressed, just say the word! |
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.
I'm updating regex docs across the various docs repos. This is one part of that update.
Changes:
Related PRs:
Internal previews