Skip to content

Commit d92247c

Browse files
committed
JS: Some test updates
1 parent 4c38245 commit d92247c

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

javascript/ql/test/query-tests/Security/CWE-079/UnsafeHtmlConstruction/UnsafeHtmlConstruction.expected

-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
| main.js:111:37:111:37 | x | main.js:98:43:98:43 | x | main.js:111:37:111:37 | x | This markdown rendering which depends on $@ might later allow $@. | main.js:98:43:98:43 | x | library input | main.js:112:24:112:26 | svg | cross-site scripting |
2323
| main.js:117:34:117:34 | s | main.js:116:47:116:47 | s | main.js:117:34:117:34 | s | This markdown rendering which depends on $@ might later allow $@. | main.js:116:47:116:47 | s | library input | main.js:118:53:118:56 | html | cross-site scripting |
2424
| typed.ts:2:29:2:29 | s | typed.ts:1:39:1:39 | s | typed.ts:2:29:2:29 | s | This HTML construction which depends on $@ might later allow $@. | typed.ts:1:39:1:39 | s | library input | typed.ts:3:31:3:34 | html | cross-site scripting |
25-
| typed.ts:8:40:8:40 | s | typed.ts:6:43:6:43 | s | typed.ts:8:40:8:40 | s | This HTML construction which depends on $@ might later allow $@. | typed.ts:6:43:6:43 | s | library input | typed.ts:8:29:8:52 | "<span> ... /span>" | cross-site scripting |
2625
edges
2726
| jquery-plugin.js:11:27:11:31 | stuff | jquery-plugin.js:14:31:14:35 | stuff | provenance | |
2827
| jquery-plugin.js:11:34:11:40 | options | jquery-plugin.js:12:31:12:37 | options | provenance | |
@@ -69,7 +68,6 @@ edges
6968
| main.js:98:43:98:43 | x | main.js:111:37:111:37 | x | provenance | |
7069
| main.js:116:47:116:47 | s | main.js:117:34:117:34 | s | provenance | |
7170
| typed.ts:1:39:1:39 | s | typed.ts:2:29:2:29 | s | provenance | |
72-
| typed.ts:6:43:6:43 | s | typed.ts:8:40:8:40 | s | provenance | |
7371
nodes
7472
| jquery-plugin.js:11:27:11:31 | stuff | semmle.label | stuff |
7573
| jquery-plugin.js:11:34:11:40 | options | semmle.label | options |
@@ -128,6 +126,4 @@ nodes
128126
| main.js:117:34:117:34 | s | semmle.label | s |
129127
| typed.ts:1:39:1:39 | s | semmle.label | s |
130128
| typed.ts:2:29:2:29 | s | semmle.label | s |
131-
| typed.ts:6:43:6:43 | s | semmle.label | s |
132-
| typed.ts:8:40:8:40 | s | semmle.label | s |
133129
subpaths

javascript/ql/test/query-tests/Security/CWE-079/UnsafeHtmlConstruction/typed.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ export function basicHtmlConstruction(s: string) { // $ Source
33
document.body.innerHTML = html;
44
}
55

6-
export function insertIntoCreatedDocument(s: string) { // $ Source
6+
export function insertIntoCreatedDocument(s: string) {
77
const newDoc = document.implementation.createHTMLDocument("");
8-
newDoc.body.innerHTML = "<span>" + s + "</span>"; // $ SPURIOUS: Alert - inserted into document disconnected from the main DOM.
8+
newDoc.body.innerHTML = "<span>" + s + "</span>"; // OK - inserted into document disconnected from the main DOM.
99
}
1010

1111
export function id(s: string) {
@@ -17,4 +17,3 @@ export function notVulnerable() {
1717
const html = "<span>" + s + "</span>";
1818
document.body.innerHTML = html;
1919
}
20-

0 commit comments

Comments
 (0)