Java Security Cheat Sheet¶
This cheat sheet highlights some specific topics for Java applications and references specific Cheat Sheets for more details.
See as well:
Serialization¶
Java Serialization can potentially be used to trigger arbitrary code execution (Oracle Secure Coding Guidelines for Java SE, section 8):
- Do not deserialize untrusted data.
- Even deserializing trusted data coming from a database could be a security risk. A compromised database could be exploited to execute arbitrary code in your application.
See the Deserialization Cheat Sheet for more information on this topic.
SQL and JPA injections¶
See the following Cheat Sheets for protection against SQL injection protection:
Using an ORM such as JPA/Hibernate does not constitute a blanket protection against injection attacks. JPA/Hibernate applications may be vulnerable to JPQL/HQL injection attacks. Query parameterization is still necessary. See the Query Parameterization Cheat Sheet for example of JPA/Hibernate usage.