Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BRMO-384] Fix Resolving XML external entity in user-controlled data #2310

Merged
merged 7 commits into from
Nov 19, 2024

Conversation

mprins
Copy link
Member

@mprins mprins commented Nov 18, 2024

Fixes:

To fix the problem, we need to configure the DocumentBuilderFactory to disable the parsing of external entities and DTDs. This can be done by setting specific features on the DocumentBuilderFactory instance. The changes should be made in the WozXMLReader class where the DocumentBuilderFactory is instantiated.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

@mprins mprins changed the title Fix code scanning alert no. 1431: Resolving XML external entity in user-controlled data [BRMO-384] Fix Resolving XML external entity in user-controlled data Nov 18, 2024
@mprins mprins self-assigned this Nov 18, 2024
mprins and others added 6 commits November 19, 2024 11:14
…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>
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 68.42105% with 6 lines in your changes missing coverage. Please review.

Project coverage is 38%. Comparing base (ada4313) to head (248e70f).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...main/java/nl/b3p/brmo/loader/xml/BRPXMLReader.java 0% 3 Missing ⚠️
...a/nl/b3p/brmo/loader/xml/BrkSnapshotXMLReader.java 0% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           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     
Files with missing lines Coverage Δ
.../nl/b3p/brmo/loader/xml/Brk2SnapshotXMLReader.java 94% <100%> (+1%) ⬆️
...ain/java/nl/b3p/brmo/loader/xml/GbavXMLReader.java 89% <100%> (+1%) ⬆️
...main/java/nl/b3p/brmo/loader/xml/NhrXMLReader.java 95% <100%> (+1%) ⬆️
...main/java/nl/b3p/brmo/loader/xml/WozXMLReader.java 79% <100%> (+1%) ⬆️
...main/java/nl/b3p/brmo/loader/xml/BRPXMLReader.java 0% <0%> (ø)
...a/nl/b3p/brmo/loader/xml/BrkSnapshotXMLReader.java 0% <0%> (ø)

... and 1 file with indirect coverage changes

---- 🚨 Try these New Features:

@mprins mprins marked this pull request as ready for review November 19, 2024 13:47
@mprins mprins added the bug label Nov 19, 2024
@mprins mprins merged commit de43aed into master Nov 19, 2024
30 checks passed
@mprins mprins deleted the BRMO-384 branch November 19, 2024 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant