add support for the replicator library

This commit is contained in:
Erik Krogh Kristensen
2021-06-24 11:20:38 +02:00
parent babf657d9d
commit d6300bced3
5 changed files with 9 additions and 1 deletions

View File

@@ -27,6 +27,7 @@ private class PlainJsonParserCall extends JsonParserCall {
exists(DataFlow::SourceNode callee | this = callee.getACall() |
callee = DataFlow::globalVarRef("JSON").getAPropertyRead("parse") or
callee = DataFlow::moduleMember(["json3", "json5", "flatted", "teleport-javascript"], "parse") or
callee = API::moduleImport("replicator").getInstance().getMember("decode").getAnImmediateUse() or
callee = DataFlow::moduleImport("parse-json") or
callee = DataFlow::moduleImport("json-parse-better-errors") or
callee = DataFlow::moduleImport("json-safe-parse") or

View File

@@ -13,6 +13,7 @@ class JsonStringifyCall extends DataFlow::CallNode {
callee = DataFlow::globalVarRef("JSON").getAPropertyRead("stringify") or
callee =
DataFlow::moduleMember(["json3", "json5", "flatted", "teleport-javascript"], "stringify") or
callee = API::moduleImport("replicator").getInstance().getMember("encode").getAnImmediateUse() or
callee =
DataFlow::moduleImport([
"json-stringify-safe", "json-stable-stringify", "stringify-object",