-
Notifications
You must be signed in to change notification settings - Fork 169
chore: improve XXE attack prevention #2008
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
Conversation
core/src/main/java/ai/timefold/solver/core/impl/io/jaxb/GenericJaxbIO.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request enhances XXE (XML External Entity) attack prevention in the codebase by improving the security configuration of XML parsing components. The changes were triggered by a security report from Aikido.
Key changes:
- Extracted and centralized secure factory creation methods for XML processing components
- Strengthened DocumentBuilderFactory configuration to disallow DOCTYPE declarations entirely
- Consolidated security configurations for TransformerFactory, SchemaFactory, and Validator
- Modernized code with String.formatted(), var declarations, and record types
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
core/src/main/java/ai/timefold/solver/core/impl/io/jaxb/GenericJaxbIO.java |
Added secure factory methods with XXE protections, refactored existing code to use them, modernized syntax |
core/src/test/java/ai/timefold/solver/core/impl/io/jaxb/GenericJaxbIOTest.java |
Updated test assertion to match new DOCTYPE disallowance error message |
benchmark/src/main/java/ai/timefold/solver/benchmark/impl/xsd/XsdAggregator.java |
Updated to use new secure factory methods from GenericJaxbIO, modernized syntax |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
core/src/main/java/ai/timefold/solver/core/impl/io/jaxb/GenericJaxbIO.java
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/impl/io/jaxb/GenericJaxbIO.java
Show resolved
Hide resolved
core/src/main/java/ai/timefold/solver/core/impl/io/jaxb/GenericJaxbIO.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
core/src/main/java/ai/timefold/solver/core/impl/io/jaxb/GenericJaxbIO.java
Outdated
Show resolved
Hide resolved
zepfred
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Reported by Aikido earlier today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
benchmark/src/test/java/ai/timefold/solver/benchmark/config/PlannerBenchmarkConfigTest.java
Show resolved
Hide resolved
|


Reported by Aikido earlier today.