Skip to content

Commit b5a5798

Browse files
committed
small changes based on review feedback
1 parent 0f94833 commit b5a5798

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

change-notes/1.24/analysis-javascript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
| **Query** | **Tags** | **Purpose** |
1212
|---------------------------------------------------------------------------------|-------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
13-
| Client-side cross-site scripting through exception (`js/xss-through-exception`) | security, external/cwe/cwe-079, external/cwe/cwe-116 | Highlights potential XSS vulnerabilities where an exception is written to the DOM. Results are not shown on LGTM by default. |
13+
| Cross-site scripting through exception (`js/xss-through-exception`) | security, external/cwe/cwe-079, external/cwe/cwe-116 | Highlights potential XSS vulnerabilities where an exception is written to the DOM. Results are not shown on LGTM by default. |
1414

1515
## Changes to existing queries
1616

javascript/ql/src/Security/CWE-079/ExceptionXss.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @name Client-side cross-site scripting through exception
2+
* @name Cross-site scripting through exception
33
* @description User input being part of an exception allows for
44
* cross-site scripting if that exception is written
55
* to the DOM.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ module ExceptionXss {
1212
import Xss as Xss
1313

1414
/**
15-
* Holds if `node` cannot cause an exception containing sensitive information to be thrown.
15+
* Holds if `node` is unlikely to cause an exception containing sensitive information to be thrown.
1616
*/
17-
predicate canDefinitelyNotThrowSensitiveInformation(DataFlow::Node node) {
17+
private predicate isUnlikelyToThrowSensitiveInformation(DataFlow::Node node) {
1818
node = any(DataFlow::CallNode call | call.getCalleeName() = "getElementById").getAnArgument()
1919
or
2020
node = any(DataFlow::CallNode call | call.getCalleeName() = "indexOf").getAnArgument()
@@ -28,7 +28,7 @@ module ExceptionXss {
2828
* Holds if `node` can possibly cause an exception containing sensitive information to be thrown.
2929
*/
3030
predicate canThrowSensitiveInformation(DataFlow::Node node) {
31-
not canDefinitelyNotThrowSensitiveInformation(node) and
31+
not isUnlikelyToThrowSensitiveInformation(node) and
3232
(
3333
// in the case of reflective calls the below ensures that both InvokeNodes have no known callee.
3434
forex(DataFlow::InvokeNode call | node = call.getAnArgument() | not exists(call.getACallee()))

0 commit comments

Comments
 (0)