Skip to content

Commit c84658d

Browse files
committed
Python: Use MethodCallNode for MarkupSafe string-format
1 parent d6e8faf commit c84658d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

python/ql/src/semmle/python/frameworks/MarkupSafe.qll

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,8 @@ private module MarkupSafeModel {
6767
}
6868

6969
/** A string format with `markupsafe.Markup` as the format string. */
70-
class StringFormat extends Markup::InstanceSource, DataFlow::CallCfgNode {
71-
StringFormat() {
72-
exists(DataFlow::AttrRead attr | this.getFunction() = attr |
73-
attr.getAttributeName() = "format" and
74-
attr.getObject() = instance()
75-
)
76-
}
70+
class StringFormat extends Markup::InstanceSource, DataFlow::MethodCallNode {
71+
StringFormat() { this.calls(instance(), "format") }
7772
}
7873

7974
/** Taint propagation for `markupsafe.Markup`. */

0 commit comments

Comments
 (0)