
OWASP Top Ten for Java Developers With Code Examples
The OWASP Top Ten web risks mapped to Java and Spring: what each one looks like in code, a fix for each and where to read the full guidance.
Authentication, authorization, secrets handling and the vulnerabilities that keep showing up in Java code reviews.

The OWASP Top Ten web risks mapped to Java and Spring: what each one looks like in code, a fix for each and where to read the full guidance.

Prevent XML external entity attacks in Java: disable DOCTYPE and external entities on DocumentBuilder, SAX, StAX, TransformerFactory and XMLReader.

Prevent insecure deserialization in Java: avoid ObjectInputStream on untrusted data, use serial filters, safe formats like JSON and gadget chain awareness.

Secure a Quarkus service with OIDC and Keycloak: bearer token mode, Dev Services for Keycloak, role based access with annotations and testing with tokens.

Learn where Struts 2 evaluates OGNL, why user input must never reach an expression, and which settings and habits keep the value stack safe.

Secure a Micronaut API with JWT bearer tokens: configure signing, issue a token from a login endpoint and protect routes with annotations and roles.

Migrate WebSecurityConfigurerAdapter to SecurityFilterChain, WebSecurityCustomizer and AuthenticationManager beans, with before and after code and pitfalls.

A defensive checklist for Struts 2: upgrade, restrict method and parameter access, limit OGNL, check uploads and reduce what the server can do.

Spring Security 7 migration notes: removal of and() chaining, deprecated API removal, request matcher changes and an upgrade path from 6.5.

Configure Spring Security with a SecurityFilterChain bean: authorize requests, form login, logout, CSRF, headers, multiple chains and testing the rules.

Move from coarse roles to fine permissions in Spring Security with method security, custom bean checks, a meta annotation and tests for allow and deny.

Fix the Java PKIX path building failed TLS error by finding the missing CA, importing it into a truststore and never disabling verification.
We send one email when a new post is published. No spam.