You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* New: Add `vue/no-v-html` rule
* Update category to undefined as categories are defined in major releases
* Update no-v-html category
* Update no-v-html rule link
# disallow use of v-html to prevent XSS attack (no-v-html)
2
+
3
+
This rule reports use of `v-html` directive in order to reduce the risk of injecting potentially unsafe / unescaped html into the browser leading to Cross Side Scripting (XSS) attacks.
4
+
5
+
## :book: Rule Details
6
+
7
+
This rule reports all uses of `v-html` to help prevent XSS attacks.
8
+
9
+
This rule does not check syntax errors in directives because it's checked by no-parsing-error rule.
10
+
11
+
:-1: Examples of **incorrect** code for this rule:
12
+
13
+
```html
14
+
<template>
15
+
<divv-html="someHTML"></div>
16
+
</template>
17
+
```
18
+
19
+
:+1: Examples of **correct** code for this rule:
20
+
21
+
```html
22
+
<template>
23
+
<div>{{someHTML}}</div>
24
+
</template>
25
+
```
26
+
27
+
## :wrench: Options
28
+
29
+
Nothing.
30
+
31
+
## When Not To Use It
32
+
33
+
If you are certain the content passed `to v-html` is sanitized HTML you can disable this rule.
34
+
35
+
## Further Reading
36
+
37
+
* (XSS in Vue.js)[https://blog.sqreen.io/xss-in-vue-js/]
0 commit comments