Skip to content

Sanitize v-html #6333

@krestaino

Description

@krestaino

What problem does this feature solve?

I'm currently working on making a blog using the WordPress REST API as the back end. The API returns the article with HTML markup in it. I'm taking that JSON response and using v-html to render it into my Vue app. I understand there are cross-site scripting security risks here.

What does the proposed API look like?

It would be great if v-html automatically sanitized the string to remove any <script> tags. For those needing script tags, for whatever reason, maybe v-html-unsafe can accomplish that.

I was recently made aware Angular 4 is doing this and think Vue.js would greatly benefit from this feature.

https://angular.io/guide/security#!#xss

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions