Conversation
XmlDocumentBuilder.xmlDocBuilder()'s own inline comments document the safe value for each of its 6 feature flags (disallow_doctype_decl safe=true; the rest safe=false), but the call in readXml() passed the unsafe value for every single one - doctype declarations, external general/parameter entities, external DTD loading, XInclude, and entity expansion were all left fully enabled, allowing classic XXE-based external file disclosure via a crafted DOCTYPE/entity in the submitted XML body. Switched to the documented safe values for all 6 parameters. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
🏆 Security Shepherd — CTF Patch Score0 / 40 challenges patched
Commit: No points yet — this commit didn't solve any challenges, so there's nothing on the leaderboard for it. Patch a vulnerability and push again! 💪 |
XxeChallenge1OldWebService's identical vulnerable xmlDocBuilder() call was already fixed, but the XXE lesson page (servlets/module/lesson/XxeLesson.java) has the exact same unsafe call and was never touched - same classic XXE file-disclosure exposure via a crafted DOCTYPE/entity in the submitted XML, just reachable through the lesson endpoint instead of the challenge one. Switched to the documented safe values for all 6 parameters, matching the fix already applied to XxeChallenge1OldWebService.
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
XmlDocumentBuilder.xmlDocBuilder()'s own inline comments document the safe value for each of its 6 feature flags, but the call inreadXml()passed the unsafe value for every single one - doctype declarations, external general/parameter entities, external DTD loading, XInclude, and entity expansion were all left fully enabled, allowing classic XXE-based external file disclosure.Fix
Switched to the documented safe values for all 6 parameters.
Test plan
mvn compile,mvn spotless:checkclean, full test suite passes/etc/passwdnow fails to parse instead of resolving the file.🤖 Generated with Claude Code