File tree Expand file tree Collapse file tree 5 files changed +27
-0
lines changed
java/ql/lib/semmle/code/java/security Expand file tree Collapse file tree 5 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,11 @@ private class DefaultIntentRedirectionSink extends IntentRedirectionSink {
3535 DefaultIntentRedirectionSink ( ) { sinkNode ( this , "intent-redirection" ) }
3636}
3737
38+ /** External sanitizers for Intent redirection vulnerabilities. */
39+ private class ExternalIntentRedirectionSanitizer extends IntentRedirectionSanitizer {
40+ ExternalIntentRedirectionSanitizer ( ) { barrierNode ( this , "intent-redirection" ) }
41+ }
42+
3843/**
3944 * A default sanitizer for `Intent` nodes dominated by calls to `ComponentName.getPackageName`
4045 * and `ComponentName.getClassName`. These are used to check whether the origin or destination
Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ private class DefaultCommandInjectionSink extends CommandInjectionSink {
3737 DefaultCommandInjectionSink ( ) { sinkNode ( this , "command-injection" ) }
3838}
3939
40+ private class ExternalCommandInjectionSanitizer extends CommandInjectionSanitizer {
41+ ExternalCommandInjectionSanitizer ( ) { barrierNode ( this , "command-injection" ) }
42+ }
43+
4044private class DefaultCommandInjectionSanitizer extends CommandInjectionSanitizer {
4145 DefaultCommandInjectionSanitizer ( ) {
4246 this instanceof SimpleTypeSanitizer
Original file line number Diff line number Diff line change @@ -49,6 +49,15 @@ private class DefaultFragmentInjectionSink extends FragmentInjectionSink {
4949 DefaultFragmentInjectionSink ( ) { sinkNode ( this , "fragment-injection" ) }
5050}
5151
52+ /**
53+ * A barrier for Fragment injection vulnerabilities.
54+ */
55+ abstract class FragmentInjectionSanitizer extends DataFlow:: Node { }
56+
57+ private class ExternalFragmentInjectionSanitizer extends FragmentInjectionSanitizer {
58+ ExternalFragmentInjectionSanitizer ( ) { barrierNode ( this , "fragment-injection" ) }
59+ }
60+
5261private class DefaultFragmentInjectionAdditionalTaintStep extends FragmentInjectionAdditionalTaintStep
5362{
5463 override predicate step ( DataFlow:: Node n1 , DataFlow:: Node n2 ) {
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ module FragmentInjectionTaintConfig implements DataFlow::ConfigSig {
1414
1515 predicate isSink ( DataFlow:: Node sink ) { sink instanceof FragmentInjectionSink }
1616
17+ predicate isBarrier ( DataFlow:: Node node ) { node instanceof FragmentInjectionSanitizer }
18+
1719 predicate isAdditionalFlowStep ( DataFlow:: Node n1 , DataFlow:: Node n2 ) {
1820 any ( FragmentInjectionAdditionalTaintStep c ) .step ( n1 , n2 )
1921 }
Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ private class DefaultGroovyInjectionSink extends GroovyInjectionSink {
2626 DefaultGroovyInjectionSink ( ) { sinkNode ( this , "groovy-injection" ) }
2727}
2828
29+ /** A data flow sanitizer for Groovy expression injection vulnerabilities. */
30+ abstract class GroovyInjectionSanitizer extends DataFlow:: ExprNode { }
31+
32+ private class ExternalGroovyInjectionSanitizer extends GroovyInjectionSanitizer {
33+ ExternalGroovyInjectionSanitizer ( ) { barrierNode ( this , "groovy-injection" ) }
34+ }
35+
2936/** A set of additional taint steps to consider when taint tracking Groovy related data flows. */
3037private class DefaultGroovyInjectionAdditionalTaintStep extends GroovyInjectionAdditionalTaintStep {
3138 override predicate step ( DataFlow:: Node node1 , DataFlow:: Node node2 ) {
You can’t perform that action at this time.
0 commit comments