GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — codeql-lab/codeql-sqlite-java/full-query.ql at qllab · hohn/codeql-lab Expand file tree/ Copy pathfull-query.qlMore file actions 53 lines (45 loc) · 1.54 KB / Copy pathfull-query.qlFile metadata and controls53 lines (45 loc) · 1.54 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 /** * @name SQLI Vulnerability * @description Using untrusted strings in a sql query allows sql injection attacks. * @kind path-problem * @id cpp/SQLIVulnerable * @problem.severity warning */ import java import semmle.code.java.dataflow.TaintTracking import semmle.code.java.dataflow.DataFlow /** * A global data-flow configuration using modules */ // Note result differences between module InputToSQL = TaintTracking::Global<SqliFlowConfig>; // and // module InputToSQL = DataFlow::Global<SqliFlowConfig>; module SqliFlowConfig implements DataFlow::ConfigSig { predicate isSource(DataFlow::Node source) { // System.console().readLine(); exists(Call read | read.getCallee().getName() = "readLine" and read = source.asExpr() ) } predicate isSink(DataFlow::Node sink) { // conn.createStatement().executeUpdate(query); exists(Call exec | exec.getCallee().getName() = "executeUpdate" and exec.getArgument(0) = sink.asExpr() ) } // predicate isSanitizer(DataFlow::Node sanitizer) { none() } // predicate isAdditionalTaintStep(DataFlow::Node into, DataFlow::Node out) { // // Extra taint step // // String.format("INSERT INTO users VALUES (%d, '%s')", id, info); // // Not needed here, but may be needed for larger libraries. // none() // } } // To construct the paths between sources and sinks. import InputToSQL::PathGraph from InputToSQL::PathNode source, InputToSQL::PathNode sink where InputToSQL::flowPath(source, sink) select sink, source, sink, "Possible SQL injection" |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |