-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Timmy
committed
Jul 17, 2024
1 parent
f0ac36e
commit 61fa8e3
Showing
1 changed file
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/) |