Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space CBJS and version Publish

...

Ql
import javascript
import DataFlow
import semmle.javascript.security.dataflow.StoredXss
import DataFlow::PathGraph

/**
 * Data returned from a MySQL query, such as the `data` parameter in this example:
 * ```
 * let mysql = require('mysql');
 * let connection = mysql.createConnection();
 *
 * connection.query(..., (e, data) => { ... });
 * ```
 */
class MysqlSource extends StoredXss::Source {
  MysqlSource() {
    this =
      moduleImport("mysql")
          .getAMemberCall("createConnection")
          .getAMethodCall("query")
          .getCallback(1)
          .getParameter(1)
  }
}

from StoredXss::Configuration cfg, PathNode source, PathNode sink
where cfg.hasFlowPath(source, sink)
select sink.getNode(), source, sink, "Stored XSS from $@.", source.getNode(), "database value."
Htmlcomment
hiddentrue
hashconfluence_uploader_hash:62c6d3ef2c8fa478b47c2d564f827830ba18fa451277ff5f08d137e0f0a02f86f3865c574447e11b