Conversation
…er-controlled data Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…er-controlled data Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…er-controlled data Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…er-controlled data Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…er-controlled data Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…er-controlled data Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
| StreamSource source = new StreamSource(in); | ||
| // Prevent external entity resolution | ||
| source.setSystemId(""); | ||
| transformer.transform(source, r); |
Check failure
Code scanning / CodeQL
Resolving XML external entity in user-controlled data
Copilot Autofix
AI over 1 year ago
Copilot could not generate an autofix suggestion
Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2310 +/- ##
========================================
+ Coverage 38% 38% +1%
Complexity 806 806
========================================
Files 371 371
Lines 18863 18878 +15
Branches 1777 1777
========================================
+ Hits 7153 7162 +9
- Misses 11138 11143 +5
- Partials 572 573 +1
|
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.
Fixes:
To fix the problem, we need to configure the
DocumentBuilderFactoryto disable the parsing of external entities and DTDs. This can be done by setting specific features on theDocumentBuilderFactoryinstance. The changes should be made in theWozXMLReaderclass where theDocumentBuilderFactoryis instantiated.Suggested fixes powered by Copilot Autofix. Review carefully before merging.