File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
javascript/ql/examples/queries/dataflow/StoredXss Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -15,18 +15,18 @@ import DataFlow::PathGraph
1515/**
1616 * An instance of `mysql.createConnection()`, tracked globally.
1717 */
18- class MysqlConnection extends TrackedNode {
19- MysqlConnection ( ) { this = moduleImport ( "mysql" ) .getAMemberCall ( "createConnection" ) }
20-
21- /**
22- * Gets a call to the `query` method on this connection object.
23- */
24- MethodCallNode getAQueryCall ( ) {
25- this .flowsTo ( result .getReceiver ( ) ) and
26- result .getMethodName ( ) = "query"
27- }
18+ DataFlow:: SourceNode mysqlConnection ( DataFlow:: TypeTracker t ) {
19+ t .start ( ) and
20+ result = moduleImport ( "mysql" ) .getAMemberCall ( "createConnection" )
21+ or
22+ exists ( DataFlow:: TypeTracker t2 | result = mysqlConnection ( t2 ) .track ( t2 , t ) )
2823}
2924
25+ /**
26+ * An instance of `mysql.createConnection()`, tracked globally.
27+ */
28+ DataFlow:: SourceNode mysqlConnection ( ) { result = mysqlConnection ( DataFlow:: TypeTracker:: end ( ) ) }
29+
3030/**
3131 * Data returned from a MySQL query.
3232 *
@@ -42,7 +42,7 @@ class MysqlConnection extends TrackedNode {
4242 * ```
4343 */
4444class MysqlSource extends StoredXss:: Source {
45- MysqlSource ( ) { this = any ( MysqlConnection con ) . getAQueryCall ( ) .getCallback ( 1 ) .getParameter ( 1 ) }
45+ MysqlSource ( ) { this = mysqlConnection ( ) . getAMethodCall ( "query" ) .getCallback ( 1 ) .getParameter ( 1 ) }
4646}
4747
4848from StoredXss:: Configuration cfg , PathNode source , PathNode sink
You can’t perform that action at this time.
0 commit comments