Spring Security Review
Reviews Java and Kotlin server code for Spring and Quarkus security mistakes, with clear fixes.
Claude's review
7/10 Sharp Spring and Quarkus pitfalls (matcher order, inert method security, JpaSort.unsafe, SpEL contexts, Actuator) plus what not to report.
We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.
In detail
Use when reviewing Java or Kotlin server changes on Spring or Quarkus - security config and method security, JPA/JPQL and JdbcTemplate queries, request binding, deserialization, XML parsers, SpEL, templates, Actuator, JNDI and reflection
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: jvm-security-pitfalls
category: security
description: Use when reviewing Java or Kotlin server changes on Spring or Quarkus - security config and method security, JPA/JPQL and JdbcTemplate queries, request binding, deserialization, XML parsers, SpEL, templates, Actuator, JNDI and reflection
tech_stack: Java & Kotlin
source: original; informed by trailofbits/skills (CC BY-SA 4.0, ideas only, own wording); Spring Security, Spring Data and Quarkus security documentation cited, not reproduced
---
# JVM Security Pitfalls (Java, Kotlin — Spring, Quarkus)
## Overview
On the JVM the dangerous code is often configuration: a matcher order, a missing `@EnableMethodSecurity`, a Jackson typing setting, an Actuator exposure list. Read config and annotation diffs with the same care as handler code.
## 1. Spring Security Configuration (CWE-285, CWE-863)
- `requestMatchers(...)` rules are evaluated in order; a broad `permitAll()` placed above a narrower `hasRole("ADMIN")` wins.
- A security matcher and the MVC mapping must cover the same paths — check trailing slashes, path variables and alternate mappings of the same controller.
- `@PreAuthorize`/`@Secured`/`@RolesAllowed` do nothing without method security enabled (`@EnableMethodSecurity`); a new annotated method in a module that never enables it is unprotected.
- `csrf { disable() }` / `.csrf().disable()` while sessions use cookies → CSRF on every state change.
```kotlin
// ❌ the admin rule is never reached for /api/admin/**
http.authorizeHttpRequests {
it.requestMatchers("/api/**").permitAll()
it.requestMatchers("/api/admin/**").hasRole("ADMIN")
}
// ✅ most specific first, deny by default
http.authorizeHttpRequests {
it.requestMatchers("/api/admin/**").hasRole("ADMIN")
it.requestMatchers("/api/public/**").permitAll()
it.anyRequest().authenticated()
}
```
**Quarkus:** a resource method without `@RolesAllowed`/`@Authenticated` where its siblings have one; `@PermitAll` added; `quarkus.http.auth.permission.<name>.policy=permit` widened to a broader `paths=`; `quarkus.security.jaxrs.deny-unannotated-endpoints` turned off.
## 2. Queries (CWE-89)
```java
// ❌ JPQL injection
...From makifbaysal's repository, Apache-2.0 licence.
Related skills
-
Checked
Codebase quality audit
Audits a whole code repo for bugs, security holes, slow paths and dead code, ranked in plain English.
7/101 credit -
Checked
Security and CVE audit
Runs a security and CVE audit on code in any language and scores it out of 100, with false alarms filtered.
7/101 credit -
Checked
OWASP code review
Reviews code for security flaws using the latest OWASP Top 10 lists, including those for AI and agent apps.
7/101 credit -
Checked
Code security hardening
Hardens code that handles user input, logins and data against the OWASP Top 10, starting from a threat model.
7/101 credit -
Checked
Android intent security
Audits Android components and incoming intents to fix redirection and unauthorised access holes in your app.
8/101 credit -
Checked
GitHub Actions Security
Reviews your GitHub Actions workflows for script injection, risky triggers and over scoped tokens, with fixes.
7/101 credit