-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Java: allow MaD barriers #21055
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
Java: allow MaD barriers #21055
Conversation
java/ql/lib/semmle/code/java/security/AndroidSensitiveCommunicationQuery.qll
Fixed
Show fixed
Hide fixed
java/ql/lib/semmle/code/java/security/ExternallyControlledFormatStringQuery.qll
Fixed
Show fixed
Hide fixed
f928943 to
766e908
Compare
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 users to add query-specific sanitizers using data extensions (MaD) by renaming existing sanitizer classes from "Default" to "External" and adding missing abstract sanitizer classes where needed.
Key changes:
- Rename five existing
Default*Sanitizerclasses toExternal*Sanitizerto better reflect their purpose as externally-defined MaD barriers - Add three new abstract sanitizer classes (
GroovyInjectionSanitizer,FragmentInjectionSanitizer) with corresponding external implementations - Add
isBarrierpredicate toFragmentInjectionTaintConfigto properly integrate the new sanitizer class
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| RegexInjection.qll | Rename DefaultRegexInjectionSanitizer to ExternalRegexInjectionSanitizer |
| XSS.qll | Rename DefaultXssSanitizer to ExternalXssSanitizer |
| TrustBoundaryViolationQuery.qll | Rename DefaultTrustBoundaryValidationSanitizer to ExternalTrustBoundaryValidationSanitizer |
| RequestForgery.qll | Rename DefaultRequestForgerySanitizer to ExternalRequestForgerySanitizer |
| PathSanitizer.qll | Rename DefaultPathInjectionSanitizer to ExternalPathInjectionSanitizer |
| GroovyInjection.qll | Add abstract GroovyInjectionSanitizer class and ExternalGroovyInjectionSanitizer implementation |
| FragmentInjectionQuery.qll | Add isBarrier predicate to properly use the new sanitizer class |
| FragmentInjection.qll | Add abstract FragmentInjectionSanitizer class and ExternalFragmentInjectionSanitizer implementation |
| CommandLineQuery.qll | Add ExternalCommandInjectionSanitizer class (abstract class already existed) |
| AndroidIntentRedirection.qll | Add ExternalIntentRedirectionSanitizer class (abstract class already existed) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
java/ql/lib/semmle/code/java/security/AndroidIntentRedirection.qll
Outdated
Show resolved
Hide resolved
aschackmull
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
This PR adds classes so users can add query-specific sanitizers using data extensions ("models-as-data", or MaD), using the same
kindstrings as already used by sinks. This follows on from the PR where existing sanitizers were converted to MaD.