← Java / Spring · 目次

JAVA-065 / 中級

例外の握りつぶし(catch 後に無視)によるセキュリティイベント欠落

A09:2021 Security Logging and Monitoring Failures · CWE-390 Detection of Error Condition Without Action

なぜ問題になるのか?

認証・署名検証の失敗が黙って通過します。

修正方法

java
try { verify(token); }
catch (JwtException e) { log.warn("jwt invalid reason={}", e.getClass().getSimpleName()); throw new Unauthorized(); }

参考資料