發表文章

目前顯示的是有「修補」標籤的文章

[技術] checkmarx弱掃修補

Second Order SQL Injection 取出的值未經過濾或驗證,該值再使用於資料庫查詢 修補方式:對取出的值做檢查 原為 return $article_no; 改為 return (int)str_replace(",", "", $article_no); 參考資料: https://www.itread01.com/articles/1476210031.html https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/528220/ https://www.qa-knowhow.com/?p=4242 Stored XSS 原為 echo $message; 改為 echo htmlspecialchars($message, ENT_QUOTES); 參考資料: https://www.qa-knowhow.com/?p=2992 https://ithelp.ithome.com.tw/questions/10189316 Insecure Randomness 因使用rand()或str_shuffle()函數被檢測出需修補 修補方式: 原為 substr(str_shuffle('0123456789'), 0, 3); 改為 random_int(100, 999); //取3位數 數字 參考資料: https://www.soliantconsulting.com/blog/secure-randomness-php/ https://www.php.net/manual/en/function.random-int.php  其他參考資料: 叡揚資訊-應用系統面臨多元資安風險之教戰手則(下) https://www.gss.com.tw/eis/161-eis85/1672-eis85-9