-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Java: Enable BarrierGuard wrappers #20183
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
base: main
Are you sure you want to change the base?
Conversation
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 PR enables the Guards library wrapper guard integration with BarrierGuard in Java, allowing data flow sanitizers to leverage the full power of the Guards library including wrapped validation checks. This eliminates the need for ad-hoc support in individual barriers.
- Adds support for SSA definition-based guard checking in the Guards library
- Refactors BarrierGuard implementation to use wrapped validation checks with state
- Removes custom validation method logic from path sanitizers and arithmetic guards
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
shared/controlflow/codeql/controlflow/Guards.qll | Adds guardChecksDef predicate for SSA definition validation and removes deprecated boolean guard logic |
java/ql/lib/semmle/code/java/security/PathSanitizer.qll | Removes ValidationMethod module and simplifies sanitizer classes to use only BarrierGuard |
java/ql/lib/semmle/code/java/security/ArithmeticCommon.qll | Refactors size guard predicates to work with expressions and updates guard checking to use BarrierGuard |
java/ql/lib/semmle/code/java/dataflow/internal/SsaImpl.qll | Updates BarrierGuard implementation to use wrapped validation with SSA definitions |
java/ql/lib/semmle/code/java/controlflow/Guards.qll | Removes deprecated implies_v3 predicate |
Fixed the kotlin qltest in two ways (either of the two added commits suffice to fix the test). Firstly, kotlin Throws annotations are now recognized - we definitely want that, as that's similar to the java |
1acee9d
to
492a5ca
Compare
This enables the Guards library wrapper guard integration with BarrierGuard such that data flow sanitizers make use of the full power of the Guards library including wrapped validation checks.
Some individual barriers had ad-hoc support for this, which can now be deleted as it becomes superfluous.