Repository navigation
fix: backport Java/PHP doc-comment security fix to 1.29.x - #8355
Merged
Merged
Conversation
…them (#8017) The Java and PHP doc-comment sanitizers deleted the `*/` terminator via Replace(*/, empty). Deleting a two-character sequence lets the surrounding characters re-form it (e.g. **// collapses to */), allowing a hostile schema description to break out of a generated doc comment and inject code into the generated client. The Java sanitizer additionally ran the delimiter strip before the non-ASCII strip, so *e/ (with a non-ASCII char between) re-formed */ after the non-ASCII char was removed. Replace delimiters instead of deleting (/* -> //*, */ -> * /) via a new shared NeutralizeBlockCommentDelimiters helper, matching TypeScriptConventionService, and run the Java neutralization after the non-ASCII strip. Adds regression tests. Co-authored-by: Copilot App <[email protected]> Co-authored-by: Copilot <[email protected]> Copilot-Session: 46cae41e-552d-41ca-ae7e-93e248779da5
Co-authored-by: Copilot <[email protected]> Copilot-Session: 46cae41e-552d-41ca-ae7e-93e248779da5
Co-authored-by: Copilot <[email protected]> Copilot-Session: 46cae41e-552d-41ca-ae7e-93e248779da5
Contributor
|
Thanks for opening this pull request! Please link it to an issue by adding the fixes syntax to the pull request description, for example: |
Contributor
|
Thanks for opening this pull request! Please add a changelog entry under |
Peter Ombwa (peombwa)
approved these changes
Oct 7, 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.
Summary
No NuGet or npm dependency versions are upgraded. Microsoft.OpenApi remains at 2.12.0, and the existing .NET 8/9 targets, solution format, and Azure DevOps pipeline are retained.
Fixes #8352.
Validation