Skip to content

Commit 6876bcb

Browse files
committed
Add UI5HTMLControlReferenceContentAPI
1 parent 904b1fe commit 6876bcb

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

  • javascript/frameworks/ui5/lib/advanced_security/javascript/frameworks/ui5

javascript/frameworks/ui5/lib/advanced_security/javascript/frameworks/ui5/UI5XssQuery.qll

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module UI5Xss implements DataFlow::ConfigSig {
3636
predicate isSink(DataFlow::Node node) {
3737
node instanceof UI5ExtHtmlISink or
3838
node instanceof UI5ModelHtmlISink or
39+
node instanceof UI5HTMLControlReferenceContentAPI or
3940
node instanceof DynamicallySetElementValueOfInstantiatedHTMLControlPlacedAtDom
4041
}
4142

@@ -68,8 +69,8 @@ class UI5ModelHtmlISink extends DataFlow::Node {
6869
/**
6970
* An HTML injection sink typically for custom controls whose RenderManager calls acting as sinks.
7071
*/
71-
private class UI5ExtHtmlISink extends DataFlow::Node {
72-
UI5ExtHtmlISink() {
72+
private class UI5HTMLControlReferenceContentAPI extends DataFlow::Node {
73+
UI5HTMLControlReferenceContentAPI() {
7374
exists(UI5Control sinkControl, string typeAlias, ControlReference controlReference |
7475
typeModel(typeAlias, sinkControl.getImportPath(), _) and
7576
sinkModel(typeAlias, _, "ui5-html-injection", _) and
@@ -79,7 +80,14 @@ private class UI5ExtHtmlISink extends DataFlow::Node {
7980
this = controlReference.getAPropertyWrite("content").getRhs()
8081
)
8182
) and
82-
// this = ModelOutput::getASinkNode("ui5-html-injection").asSink() and
83+
/* Exclude property writes to instantiated HTML controls; they are covered in a separate class below. */
84+
not this instanceof DynamicallySetElementValueOfInstantiatedHTMLControlPlacedAtDom
85+
}
86+
}
87+
88+
private class UI5ExtHtmlISink extends DataFlow::Node {
89+
UI5ExtHtmlISink() {
90+
this = ModelOutput::getASinkNode("ui5-html-injection").asSink() and
8391
/* Exclude property writes to instantiated HTML controls; they are covered in a separate class below. */
8492
not this instanceof DynamicallySetElementValueOfInstantiatedHTMLControlPlacedAtDom
8593
}

0 commit comments

Comments
 (0)