最終更新:2023-12-25 (月) 19:39:55 (126d)
Express/セキュリティ
https://expressjs.com/ja/advanced/best-practice-security.html
モジュール
パストラバーサル
サニタイズ
- https://www.stackhawk.com/blog/node-js-path-traversal-guide-examples-and-prevention/
var safe_input = path.normalize(user_input).replace(/^(\.\.(\/|\\|$))+/, '');
- https://security.stackexchange.com/questions/123720/how-to-prevent-directory-traversal-when-joining-paths-in-node-js
- path.normalize
- null(\0)チェック
参考
- path.join
- ルートディレクトリから始まることを確認
- https://web.archive.org/web/20211128060450/https://nodejs.org/en/knowledge/file-system/security/introduction/#preventing-directory-traversal