File tree Expand file tree Collapse file tree 2 files changed +27
-18
lines changed
lib/semmle/code/java/security Expand file tree Collapse file tree 2 files changed +27
-18
lines changed Original file line number Diff line number Diff line change 1+ /** Provides a taint-tracking configuration to reason about externally controlled format string vulnerabilities. */
2+
3+ import java
4+ import semmle.code.java.dataflow.FlowSources
5+ import semmle.code.java.StringFormat
6+
7+ /**
8+ * A taint-tracking configuration for externally controlled format string vulnerabilities.
9+ */
10+ module ExternallyControlledFormatStringConfig implements DataFlow:: ConfigSig {
11+ predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
12+
13+ predicate isSink ( DataFlow:: Node sink ) {
14+ sink .asExpr ( ) = any ( StringFormat formatCall ) .getFormatArgument ( )
15+ }
16+
17+ predicate isBarrier ( DataFlow:: Node node ) {
18+ node .getType ( ) instanceof NumericType or node .getType ( ) instanceof BooleanType
19+ }
20+ }
21+
22+ /**
23+ * Taint-tracking flow for externally controlled format string vulnerabilities.
24+ */
25+ module ExternallyControlledFormatStringFlow =
26+ TaintTracking:: Global< ExternallyControlledFormatStringConfig > ;
Original file line number Diff line number Diff line change 1111 */
1212
1313import java
14- import semmle.code.java.dataflow.FlowSources
15- import semmle.code.java.StringFormat
16-
17- module ExternallyControlledFormatStringConfig implements DataFlow:: ConfigSig {
18- predicate isSource ( DataFlow:: Node source ) { source instanceof RemoteFlowSource }
19-
20- predicate isSink ( DataFlow:: Node sink ) {
21- sink .asExpr ( ) = any ( StringFormat formatCall ) .getFormatArgument ( )
22- }
23-
24- predicate isBarrier ( DataFlow:: Node node ) {
25- node .getType ( ) instanceof NumericType or node .getType ( ) instanceof BooleanType
26- }
27- }
28-
29- module ExternallyControlledFormatStringFlow =
30- TaintTracking:: Global< ExternallyControlledFormatStringConfig > ;
31-
14+ import semmle.code.java.security.ExternallyControlledFormatStringQuery
3215import ExternallyControlledFormatStringFlow:: PathGraph
3316
3417from
You can’t perform that action at this time.
0 commit comments