mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Merge pull request #13529 from jorgectf/seclab/webix-modeling
JS: Add models for `webix`
This commit is contained in:
4
javascript/ql/lib/change-notes/2023-06-22-webix.md
Normal file
4
javascript/ql/lib/change-notes/2023-06-22-webix.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: minorAnalysis
|
||||
---
|
||||
* Added models for the Webix Framework.
|
||||
@@ -134,6 +134,7 @@ import semmle.javascript.frameworks.TrustedTypes
|
||||
import semmle.javascript.frameworks.UriLibraries
|
||||
import semmle.javascript.frameworks.Vue
|
||||
import semmle.javascript.frameworks.Vuex
|
||||
import semmle.javascript.frameworks.Webix
|
||||
import semmle.javascript.frameworks.WebSocket
|
||||
import semmle.javascript.frameworks.XmlParsers
|
||||
import semmle.javascript.frameworks.xUnit
|
||||
|
||||
@@ -96,7 +96,10 @@ private class ExtendCallDeep extends ExtendCall {
|
||||
callee = LodashUnderscore::member("merge") or
|
||||
callee = LodashUnderscore::member("mergeWith") or
|
||||
callee = LodashUnderscore::member("defaultsDeep") or
|
||||
callee = AngularJS::angular().getAPropertyRead("merge")
|
||||
callee = AngularJS::angular().getAPropertyRead("merge") or
|
||||
callee =
|
||||
[DataFlow::moduleImport("webix"), DataFlow::globalVarRef("webix")]
|
||||
.getAPropertyRead(["extend", "copy"])
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
23
javascript/ql/lib/semmle/javascript/frameworks/Webix.qll
Normal file
23
javascript/ql/lib/semmle/javascript/frameworks/Webix.qll
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Provides classes and predicates for working with the `webix` library.
|
||||
*/
|
||||
|
||||
private import javascript
|
||||
|
||||
/**
|
||||
* Provides classes and predicates for working with the `webix` library.
|
||||
*/
|
||||
module Webix {
|
||||
/** The global variable `webix` as an entry point for API graphs. */
|
||||
private class WebixGlobalEntry extends API::EntryPoint {
|
||||
WebixGlobalEntry() { this = "WebixGlobalEntry" }
|
||||
|
||||
override DataFlow::SourceNode getASource() { result = DataFlow::globalVarRef("webix") }
|
||||
}
|
||||
|
||||
/** Gets a reference to the Webix package. */
|
||||
API::Node webix() {
|
||||
result = API::moduleImport("webix") or
|
||||
result = any(WebixGlobalEntry w).getANode()
|
||||
}
|
||||
}
|
||||
@@ -312,6 +312,13 @@ module CodeInjection {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A value interpreted as code by the `webix` library.
|
||||
*/
|
||||
class WebixExec extends Sink {
|
||||
WebixExec() { this = Webix::webix().getMember("exec").getParameter(0).asSink() }
|
||||
}
|
||||
|
||||
/** A sink for code injection via template injection. */
|
||||
abstract private class TemplateSink extends Sink {
|
||||
deprecated override string getMessageSuffix() {
|
||||
@@ -419,6 +426,18 @@ module CodeInjection {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A value interpreted as a template by the `webix` library.
|
||||
*/
|
||||
class WebixTemplateSink extends TemplateSink {
|
||||
WebixTemplateSink() {
|
||||
this = Webix::webix().getMember("ui").getParameter(0).getMember("template").asSink()
|
||||
or
|
||||
this =
|
||||
Webix::webix().getMember("ui").getParameter(0).getMember("template").getReturn().asSink()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A call to JSON.stringify() seen as a sanitizer.
|
||||
*/
|
||||
|
||||
@@ -171,5 +171,9 @@ module PrototypePollution {
|
||||
call.isDeep() and
|
||||
call = AngularJS::angular().getAMemberCall("merge") and
|
||||
id = "angular"
|
||||
or
|
||||
call.isDeep() and
|
||||
call = Webix::webix().getMember(["extend", "copy"]).getACall() and
|
||||
id = "webix"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user