提升前端安全性 檢查表

1.加上安全的header
https://devco.re/blog/2014/03/10/security-issues-of-http-headers-1/

2.頁面端傳遞變數時,將其編碼,以免有些參數跑掉了
透過javascript傳遞值,要再加上 encodeURIComponent() 做urlEncode
若使用  encodeURI()  
  • 不編碼符號包括: ~!@#$&*()=:/,;?+'
(轉引自 https://blog.longwin.com.tw/2010/01/javascript-encodeuri-component-utf-8-2010/)

3.不要相信前端傳遞的資料。關鍵的代碼需要在後端編碼過,再傳到前端。

留言

這個網誌中的熱門文章

The Disk2vhd Disaster — and How StarWind’s V2V Brought Redemption! --About Windows Server 2012 STD P2V

如何刪除Trello的卡片資訊 (deleting Trello cards)

Redis 在 C#的應用