Skip to content

Commit

Permalink
chore:new post
Browse files Browse the repository at this point in the history
  • Loading branch information
Timmy committed Jul 17, 2024
1 parent f0ac36e commit 61fa8e3
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions docs/一些文章蒐集/how-vue-prevent-xss.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
---
title: How vue prevent xss
title: How to prevent xss
date: 2022-10-01T00:00:00Z
---

https://segmentfault.com/a/1190000039713551

# 關於防止XSS
## Meta標籤中新增 CSP header 可以設定要執行哪一些來源的script、阻止inline script的執行,做為xss的最後一道防線
::: code-group
```html
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; child-src 'none'; script-src 'self';"
/>

```
:::
## 小心使用vue v-html和:href
### 相關資訊
> [Vue中是如何防御XSS(注入攻击)的](https://segmentfault.com/a/1190000039713551)<br>
> [政府網站漏洞提報的紀錄](https://zeroday.hitcon.org/vulnerability/all)<br>
> [Cymetrics Tech Blog](https://tech-blog.cymetrics.io/)

0 comments on commit 61fa8e3

Please sign in to comment.