Skip to content

Commit be69c3a

Browse files
erik-kroghesbena
andauthored
Apply suggestions from code review
Co-authored-by: Esben Sparre Andreasen <[email protected]>
1 parent 2d1ba59 commit be69c3a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

javascript/ql/src/semmle/javascript/security/dataflow/UnsafeHtmlConstructionCustomizations.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module UnsafeHtmlConstruction {
3838

3939
/**
4040
* A sink for unsafe HTML constructed from library input.
41-
* This sink somehow transforms its input into a value that can cause XSS if it ends up in a XSS sink.
41+
* This sink transforms its input into a value that can cause XSS if it ends up in a XSS sink.
4242
*/
4343
abstract class Sink extends DataFlow::Node {
4444
/**
@@ -165,6 +165,7 @@ module UnsafeHtmlConstruction {
165165
MarkdownSink() {
166166
exists(DataFlow::Node pred, DataFlow::Node succ, Markdown::MarkdownStep step |
167167
step.step(pred, succ) and
168+
step.preservesHtml() and
168169
this = pred and
169170
succ = isUsedInXssSink(xssSink)
170171
)
@@ -176,7 +177,7 @@ module UnsafeHtmlConstruction {
176177
/**
177178
* Holds if there is a path without unmatched return steps from `source` to `sink`.
178179
*/
179-
predicate requireMatchedReturn(DataFlow::SourcePathNode source, DataFlow::SinkPathNode sink) {
180+
predicate hasPathWithoutUnmatchedReturn(DataFlow::SourcePathNode source, DataFlow::SinkPathNode sink) {
180181
exists(DataFlow::MidPathNode mid |
181182
source.getASuccessor*() = mid and
182183
sink = mid.getASuccessor() and

0 commit comments

Comments
 (0)