Skip to content

Commit f7ad210

Browse files
committed
use SSA instead of internal AccessPath API
1 parent 05bfba4 commit f7ad210

File tree

1 file changed

+4
-11
lines changed
  • javascript/ql/src/semmle/javascript/security/dataflow

1 file changed

+4
-11
lines changed

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,25 +120,18 @@ module Shared {
120120
)
121121
}
122122

123-
private import semmle.javascript.dataflow.internal.AccessPaths as Paths
124-
125123
/**
126-
* Gets an access-path that is used in a sanitizing switch statement.
127-
* The `pragma[noinline]` is to avoid materializing a cartesian product of all access-paths.
124+
* Gets an Ssa variable that is used in a sanitizing switch statement.
125+
* The `pragma[noinline]` is to avoid materializing a cartesian product.
128126
*/
129127
pragma[noinline]
130-
private Paths::AccessPath getAPathEscapedInSwitch() {
131-
exists(Expr str |
132-
isUsedInHTMLEscapingSwitch(str) and
133-
result.getAnInstance() = str
134-
)
135-
}
128+
private SsaVariable getAPathEscapedInSwitch() { isUsedInHTMLEscapingSwitch(result.getAUse()) }
136129

137130
/**
138131
* An expression that is sanitized by a switch-case.
139132
*/
140133
class IsEscapedInSwitchSanitizer extends Sanitizer {
141-
IsEscapedInSwitchSanitizer() { this.asExpr() = getAPathEscapedInSwitch().getAnInstance() }
134+
IsEscapedInSwitchSanitizer() { this.asExpr() = getAPathEscapedInSwitch().getAUse() }
142135
}
143136
}
144137

0 commit comments

Comments
 (0)