Skip to content

Files

Latest commit

 

History

History
27 lines (17 loc) · 664 Bytes

no-v-html.md

File metadata and controls

27 lines (17 loc) · 664 Bytes

Pattern: Use of v-html directive

Issue: -

Description

This rule reports all uses of v-html directive in order to reduce the risk of injecting potentially unsafe/unescaped HTML into the browser leading to Cross-Site Scripting (XSS) attacks.

<template>
  <!-- ✓ GOOD -->
  <div>{{ someHTML }}</div>

  <!-- ✗ BAD -->
  <div v-html="someHTML"></div>
</template>

If you are certain the content passed to v-html is sanitized HTML you can disable this rule.

Further Reading