Skip to content

Commit 7712ca3

Browse files
committed
Added useQuery tanstack-vue test case
1 parent 40903a9 commit 7712ca3

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,6 @@ nodes
112112
| testReactRelay.tsx:136:16:136:39 | readFra ... y, key) | semmle.label | readFra ... y, key) |
113113
| testReactRelay.tsx:137:50:137:53 | data | semmle.label | data |
114114
subpaths
115+
testFailures
116+
| test.vue:10:87:10:97 | // $ Source | Missing result: Source |
117+
| test.vue:22:31:22:53 | <!--$ Alert[js/xss] --> | Missing result: Alert[js/xss] |
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<script>
2+
import { useQuery, VueQueryClientProvider } from "@tanstack/vue-query";
3+
4+
5+
export default {
6+
data() {
7+
const { isPending, isError, isFetching, data, error } = useQuery({
8+
queryKey: ["post"],
9+
queryFn: async () => {
10+
const response = await fetch("https://jsonplaceholder.typicode.com/posts/1"); // $ Source
11+
return response.json();
12+
},
13+
});
14+
15+
return { data : data };
16+
}
17+
}
18+
</script>
19+
20+
<template>
21+
<VueQueryClientProvider :client="queryClient">
22+
<div v-html="data"></div> <!--$ Alert[js/xss] -->
23+
</VueQueryClientProvider>
24+
</template>

0 commit comments

Comments
 (0)