mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Merge branch 'master' of github.com:github/codeql into OptionalSanitizer
This commit is contained in:
14
javascript/ql/src/external/CodeDuplication.qll
vendored
14
javascript/ql/src/external/CodeDuplication.qll
vendored
@@ -261,6 +261,11 @@ predicate similarContainers(StmtContainer sc, StmtContainer other, float percent
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: do not use.
|
||||
*
|
||||
* Holds if `line` in `f` is similar to a line somewhere else.
|
||||
*/
|
||||
predicate similarLines(File f, int line) {
|
||||
exists(SimilarBlock b | b.sourceFile() = f and line in [b.sourceStartLine() .. b.sourceEndLine()])
|
||||
}
|
||||
@@ -275,6 +280,7 @@ private predicate similarLinesPerEquivalenceClass(int equivClass, int lines, Fil
|
||||
)
|
||||
}
|
||||
|
||||
/** Holds if `coveredLines` lines of `f` are similar to lines in `otherFile`. */
|
||||
pragma[noopt]
|
||||
private predicate similarLinesCovered(File f, int coveredLines, File otherFile) {
|
||||
exists(int numLines | numLines = f.getNumberOfLines() |
|
||||
@@ -296,6 +302,11 @@ private predicate similarLinesCovered(File f, int coveredLines, File otherFile)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: do not use.
|
||||
*
|
||||
* Holds if `line` in `f` is duplicated by a line somewhere else.
|
||||
*/
|
||||
predicate duplicateLines(File f, int line) {
|
||||
exists(DuplicateBlock b |
|
||||
b.sourceFile() = f and line in [b.sourceStartLine() .. b.sourceEndLine()]
|
||||
@@ -312,6 +323,7 @@ private predicate duplicateLinesPerEquivalenceClass(int equivClass, int lines, F
|
||||
)
|
||||
}
|
||||
|
||||
/** Holds if `coveredLines` lines of `f` are duplicates of lines in `otherFile`. */
|
||||
pragma[noopt]
|
||||
private predicate duplicateLinesCovered(File f, int coveredLines, File otherFile) {
|
||||
exists(int numLines | numLines = f.getNumberOfLines() |
|
||||
@@ -333,6 +345,7 @@ private predicate duplicateLinesCovered(File f, int coveredLines, File otherFile
|
||||
)
|
||||
}
|
||||
|
||||
/** Holds if most of `f` (`percent`%) is similar to `other`. */
|
||||
predicate similarFiles(File f, File other, int percent) {
|
||||
exists(int covered, int total |
|
||||
similarLinesCovered(f, covered, other) and
|
||||
@@ -343,6 +356,7 @@ predicate similarFiles(File f, File other, int percent) {
|
||||
not duplicateFiles(f, other, _)
|
||||
}
|
||||
|
||||
/** Holds if most of `f` (`percent`%) is duplicated by `other`. */
|
||||
predicate duplicateFiles(File f, File other, int percent) {
|
||||
exists(int covered, int total |
|
||||
duplicateLinesCovered(f, covered, other) and
|
||||
|
||||
@@ -152,6 +152,18 @@ private class RequireVariable extends Variable {
|
||||
*/
|
||||
private predicate moduleInFile(Module m, File f) { m.getFile() = f }
|
||||
|
||||
/**
|
||||
* Holds if `nd` may refer to `require`, either directly or modulo local data flow.
|
||||
*/
|
||||
cached
|
||||
private predicate isRequire(DataFlow::Node nd) {
|
||||
nd.asExpr() = any(RequireVariable req).getAnAccess() and
|
||||
// `mjs` files explicitly disallow `require`
|
||||
not nd.getFile().getExtension() = "mjs"
|
||||
or
|
||||
isRequire(nd.getAPredecessor())
|
||||
}
|
||||
|
||||
/**
|
||||
* A `require` import.
|
||||
*
|
||||
@@ -162,12 +174,7 @@ private predicate moduleInFile(Module m, File f) { m.getFile() = f }
|
||||
* ```
|
||||
*/
|
||||
class Require extends CallExpr, Import {
|
||||
cached
|
||||
Require() {
|
||||
any(RequireVariable req).getAnAccess() = getCallee() and
|
||||
// `mjs` files explicitly disallow `require`
|
||||
not getFile().getExtension() = "mjs"
|
||||
}
|
||||
Require() { isRequire(getCallee().flow()) }
|
||||
|
||||
override PathExpr getImportedPath() { result = getArgument(0) }
|
||||
|
||||
@@ -257,8 +264,8 @@ private class RequirePath extends PathExprCandidate {
|
||||
RequirePath() {
|
||||
this = any(Require req).getArgument(0)
|
||||
or
|
||||
exists(RequireVariable req, MethodCallExpr reqres |
|
||||
reqres.getReceiver() = req.getAnAccess() and
|
||||
exists(MethodCallExpr reqres |
|
||||
isRequire(reqres.getReceiver().flow()) and
|
||||
reqres.getMethodName() = "resolve" and
|
||||
this = reqres.getArgument(0)
|
||||
)
|
||||
|
||||
@@ -116,7 +116,7 @@ class XMLFile extends XMLParent, File {
|
||||
XMLFile() { xmlEncoding(this, _) }
|
||||
|
||||
/** Gets a printable representation of this XML file. */
|
||||
override string toString() { result = XMLParent.super.toString() }
|
||||
override string toString() { result = getName() }
|
||||
|
||||
/** Gets the name of this XML file. */
|
||||
override string getName() { result = File.super.getAbsolutePath() }
|
||||
@@ -236,7 +236,7 @@ class XMLElement extends @xmlelement, XMLParent, XMLLocatable {
|
||||
string getAttributeValue(string name) { result = this.getAttribute(name).getValue() }
|
||||
|
||||
/** Gets a printable representation of this XML element. */
|
||||
override string toString() { result = XMLParent.super.toString() }
|
||||
override string toString() { result = getName() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -151,11 +151,14 @@ private module CachedSteps {
|
||||
) {
|
||||
calls(invk, f) and
|
||||
(
|
||||
exists(int i, Parameter p |
|
||||
f.getParameter(i) = p and
|
||||
not p.isRestParameter() and
|
||||
arg = invk.getArgument(i) and
|
||||
parm = DataFlow::parameterNode(p)
|
||||
exists(int i | arg = invk.getArgument(i) |
|
||||
exists(Parameter p |
|
||||
f.getParameter(i) = p and
|
||||
not p.isRestParameter() and
|
||||
parm = DataFlow::parameterNode(p)
|
||||
)
|
||||
or
|
||||
parm = reflectiveParameterAccess(f, i)
|
||||
)
|
||||
or
|
||||
arg = invk.(DataFlow::CallNode).getReceiver() and
|
||||
@@ -185,6 +188,22 @@ private module CachedSteps {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a data-flow node inside `f` that refers to the `arguments` object of `f`.
|
||||
*/
|
||||
private DataFlow::Node argumentsAccess(Function f) {
|
||||
result.getContainer().getEnclosingContainer*() = f and
|
||||
result.analyze().getAValue().(AbstractArguments).getFunction() = f
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a data-flow node that refers to the `i`th parameter of `f` through its `arguments`
|
||||
* object.
|
||||
*/
|
||||
private DataFlow::SourceNode reflectiveParameterAccess(Function f, int i) {
|
||||
result.(DataFlow::PropRead).accesses(argumentsAccess(f), any(string p | i = p.toInt()))
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if there is a flow step from `pred` to `succ` through parameter passing
|
||||
* to a function call.
|
||||
|
||||
291
javascript/ql/src/semmle/javascript/frameworks/Fastify.qll
Normal file
291
javascript/ql/src/semmle/javascript/frameworks/Fastify.qll
Normal file
@@ -0,0 +1,291 @@
|
||||
/**
|
||||
* Provides classes for working with [Fastify](https://www.fastify.io/) applications.
|
||||
*/
|
||||
|
||||
import javascript
|
||||
import semmle.javascript.frameworks.HTTP
|
||||
|
||||
/**
|
||||
* Provides classes for working with [Fastify](https://www.fastify.io/) applications.
|
||||
*/
|
||||
module Fastify {
|
||||
/**
|
||||
* An expression that creates a new Fastify server.
|
||||
*/
|
||||
abstract class ServerDefinition extends HTTP::Servers::StandardServerDefinition { }
|
||||
|
||||
/**
|
||||
* A standard way to create a Fastify server.
|
||||
*/
|
||||
class StandardServerDefinition extends ServerDefinition {
|
||||
StandardServerDefinition() {
|
||||
this = DataFlow::moduleImport("fastify").getAnInvocation().asExpr()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A function used as a Fastify route handler.
|
||||
*
|
||||
* By default, only handlers installed by a Fastify route setup are recognized,
|
||||
* but support for other kinds of route handlers can be added by implementing
|
||||
* additional subclasses of this class.
|
||||
*/
|
||||
abstract class RouteHandler extends HTTP::Servers::StandardRouteHandler, DataFlow::ValueNode {
|
||||
/**
|
||||
* Gets the parameter of the route handler that contains the request object.
|
||||
*/
|
||||
abstract DataFlow::ParameterNode getRequestParameter();
|
||||
|
||||
/**
|
||||
* Gets the parameter of the route handler that contains the reply object.
|
||||
*/
|
||||
abstract DataFlow::ParameterNode getReplyParameter();
|
||||
}
|
||||
|
||||
/**
|
||||
* A Fastify route handler installed by a route setup.
|
||||
*/
|
||||
class StandardRouteHandler extends RouteHandler, DataFlow::FunctionNode {
|
||||
StandardRouteHandler() { this = any(RouteSetup setup).getARouteHandler() }
|
||||
|
||||
override DataFlow::ParameterNode getRequestParameter() { result = this.getParameter(0) }
|
||||
|
||||
override DataFlow::ParameterNode getReplyParameter() { result = this.getParameter(1) }
|
||||
}
|
||||
|
||||
/**
|
||||
* A Fastify reply source, that is, the `reply` parameter of a
|
||||
* route handler.
|
||||
*/
|
||||
private class ReplySource extends HTTP::Servers::ResponseSource {
|
||||
RouteHandler rh;
|
||||
|
||||
ReplySource() { this = rh.getReplyParameter() }
|
||||
|
||||
/**
|
||||
* Gets the route handler that provides this response.
|
||||
*/
|
||||
override RouteHandler getRouteHandler() { result = rh }
|
||||
}
|
||||
|
||||
/**
|
||||
* A Fastify request source, that is, the request parameter of a
|
||||
* route handler.
|
||||
*/
|
||||
private class RequestSource extends HTTP::Servers::RequestSource {
|
||||
RouteHandler rh;
|
||||
|
||||
RequestSource() { this = rh.getRequestParameter() }
|
||||
|
||||
/**
|
||||
* Gets the route handler that handles this request.
|
||||
*/
|
||||
override RouteHandler getRouteHandler() { result = rh }
|
||||
}
|
||||
|
||||
/**
|
||||
* A call to a Fastify method that sets up a route.
|
||||
*/
|
||||
class RouteSetup extends MethodCallExpr, HTTP::Servers::StandardRouteSetup {
|
||||
ServerDefinition server;
|
||||
string methodName;
|
||||
|
||||
RouteSetup() {
|
||||
this.getMethodName() = methodName and
|
||||
methodName = ["route", "get", "head", "post", "put", "delete", "options", "patch"] and
|
||||
server.flowsTo(this.getReceiver())
|
||||
}
|
||||
|
||||
override DataFlow::SourceNode getARouteHandler() {
|
||||
result = getARouteHandler(DataFlow::TypeBackTracker::end())
|
||||
}
|
||||
|
||||
private DataFlow::SourceNode getARouteHandler(DataFlow::TypeBackTracker t) {
|
||||
t.start() and
|
||||
result = this.getARouteHandlerExpr().getALocalSource()
|
||||
or
|
||||
exists(DataFlow::TypeBackTracker t2 | result = this.getARouteHandler(t2).backtrack(t2, t))
|
||||
}
|
||||
|
||||
override Expr getServer() { result = server }
|
||||
|
||||
/** Gets an argument that represents a route handler being registered. */
|
||||
private DataFlow::Node getARouteHandlerExpr() {
|
||||
if methodName = "route"
|
||||
then
|
||||
result =
|
||||
this
|
||||
.flow()
|
||||
.(DataFlow::MethodCallNode)
|
||||
.getOptionArgument(0,
|
||||
["onRequest", "preParsing", "preValidation", "preHandler", "preSerialization",
|
||||
"onSend", "onResponse", "handler"])
|
||||
else result = getLastArgument().flow()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An access to a user-controlled Fastify request input.
|
||||
*/
|
||||
private class RequestInputAccess extends HTTP::RequestInputAccess {
|
||||
RouteHandler rh;
|
||||
string kind;
|
||||
|
||||
RequestInputAccess() {
|
||||
exists(string name | this = rh.getARequestSource().ref().getAPropertyRead(name) |
|
||||
kind = "parameter" and
|
||||
name = ["params", "query"]
|
||||
or
|
||||
kind = "body" and
|
||||
name = "body"
|
||||
)
|
||||
}
|
||||
|
||||
override RouteHandler getRouteHandler() { result = rh }
|
||||
|
||||
override string getKind() { result = kind }
|
||||
|
||||
override predicate isUserControlledObject() {
|
||||
kind = "body" and
|
||||
(
|
||||
usesFastifyPlugin(rh,
|
||||
DataFlow::moduleImport(["fastify-xml-body-parser", "fastify-formbody"]))
|
||||
or
|
||||
usesMiddleware(rh,
|
||||
any(ExpressLibraries::BodyParser bodyParser | bodyParser.producesUserControlledObjects()))
|
||||
)
|
||||
or
|
||||
kind = "parameter" and
|
||||
usesFastifyPlugin(rh, DataFlow::moduleImport("fastify-qs"))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `rh` uses `plugin`.
|
||||
*/
|
||||
private predicate usesFastifyPlugin(RouteHandler rh, DataFlow::SourceNode plugin) {
|
||||
exists(RouteSetup setup |
|
||||
plugin
|
||||
.flowsTo(setup
|
||||
.getServer()
|
||||
.flow()
|
||||
.(DataFlow::SourceNode)
|
||||
.getAMethodCall("register")
|
||||
.getArgument(0)) and // only matches the plugins that apply to all routes
|
||||
rh = setup.getARouteHandler()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `rh` uses `plugin`.
|
||||
*/
|
||||
private predicate usesMiddleware(RouteHandler rh, DataFlow::SourceNode middleware) {
|
||||
exists(RouteSetup setup |
|
||||
middleware
|
||||
.flowsTo(setup
|
||||
.getServer()
|
||||
.flow()
|
||||
.(DataFlow::SourceNode)
|
||||
.getAMethodCall("use")
|
||||
.getArgument(0)) and // only matches the middlewares that apply to all routes
|
||||
rh = setup.getARouteHandler()
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* An access to a header on a Fastify request.
|
||||
*/
|
||||
private class RequestHeaderAccess extends HTTP::RequestHeaderAccess {
|
||||
RouteHandler rh;
|
||||
|
||||
RequestHeaderAccess() {
|
||||
this = rh.getARequestSource().ref().getAPropertyRead("headers").getAPropertyRead()
|
||||
}
|
||||
|
||||
override string getAHeaderName() {
|
||||
result = this.(DataFlow::PropRead).getPropertyName().toLowerCase()
|
||||
}
|
||||
|
||||
override RouteHandler getRouteHandler() { result = rh }
|
||||
|
||||
override string getKind() { result = "header" }
|
||||
}
|
||||
|
||||
/**
|
||||
* An argument passed to the `send` or `end` method of an HTTP response object.
|
||||
*/
|
||||
private class ResponseSendArgument extends HTTP::ResponseSendArgument {
|
||||
RouteHandler rh;
|
||||
|
||||
ResponseSendArgument() {
|
||||
this = rh.getAResponseSource().ref().getAMethodCall("send").getArgument(0).asExpr()
|
||||
or
|
||||
this = rh.(DataFlow::FunctionNode).getAReturn().asExpr()
|
||||
}
|
||||
|
||||
override RouteHandler getRouteHandler() { result = rh }
|
||||
}
|
||||
|
||||
/**
|
||||
* An invocation of the `redirect` method of an HTTP response object.
|
||||
*/
|
||||
private class RedirectInvocation extends HTTP::RedirectInvocation, MethodCallExpr {
|
||||
RouteHandler rh;
|
||||
|
||||
RedirectInvocation() {
|
||||
this = rh.getAResponseSource().ref().getAMethodCall("redirect").asExpr()
|
||||
}
|
||||
|
||||
override Expr getUrlArgument() { result = this.getLastArgument() }
|
||||
|
||||
override RouteHandler getRouteHandler() { result = rh }
|
||||
}
|
||||
|
||||
/**
|
||||
* An invocation that sets a single header of the HTTP response.
|
||||
*/
|
||||
private class SetOneHeader extends HTTP::Servers::StandardHeaderDefinition,
|
||||
DataFlow::MethodCallNode {
|
||||
RouteHandler rh;
|
||||
|
||||
SetOneHeader() {
|
||||
this = rh.getAResponseSource().ref().getAMethodCall("header") and
|
||||
this.getNumArgument() = 2
|
||||
}
|
||||
|
||||
override RouteHandler getRouteHandler() { result = rh }
|
||||
}
|
||||
|
||||
/**
|
||||
* An invocation that sets any number of headers of the HTTP response.
|
||||
*/
|
||||
class SetMultipleHeaders extends HTTP::ExplicitHeaderDefinition, DataFlow::MethodCallNode {
|
||||
RouteHandler rh;
|
||||
|
||||
SetMultipleHeaders() {
|
||||
this = rh.getAResponseSource().ref().getAMethodCall("headers") and
|
||||
this.getNumArgument() = 1
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a reference to the multiple headers object that is to be set.
|
||||
*/
|
||||
private DataFlow::SourceNode getAHeaderSource() { result.flowsTo(this.getArgument(0)) }
|
||||
|
||||
override predicate definesExplicitly(string headerName, Expr headerValue) {
|
||||
exists(string header |
|
||||
getAHeaderSource().hasPropertyWrite(header, headerValue.flow()) and
|
||||
headerName = header.toLowerCase()
|
||||
)
|
||||
}
|
||||
|
||||
override RouteHandler getRouteHandler() { result = rh }
|
||||
|
||||
override Expr getNameExpr() {
|
||||
exists(DataFlow::PropWrite write |
|
||||
this.getAHeaderSource().flowsTo(write.getBase()) and
|
||||
result = write.getPropertyNameExpr()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,3 +4,4 @@ import semmle.javascript.frameworks.Koa
|
||||
import semmle.javascript.frameworks.NodeJSLib
|
||||
import semmle.javascript.frameworks.Restify
|
||||
import semmle.javascript.frameworks.Connect
|
||||
import semmle.javascript.frameworks.Fastify
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
| arguments.js:11:5:11:14 | f(1, 2, 3) | arguments.js:11:7:11:7 | 1 | arguments.js:2:5:10:5 | functio ... ;\\n } | arguments.js:2:16:2:16 | x |
|
||||
| arguments.js:11:5:11:14 | f(1, 2, 3) | arguments.js:11:7:11:7 | 1 | arguments.js:2:5:10:5 | functio ... ;\\n } | arguments.js:4:28:4:39 | arguments[0] |
|
||||
| arguments.js:11:5:11:14 | f(1, 2, 3) | arguments.js:11:10:11:10 | 2 | arguments.js:2:5:10:5 | functio ... ;\\n } | arguments.js:5:25:5:36 | arguments[1] |
|
||||
| arguments.js:11:5:11:14 | f(1, 2, 3) | arguments.js:11:13:11:13 | 3 | arguments.js:2:5:10:5 | functio ... ;\\n } | arguments.js:7:24:7:30 | args[2] |
|
||||
| sources.js:3:1:5:6 | (functi ... \\n})(23) | sources.js:5:4:5:5 | 23 | sources.js:3:2:5:1 | functio ... x+19;\\n} | sources.js:3:11:3:11 | x |
|
||||
| tst.js:16:1:20:9 | (functi ... ("arg") | tst.js:20:4:20:8 | "arg" | tst.js:16:2:20:1 | functio ... n "";\\n} | tst.js:16:13:16:13 | a |
|
||||
| tst.js:35:1:35:7 | g(true) | tst.js:35:3:35:6 | true | tst.js:32:1:34:1 | functio ... ables\\n} | tst.js:32:12:32:12 | b |
|
||||
| tst.js:44:1:44:5 | o.m() | tst.js:44:1:44:1 | o | tst.js:39:4:41:3 | () {\\n this;\\n } | tst.js:39:4:39:3 | this |
|
||||
| tst.js:87:1:96:2 | (functi ... r: 0\\n}) | tst.js:92:4:96:1 | {\\n p: ... r: 0\\n} | tst.js:87:2:92:1 | functio ... + z;\\n} | tst.js:87:11:87:24 | { p: x, ...o } |
|
||||
| tst.js:98:1:103:17 | (functi ... 3, 0 ]) | tst.js:103:4:103:16 | [ 19, 23, 0 ] | tst.js:98:2:103:1 | functio ... + z;\\n} | tst.js:98:11:98:24 | [ x, ...rest ] |
|
||||
@@ -0,0 +1,6 @@
|
||||
import javascript
|
||||
import semmle.javascript.dataflow.internal.FlowSteps as FlowSteps
|
||||
|
||||
from DataFlow::Node invk, DataFlow::Node arg, Function f, DataFlow::SourceNode parm
|
||||
where FlowSteps::argumentPassing(invk, arg, f, parm)
|
||||
select invk, arg, f, parm
|
||||
12
javascript/ql/test/library-tests/DataFlow/arguments.js
Normal file
12
javascript/ql/test/library-tests/DataFlow/arguments.js
Normal file
@@ -0,0 +1,12 @@
|
||||
(function() {
|
||||
function f(x) {
|
||||
let firstArg = x;
|
||||
let alsoFirstArg = arguments[0];
|
||||
let secondArg = arguments[1];
|
||||
let args = arguments;
|
||||
let thirdArg = args[2];
|
||||
arguments = {};
|
||||
let notFirstArg = arguments[0];
|
||||
}
|
||||
f(1, 2, 3);
|
||||
})();
|
||||
@@ -1,3 +1,42 @@
|
||||
| arguments.js:1:1:12:2 | (functi ... 3);\\n}) | arguments.js:1:1:12:2 | (functi ... 3);\\n}) |
|
||||
| arguments.js:1:1:12:4 | (functi ... );\\n})() | arguments.js:1:1:12:4 | (functi ... );\\n})() |
|
||||
| arguments.js:1:2:12:1 | functio ... , 3);\\n} | arguments.js:1:2:12:1 | functio ... , 3);\\n} |
|
||||
| arguments.js:2:14:2:14 | f | arguments.js:2:14:2:14 | f |
|
||||
| arguments.js:2:16:2:16 | x | arguments.js:2:16:2:16 | x |
|
||||
| arguments.js:3:13:3:20 | firstArg | arguments.js:3:13:3:20 | firstArg |
|
||||
| arguments.js:3:13:3:24 | firstArg = x | arguments.js:3:13:3:24 | firstArg = x |
|
||||
| arguments.js:3:24:3:24 | x | arguments.js:3:24:3:24 | x |
|
||||
| arguments.js:4:13:4:24 | alsoFirstArg | arguments.js:4:13:4:24 | alsoFirstArg |
|
||||
| arguments.js:4:13:4:39 | alsoFir ... ents[0] | arguments.js:4:13:4:39 | alsoFir ... ents[0] |
|
||||
| arguments.js:4:28:4:36 | arguments | arguments.js:4:28:4:36 | arguments |
|
||||
| arguments.js:4:28:4:39 | arguments[0] | arguments.js:4:28:4:39 | arguments[0] |
|
||||
| arguments.js:4:38:4:38 | 0 | arguments.js:4:38:4:38 | 0 |
|
||||
| arguments.js:5:13:5:21 | secondArg | arguments.js:5:13:5:21 | secondArg |
|
||||
| arguments.js:5:13:5:36 | secondA ... ents[1] | arguments.js:5:13:5:36 | secondA ... ents[1] |
|
||||
| arguments.js:5:25:5:33 | arguments | arguments.js:5:25:5:33 | arguments |
|
||||
| arguments.js:5:25:5:36 | arguments[1] | arguments.js:5:25:5:36 | arguments[1] |
|
||||
| arguments.js:5:35:5:35 | 1 | arguments.js:5:35:5:35 | 1 |
|
||||
| arguments.js:6:13:6:16 | args | arguments.js:6:13:6:16 | args |
|
||||
| arguments.js:6:13:6:28 | args = arguments | arguments.js:6:13:6:28 | args = arguments |
|
||||
| arguments.js:6:20:6:28 | arguments | arguments.js:6:20:6:28 | arguments |
|
||||
| arguments.js:7:13:7:20 | thirdArg | arguments.js:7:13:7:20 | thirdArg |
|
||||
| arguments.js:7:13:7:30 | thirdArg = args[2] | arguments.js:7:13:7:30 | thirdArg = args[2] |
|
||||
| arguments.js:7:24:7:27 | args | arguments.js:7:24:7:27 | args |
|
||||
| arguments.js:7:24:7:30 | args[2] | arguments.js:7:24:7:30 | args[2] |
|
||||
| arguments.js:7:29:7:29 | 2 | arguments.js:7:29:7:29 | 2 |
|
||||
| arguments.js:8:9:8:17 | arguments | arguments.js:8:9:8:17 | arguments |
|
||||
| arguments.js:8:9:8:22 | arguments = {} | arguments.js:8:9:8:22 | arguments = {} |
|
||||
| arguments.js:8:21:8:22 | {} | arguments.js:8:21:8:22 | {} |
|
||||
| arguments.js:9:13:9:23 | notFirstArg | arguments.js:9:13:9:23 | notFirstArg |
|
||||
| arguments.js:9:13:9:38 | notFirs ... ents[0] | arguments.js:9:13:9:38 | notFirs ... ents[0] |
|
||||
| arguments.js:9:27:9:35 | arguments | arguments.js:9:27:9:35 | arguments |
|
||||
| arguments.js:9:27:9:38 | arguments[0] | arguments.js:9:27:9:38 | arguments[0] |
|
||||
| arguments.js:9:37:9:37 | 0 | arguments.js:9:37:9:37 | 0 |
|
||||
| arguments.js:11:5:11:5 | f | arguments.js:11:5:11:5 | f |
|
||||
| arguments.js:11:5:11:14 | f(1, 2, 3) | arguments.js:11:5:11:14 | f(1, 2, 3) |
|
||||
| arguments.js:11:7:11:7 | 1 | arguments.js:11:7:11:7 | 1 |
|
||||
| arguments.js:11:10:11:10 | 2 | arguments.js:11:10:11:10 | 2 |
|
||||
| arguments.js:11:13:11:13 | 3 | arguments.js:11:13:11:13 | 3 |
|
||||
| eval.js:1:10:1:10 | k | eval.js:1:10:1:10 | k |
|
||||
| eval.js:2:7:2:7 | x | eval.js:2:7:2:7 | x |
|
||||
| eval.js:2:7:2:12 | x = 42 | eval.js:2:7:2:12 | x = 42 |
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
| arguments.js:1:2:12:1 | functio ... , 3);\\n} | arguments.js:1:1:12:2 | (functi ... 3);\\n}) |
|
||||
| arguments.js:2:5:2:5 | arguments | arguments.js:4:28:4:36 | arguments |
|
||||
| arguments.js:2:5:2:5 | arguments | arguments.js:5:25:5:33 | arguments |
|
||||
| arguments.js:2:5:2:5 | arguments | arguments.js:6:20:6:28 | arguments |
|
||||
| arguments.js:2:5:10:5 | functio ... ;\\n } | arguments.js:2:14:2:14 | f |
|
||||
| arguments.js:2:14:2:14 | f | arguments.js:11:5:11:5 | f |
|
||||
| arguments.js:2:16:2:16 | x | arguments.js:2:16:2:16 | x |
|
||||
| arguments.js:2:16:2:16 | x | arguments.js:3:24:3:24 | x |
|
||||
| arguments.js:6:13:6:28 | args | arguments.js:7:24:7:27 | args |
|
||||
| arguments.js:6:20:6:28 | arguments | arguments.js:6:13:6:28 | args |
|
||||
| arguments.js:8:9:8:22 | arguments | arguments.js:9:27:9:35 | arguments |
|
||||
| arguments.js:8:21:8:22 | {} | arguments.js:8:9:8:22 | arguments |
|
||||
| arguments.js:8:21:8:22 | {} | arguments.js:8:9:8:22 | arguments = {} |
|
||||
| eval.js:2:7:2:12 | x | eval.js:4:3:4:3 | x |
|
||||
| eval.js:2:11:2:12 | 42 | eval.js:2:7:2:12 | x |
|
||||
| sources.js:1:6:1:6 | x | sources.js:1:6:1:6 | x |
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
| arguments.js:4:38:4:38 | 0 | 0 |
|
||||
| arguments.js:5:35:5:35 | 1 | 1 |
|
||||
| arguments.js:7:29:7:29 | 2 | 2 |
|
||||
| arguments.js:9:37:9:37 | 0 | 0 |
|
||||
| arguments.js:11:7:11:7 | 1 | 1 |
|
||||
| arguments.js:11:10:11:10 | 2 | 2 |
|
||||
| arguments.js:11:13:11:13 | 3 | 3 |
|
||||
| eval.js:2:11:2:12 | 42 | 42 |
|
||||
| sources.js:4:12:4:13 | 19 | 19 |
|
||||
| sources.js:5:4:5:5 | 23 | 23 |
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
| arguments.js:1:1:12:4 | exceptional return of (functi ... );\\n})() | call |
|
||||
| arguments.js:1:2:12:1 | exceptional return of anonymous function | call |
|
||||
| arguments.js:2:5:10:5 | exceptional return of function f | call |
|
||||
| arguments.js:2:16:2:16 | x | call |
|
||||
| arguments.js:4:28:4:39 | arguments[0] | heap |
|
||||
| arguments.js:5:25:5:36 | arguments[1] | heap |
|
||||
| arguments.js:7:24:7:30 | args[2] | heap |
|
||||
| arguments.js:9:27:9:38 | arguments[0] | heap |
|
||||
| arguments.js:11:5:11:14 | exceptional return of f(1, 2, 3) | call |
|
||||
| arguments.js:11:5:11:14 | f(1, 2, 3) | call |
|
||||
| eval.js:1:1:5:1 | exceptional return of function k | call |
|
||||
| eval.js:2:7:2:12 | x | eval |
|
||||
| eval.js:3:3:3:6 | eval | global |
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
| arguments.js:2:16:2:16 | x |
|
||||
| sources.js:1:6:1:6 | x |
|
||||
| sources.js:3:11:3:11 | x |
|
||||
| sources.js:9:14:9:18 | array |
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
| arguments.js:1:1:1:0 | this |
|
||||
| arguments.js:1:1:12:4 | (functi ... );\\n})() |
|
||||
| arguments.js:1:2:1:1 | this |
|
||||
| arguments.js:1:2:12:1 | functio ... , 3);\\n} |
|
||||
| arguments.js:2:5:2:4 | this |
|
||||
| arguments.js:2:5:10:5 | functio ... ;\\n } |
|
||||
| arguments.js:2:16:2:16 | x |
|
||||
| arguments.js:4:28:4:39 | arguments[0] |
|
||||
| arguments.js:5:25:5:36 | arguments[1] |
|
||||
| arguments.js:7:24:7:30 | args[2] |
|
||||
| arguments.js:8:21:8:22 | {} |
|
||||
| arguments.js:9:27:9:38 | arguments[0] |
|
||||
| arguments.js:11:5:11:14 | f(1, 2, 3) |
|
||||
| eval.js:1:1:1:0 | this |
|
||||
| eval.js:1:1:1:0 | this |
|
||||
| eval.js:1:1:5:1 | functio ... eval`\\n} |
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
| d.js:7:1:7:14 | require('foo') |
|
||||
| e.js:5:1:5:18 | require("process") |
|
||||
| f.js:2:1:2:7 | r("fs") |
|
||||
| g.js:1:1:1:96 | (proces ... https") |
|
||||
| g.js:1:43:1:61 | require("electron") |
|
||||
| index.js:1:12:1:26 | require('path') |
|
||||
| index.js:2:1:2:41 | require ... b.js")) |
|
||||
| mjs-files/require-from-js.js:1:12:1:36 | require ... on-me') |
|
||||
|
||||
1
javascript/ql/test/library-tests/NodeJS/g.js
Normal file
1
javascript/ql/test/library-tests/NodeJS/g.js
Normal file
@@ -0,0 +1 @@
|
||||
(process && "renderer" === process.type ? require("electron").remote.require : require)("https");
|
||||
@@ -31,6 +31,7 @@ typeInferenceMismatch
|
||||
| callbacks.js:44:17:44:24 | source() | callbacks.js:41:10:41:10 | x |
|
||||
| callbacks.js:50:18:50:25 | source() | callbacks.js:30:29:30:29 | y |
|
||||
| callbacks.js:51:18:51:25 | source() | callbacks.js:30:29:30:29 | y |
|
||||
| capture-flow.js:9:11:9:18 | source() | capture-flow.js:14:10:14:16 | outer() |
|
||||
| captured-sanitizer.js:25:3:25:10 | source() | captured-sanitizer.js:15:10:15:10 | x |
|
||||
| closure.js:6:15:6:22 | source() | closure.js:8:8:8:31 | string. ... (taint) |
|
||||
| closure.js:6:15:6:22 | source() | closure.js:9:8:9:25 | string.trim(taint) |
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
| callbacks.js:44:17:44:24 | source() | callbacks.js:41:10:41:10 | x |
|
||||
| callbacks.js:50:18:50:25 | source() | callbacks.js:30:29:30:29 | y |
|
||||
| callbacks.js:51:18:51:25 | source() | callbacks.js:30:29:30:29 | y |
|
||||
| capture-flow.js:9:11:9:18 | source() | capture-flow.js:14:10:14:16 | outer() |
|
||||
| captured-sanitizer.js:25:3:25:10 | source() | captured-sanitizer.js:15:10:15:10 | x |
|
||||
| constructor-calls.js:4:18:4:25 | source() | constructor-calls.js:18:8:18:14 | c.taint |
|
||||
| constructor-calls.js:4:18:4:25 | source() | constructor-calls.js:22:8:22:19 | c_safe.taint |
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'dummy';
|
||||
|
||||
function outerMost() {
|
||||
function outer() {
|
||||
var captured;
|
||||
function f(x) {
|
||||
captured = x;
|
||||
}
|
||||
f(source());
|
||||
|
||||
return captured;
|
||||
}
|
||||
|
||||
sink(outer()); // NOT OK
|
||||
|
||||
return outer();
|
||||
}
|
||||
|
||||
sink(outerMost()); // NOT OK - but missed
|
||||
@@ -0,0 +1,5 @@
|
||||
import javascript
|
||||
|
||||
query predicate test_HeaderAccess(HTTP::RequestHeaderAccess access, string res) {
|
||||
res = access.getAHeaderName()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import javascript
|
||||
|
||||
query predicate test_HeaderDefinition(HTTP::HeaderDefinition hd, Fastify::RouteHandler rh) {
|
||||
rh = hd.getRouteHandler()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import javascript
|
||||
|
||||
query predicate test_HeaderDefinition_defines(HTTP::HeaderDefinition hd, string name, string value) {
|
||||
hd.defines(name, value) and hd.getRouteHandler() instanceof Fastify::RouteHandler
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import javascript
|
||||
|
||||
query predicate test_HeaderDefinition_getAHeaderName(HTTP::HeaderDefinition hd, string res) {
|
||||
hd.getRouteHandler() instanceof Fastify::RouteHandler and res = hd.getAHeaderName()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import javascript
|
||||
|
||||
query predicate test_RedirectInvocation(HTTP::RedirectInvocation invk, Fastify::RouteHandler rh) {
|
||||
invk.getRouteHandler() = rh
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import javascript
|
||||
|
||||
query predicate test_RequestInputAccess(
|
||||
HTTP::RequestInputAccess ria, string res, Fastify::RouteHandler rh, boolean isUserControlledObject
|
||||
) {
|
||||
ria.getRouteHandler() = rh and
|
||||
res = ria.getKind() and
|
||||
if ria.isUserControlledObject()
|
||||
then isUserControlledObject = true
|
||||
else isUserControlledObject = false
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import javascript
|
||||
|
||||
query predicate test_ResponseSendArgument(HTTP::ResponseSendArgument arg, Fastify::RouteHandler rh) {
|
||||
arg.getRouteHandler() = rh
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import javascript
|
||||
|
||||
query predicate test_RouteHandler(Fastify::RouteHandler rh, Expr res) { res = rh.getServer() }
|
||||
@@ -0,0 +1,5 @@
|
||||
import semmle.javascript.frameworks.Express
|
||||
|
||||
query predicate test_RouteHandler_getARequestExpr(Fastify::RouteHandler rh, HTTP::RequestExpr res) {
|
||||
res = rh.getARequestExpr()
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import semmle.javascript.frameworks.Express
|
||||
|
||||
query predicate test_RouteHandler_getAResponseHeader(
|
||||
Fastify::RouteHandler rh, string name, HTTP::HeaderDefinition res
|
||||
) {
|
||||
res = rh.getAResponseHeader(name)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import javascript
|
||||
|
||||
query predicate test_RouteSetup(Fastify::RouteSetup rs) { any() }
|
||||
@@ -0,0 +1,5 @@
|
||||
import javascript
|
||||
|
||||
query predicate test_RouteSetup_getARouteHandler(Fastify::RouteSetup r, DataFlow::SourceNode res) {
|
||||
res = r.getARouteHandler()
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import javascript
|
||||
|
||||
query predicate test_RouteSetup_getServer(Fastify::RouteSetup rs, Expr res) { res = rs.getServer() }
|
||||
@@ -0,0 +1,3 @@
|
||||
import javascript
|
||||
|
||||
query predicate test_ServerDefinition(Fastify::ServerDefinition s) { any() }
|
||||
@@ -0,0 +1,92 @@
|
||||
var fastify = require("fastify")();
|
||||
|
||||
fastify.get(
|
||||
"/",
|
||||
/* handler */ async (request, reply) => {
|
||||
return { hello: "world" }; // response
|
||||
}
|
||||
);
|
||||
|
||||
fastify.route({
|
||||
method: "GET",
|
||||
url: "/",
|
||||
onRequest: /* handler */ (request, reply, done) => {},
|
||||
preParsing: /* handler */ (request, reply, done) => {},
|
||||
preValidation: /* handler */ (request, reply, done) => {},
|
||||
preHandler: /* handler */ (request, reply, done) => {},
|
||||
preSerialization: /* handler */ (request, reply, payload, done) => {},
|
||||
onSend: /* handler */ (request, reply, payload, done) => {},
|
||||
onResponse: /* handler */ (request, reply, done) => {},
|
||||
handler: /* handler */ (request, reply) => {}
|
||||
});
|
||||
|
||||
fastify.get(
|
||||
"/",
|
||||
opts,
|
||||
/* handler */ (request, reply) => {
|
||||
reply.send({ hello: "world" }); // response
|
||||
}
|
||||
);
|
||||
|
||||
fastify.post(
|
||||
"/:params",
|
||||
options,
|
||||
/* handler */ function(request, reply) {
|
||||
// request properties
|
||||
request.query.name; // the parsed querystring
|
||||
request.body; // the body
|
||||
request.params.name; // the params matching the URL
|
||||
request.headers.name; // the headers
|
||||
|
||||
// reply properties
|
||||
reply.header("name", "value"); // Sets a response header.
|
||||
reply.headers({ name: "value" }); // Sets all the keys of the object as a response headers.
|
||||
reply.redirect(code, url); // Redirect to the specified url, the status code is optional (default to 302).
|
||||
reply.send(payload); // Sends the payload to the user, could be a plain text, a buffer, JSON, stream
|
||||
}
|
||||
);
|
||||
fastify.listen(3000);
|
||||
|
||||
var fastifyWithObjects1 = require("fastify")();
|
||||
fastifyWithObjects1.register(require("fastify-xml-body-parser"));
|
||||
fastifyWithObjects1.post(
|
||||
"/:params",
|
||||
/* handler */ function(request, reply) {
|
||||
request.query;
|
||||
request.body;
|
||||
request.params;
|
||||
}
|
||||
);
|
||||
|
||||
var fastifyWithObjects2 = require("fastify")();
|
||||
fastifyWithObjects2.register(require("fastify-formbody"));
|
||||
fastifyWithObjects2.post(
|
||||
"/:params",
|
||||
/* handler */ function(request, reply) {
|
||||
request.query;
|
||||
request.body;
|
||||
request.params;
|
||||
}
|
||||
);
|
||||
|
||||
var fastifyWithObjects3 = require("fastify")();
|
||||
fastifyWithObjects3.register(require("fastify-qs"));
|
||||
fastifyWithObjects3.post(
|
||||
"/:params",
|
||||
/* handler */ function(request, reply) {
|
||||
request.query;
|
||||
request.body;
|
||||
request.params;
|
||||
}
|
||||
);
|
||||
|
||||
var fastifyWithObjects4 = require("fastify")();
|
||||
fastifyWithObjects4.use(require("body-parser").urlencoded({ extended: true }));
|
||||
fastifyWithObjects4.post(
|
||||
"/:params",
|
||||
/* handler */ function(request, reply) {
|
||||
request.query;
|
||||
request.body;
|
||||
request.params;
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,125 @@
|
||||
test_RouteSetup
|
||||
| src/fastify.js:3:1:8:1 | fastify ... e\\n }\\n) |
|
||||
| src/fastify.js:10:1:21:2 | fastify ... > {}\\n}) |
|
||||
| src/fastify.js:23:1:29:1 | fastify ... e\\n }\\n) |
|
||||
| src/fastify.js:31:1:47:1 | fastify ... m\\n }\\n) |
|
||||
| src/fastify.js:52:1:59:1 | fastify ... ;\\n }\\n) |
|
||||
| src/fastify.js:63:1:70:1 | fastify ... ;\\n }\\n) |
|
||||
| src/fastify.js:74:1:81:1 | fastify ... ;\\n }\\n) |
|
||||
| src/fastify.js:85:1:92:1 | fastify ... ;\\n }\\n) |
|
||||
test_RequestInputAccess
|
||||
| src/fastify.js:36:5:36:17 | request.query | parameter | src/fastify.js:34:17:46:3 | functio ... eam\\n } | false |
|
||||
| src/fastify.js:37:5:37:16 | request.body | body | src/fastify.js:34:17:46:3 | functio ... eam\\n } | false |
|
||||
| src/fastify.js:38:5:38:18 | request.params | parameter | src/fastify.js:34:17:46:3 | functio ... eam\\n } | false |
|
||||
| src/fastify.js:39:5:39:24 | request.headers.name | header | src/fastify.js:34:17:46:3 | functio ... eam\\n } | false |
|
||||
| src/fastify.js:55:5:55:17 | request.query | parameter | src/fastify.js:54:17:58:3 | functio ... ms;\\n } | false |
|
||||
| src/fastify.js:56:5:56:16 | request.body | body | src/fastify.js:54:17:58:3 | functio ... ms;\\n } | true |
|
||||
| src/fastify.js:57:5:57:18 | request.params | parameter | src/fastify.js:54:17:58:3 | functio ... ms;\\n } | false |
|
||||
| src/fastify.js:66:5:66:17 | request.query | parameter | src/fastify.js:65:17:69:3 | functio ... ms;\\n } | false |
|
||||
| src/fastify.js:67:5:67:16 | request.body | body | src/fastify.js:65:17:69:3 | functio ... ms;\\n } | true |
|
||||
| src/fastify.js:68:5:68:18 | request.params | parameter | src/fastify.js:65:17:69:3 | functio ... ms;\\n } | false |
|
||||
| src/fastify.js:77:5:77:17 | request.query | parameter | src/fastify.js:76:17:80:3 | functio ... ms;\\n } | true |
|
||||
| src/fastify.js:78:5:78:16 | request.body | body | src/fastify.js:76:17:80:3 | functio ... ms;\\n } | false |
|
||||
| src/fastify.js:79:5:79:18 | request.params | parameter | src/fastify.js:76:17:80:3 | functio ... ms;\\n } | true |
|
||||
| src/fastify.js:88:5:88:17 | request.query | parameter | src/fastify.js:87:17:91:3 | functio ... ms;\\n } | false |
|
||||
| src/fastify.js:89:5:89:16 | request.body | body | src/fastify.js:87:17:91:3 | functio ... ms;\\n } | true |
|
||||
| src/fastify.js:90:5:90:18 | request.params | parameter | src/fastify.js:87:17:91:3 | functio ... ms;\\n } | false |
|
||||
test_RouteHandler_getAResponseHeader
|
||||
| src/fastify.js:34:17:46:3 | functio ... eam\\n } | name | src/fastify.js:42:5:42:33 | reply.h ... value") |
|
||||
| src/fastify.js:34:17:46:3 | functio ... eam\\n } | name | src/fastify.js:43:5:43:36 | reply.h ... lue" }) |
|
||||
test_HeaderDefinition_defines
|
||||
| src/fastify.js:42:5:42:33 | reply.h ... value") | name | value |
|
||||
| src/fastify.js:43:5:43:36 | reply.h ... lue" }) | name | value |
|
||||
test_HeaderDefinition
|
||||
| src/fastify.js:42:5:42:33 | reply.h ... value") | src/fastify.js:34:17:46:3 | functio ... eam\\n } |
|
||||
| src/fastify.js:43:5:43:36 | reply.h ... lue" }) | src/fastify.js:34:17:46:3 | functio ... eam\\n } |
|
||||
test_RouteSetup_getServer
|
||||
| src/fastify.js:3:1:8:1 | fastify ... e\\n }\\n) | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:10:1:21:2 | fastify ... > {}\\n}) | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:23:1:29:1 | fastify ... e\\n }\\n) | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:31:1:47:1 | fastify ... m\\n }\\n) | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:52:1:59:1 | fastify ... ;\\n }\\n) | src/fastify.js:50:27:50:46 | require("fastify")() |
|
||||
| src/fastify.js:63:1:70:1 | fastify ... ;\\n }\\n) | src/fastify.js:61:27:61:46 | require("fastify")() |
|
||||
| src/fastify.js:74:1:81:1 | fastify ... ;\\n }\\n) | src/fastify.js:72:27:72:46 | require("fastify")() |
|
||||
| src/fastify.js:85:1:92:1 | fastify ... ;\\n }\\n) | src/fastify.js:83:27:83:46 | require("fastify")() |
|
||||
test_HeaderDefinition_getAHeaderName
|
||||
| src/fastify.js:42:5:42:33 | reply.h ... value") | name |
|
||||
| src/fastify.js:43:5:43:36 | reply.h ... lue" }) | name |
|
||||
test_ServerDefinition
|
||||
| src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:50:27:50:46 | require("fastify")() |
|
||||
| src/fastify.js:61:27:61:46 | require("fastify")() |
|
||||
| src/fastify.js:72:27:72:46 | require("fastify")() |
|
||||
| src/fastify.js:83:27:83:46 | require("fastify")() |
|
||||
test_HeaderAccess
|
||||
| src/fastify.js:39:5:39:24 | request.headers.name | name |
|
||||
test_RouteSetup_getARouteHandler
|
||||
| src/fastify.js:3:1:8:1 | fastify ... e\\n }\\n) | src/fastify.js:5:17:7:3 | async ( ... nse\\n } |
|
||||
| src/fastify.js:10:1:21:2 | fastify ... > {}\\n}) | src/fastify.js:13:28:13:55 | (reques ... ) => {} |
|
||||
| src/fastify.js:10:1:21:2 | fastify ... > {}\\n}) | src/fastify.js:14:29:14:56 | (reques ... ) => {} |
|
||||
| src/fastify.js:10:1:21:2 | fastify ... > {}\\n}) | src/fastify.js:15:32:15:59 | (reques ... ) => {} |
|
||||
| src/fastify.js:10:1:21:2 | fastify ... > {}\\n}) | src/fastify.js:16:29:16:56 | (reques ... ) => {} |
|
||||
| src/fastify.js:10:1:21:2 | fastify ... > {}\\n}) | src/fastify.js:17:35:17:71 | (reques ... ) => {} |
|
||||
| src/fastify.js:10:1:21:2 | fastify ... > {}\\n}) | src/fastify.js:18:25:18:61 | (reques ... ) => {} |
|
||||
| src/fastify.js:10:1:21:2 | fastify ... > {}\\n}) | src/fastify.js:19:29:19:56 | (reques ... ) => {} |
|
||||
| src/fastify.js:10:1:21:2 | fastify ... > {}\\n}) | src/fastify.js:20:26:20:47 | (reques ... ) => {} |
|
||||
| src/fastify.js:23:1:29:1 | fastify ... e\\n }\\n) | src/fastify.js:26:17:28:3 | (reques ... nse\\n } |
|
||||
| src/fastify.js:31:1:47:1 | fastify ... m\\n }\\n) | src/fastify.js:34:17:46:3 | functio ... eam\\n } |
|
||||
| src/fastify.js:52:1:59:1 | fastify ... ;\\n }\\n) | src/fastify.js:54:17:58:3 | functio ... ms;\\n } |
|
||||
| src/fastify.js:63:1:70:1 | fastify ... ;\\n }\\n) | src/fastify.js:65:17:69:3 | functio ... ms;\\n } |
|
||||
| src/fastify.js:74:1:81:1 | fastify ... ;\\n }\\n) | src/fastify.js:76:17:80:3 | functio ... ms;\\n } |
|
||||
| src/fastify.js:85:1:92:1 | fastify ... ;\\n }\\n) | src/fastify.js:87:17:91:3 | functio ... ms;\\n } |
|
||||
test_RouteHandler
|
||||
| src/fastify.js:5:17:7:3 | async ( ... nse\\n } | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:13:28:13:55 | (reques ... ) => {} | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:14:29:14:56 | (reques ... ) => {} | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:15:32:15:59 | (reques ... ) => {} | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:16:29:16:56 | (reques ... ) => {} | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:17:35:17:71 | (reques ... ) => {} | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:18:25:18:61 | (reques ... ) => {} | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:19:29:19:56 | (reques ... ) => {} | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:20:26:20:47 | (reques ... ) => {} | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:26:17:28:3 | (reques ... nse\\n } | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:34:17:46:3 | functio ... eam\\n } | src/fastify.js:1:15:1:34 | require("fastify")() |
|
||||
| src/fastify.js:54:17:58:3 | functio ... ms;\\n } | src/fastify.js:50:27:50:46 | require("fastify")() |
|
||||
| src/fastify.js:65:17:69:3 | functio ... ms;\\n } | src/fastify.js:61:27:61:46 | require("fastify")() |
|
||||
| src/fastify.js:76:17:80:3 | functio ... ms;\\n } | src/fastify.js:72:27:72:46 | require("fastify")() |
|
||||
| src/fastify.js:87:17:91:3 | functio ... ms;\\n } | src/fastify.js:83:27:83:46 | require("fastify")() |
|
||||
test_RouteHandler_getARequestExpr
|
||||
| src/fastify.js:5:17:7:3 | async ( ... nse\\n } | src/fastify.js:5:24:5:30 | request |
|
||||
| src/fastify.js:13:28:13:55 | (reques ... ) => {} | src/fastify.js:13:29:13:35 | request |
|
||||
| src/fastify.js:14:29:14:56 | (reques ... ) => {} | src/fastify.js:14:30:14:36 | request |
|
||||
| src/fastify.js:15:32:15:59 | (reques ... ) => {} | src/fastify.js:15:33:15:39 | request |
|
||||
| src/fastify.js:16:29:16:56 | (reques ... ) => {} | src/fastify.js:16:30:16:36 | request |
|
||||
| src/fastify.js:17:35:17:71 | (reques ... ) => {} | src/fastify.js:17:36:17:42 | request |
|
||||
| src/fastify.js:18:25:18:61 | (reques ... ) => {} | src/fastify.js:18:26:18:32 | request |
|
||||
| src/fastify.js:19:29:19:56 | (reques ... ) => {} | src/fastify.js:19:30:19:36 | request |
|
||||
| src/fastify.js:20:26:20:47 | (reques ... ) => {} | src/fastify.js:20:27:20:33 | request |
|
||||
| src/fastify.js:26:17:28:3 | (reques ... nse\\n } | src/fastify.js:26:18:26:24 | request |
|
||||
| src/fastify.js:34:17:46:3 | functio ... eam\\n } | src/fastify.js:34:26:34:32 | request |
|
||||
| src/fastify.js:34:17:46:3 | functio ... eam\\n } | src/fastify.js:36:5:36:11 | request |
|
||||
| src/fastify.js:34:17:46:3 | functio ... eam\\n } | src/fastify.js:37:5:37:11 | request |
|
||||
| src/fastify.js:34:17:46:3 | functio ... eam\\n } | src/fastify.js:38:5:38:11 | request |
|
||||
| src/fastify.js:34:17:46:3 | functio ... eam\\n } | src/fastify.js:39:5:39:11 | request |
|
||||
| src/fastify.js:54:17:58:3 | functio ... ms;\\n } | src/fastify.js:54:26:54:32 | request |
|
||||
| src/fastify.js:54:17:58:3 | functio ... ms;\\n } | src/fastify.js:55:5:55:11 | request |
|
||||
| src/fastify.js:54:17:58:3 | functio ... ms;\\n } | src/fastify.js:56:5:56:11 | request |
|
||||
| src/fastify.js:54:17:58:3 | functio ... ms;\\n } | src/fastify.js:57:5:57:11 | request |
|
||||
| src/fastify.js:65:17:69:3 | functio ... ms;\\n } | src/fastify.js:65:26:65:32 | request |
|
||||
| src/fastify.js:65:17:69:3 | functio ... ms;\\n } | src/fastify.js:66:5:66:11 | request |
|
||||
| src/fastify.js:65:17:69:3 | functio ... ms;\\n } | src/fastify.js:67:5:67:11 | request |
|
||||
| src/fastify.js:65:17:69:3 | functio ... ms;\\n } | src/fastify.js:68:5:68:11 | request |
|
||||
| src/fastify.js:76:17:80:3 | functio ... ms;\\n } | src/fastify.js:76:26:76:32 | request |
|
||||
| src/fastify.js:76:17:80:3 | functio ... ms;\\n } | src/fastify.js:77:5:77:11 | request |
|
||||
| src/fastify.js:76:17:80:3 | functio ... ms;\\n } | src/fastify.js:78:5:78:11 | request |
|
||||
| src/fastify.js:76:17:80:3 | functio ... ms;\\n } | src/fastify.js:79:5:79:11 | request |
|
||||
| src/fastify.js:87:17:91:3 | functio ... ms;\\n } | src/fastify.js:87:26:87:32 | request |
|
||||
| src/fastify.js:87:17:91:3 | functio ... ms;\\n } | src/fastify.js:88:5:88:11 | request |
|
||||
| src/fastify.js:87:17:91:3 | functio ... ms;\\n } | src/fastify.js:89:5:89:11 | request |
|
||||
| src/fastify.js:87:17:91:3 | functio ... ms;\\n } | src/fastify.js:90:5:90:11 | request |
|
||||
test_ResponseSendArgument
|
||||
| src/fastify.js:6:12:6:29 | { hello: "world" } | src/fastify.js:5:17:7:3 | async ( ... nse\\n } |
|
||||
| src/fastify.js:27:16:27:33 | { hello: "world" } | src/fastify.js:26:17:28:3 | (reques ... nse\\n } |
|
||||
| src/fastify.js:45:16:45:22 | payload | src/fastify.js:34:17:46:3 | functio ... eam\\n } |
|
||||
test_RedirectInvocation
|
||||
| src/fastify.js:44:5:44:29 | reply.r ... e, url) | src/fastify.js:34:17:46:3 | functio ... eam\\n } |
|
||||
14
javascript/ql/test/library-tests/frameworks/fastify/tests.ql
Normal file
14
javascript/ql/test/library-tests/frameworks/fastify/tests.ql
Normal file
@@ -0,0 +1,14 @@
|
||||
import RouteSetup
|
||||
import RequestInputAccess
|
||||
import RouteHandler_getAResponseHeader
|
||||
import HeaderDefinition_defines
|
||||
import HeaderDefinition
|
||||
import RouteSetup_getServer
|
||||
import HeaderDefinition_getAHeaderName
|
||||
import ServerDefinition
|
||||
import HeaderAccess
|
||||
import RouteSetup_getARouteHandler
|
||||
import RouteHandler
|
||||
import RouteHandler_getARequestExpr
|
||||
import ResponseSendArgument
|
||||
import RedirectInvocation
|
||||
Reference in New Issue
Block a user