Cookie should not persist for too long. If the computer that stores the cookie is attacked or breached, this can lead to a potential account compromise.
Cookies should not be stored too long and should not be used to store sensitive data (such as personal identifiable information).
classNotCompliant{publicvoidsetCookie(Stringfield,Stringvalue){Cookiecookie=newCookie("field",value);// Set Cookie for a yearcookie.setMaxAge(2592000);}}
Compliant Code Examples
classCompliant{publicvoidsetCookie(Stringfield,Stringvalue){Cookiecookie=newCookie("field",value);// Set Cookie for a monthcookie.setMaxAge(216000);}}
シームレスな統合。 Datadog Code Security をお試しください
Datadog Code Security
このルールを試し、Datadog Code Security でコードを解析する
このルールの使用方法
1
2
rulesets:- java-security # Rules to enforce Java security.