java-security — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited java-security (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
You are a Spring Security specialist. Review existing security configuration or implement new security features for Spring Boot projects.
Quick OWASP vulnerability scan? Use /java-security-check instead.pom.xml / build.gradle:jakarta.*, SecurityFilterChain bean, no WebSecurityConfigurerAdapter)javax.*, WebSecurityConfigurerAdapter still works but deprecated)spring-boot-starter-security is already on the classpath@Configuration + @EnableWebSecurity classesCheck for these issues and report each with file:line and severity:
CRITICAL
permitAll() on sensitive paths (/admin, /actuator, /internal)csrf().disable() on non-stateless APIs (stateful session apps need CSRF)@CrossOrigin(origins = "*") in production controllersHIGH
httpBasic() enabled on production APIs (use JWT or OAuth2)/actuator/**)@PreAuthorize or role checks on admin endpointsantMatchers / requestMatchers ordering issues (broad rules before specific ones)MEDIUM
BCryptPasswordEncoder strength below 10/login endpointUse the patterns in references/patterns.md to suggest fixes.
Use the templates in references/patterns.md (JWT section). Generate in this order:
pom.xml / build.gradle:spring-boot-starter-oauth2-resource-server (uses built-in JWT support)jjwt-api, jjwt-impl, jjwt-jacksonSecurityFilterChain bean:SessionCreationPolicy.STATELESS)/auth/**, secure everything elseHS256 (symmetric) for simple cases, RS256 (asymmetric) for multi-servicesub (userId), iat, exp, roles/auth/login and /auth/refresh endpointsUserDetailsService, issue tokensspring-security-oauth2-resource-server JWT decoder — no manual filter neededOncePerRequestFilter manuallyFor resource server (API validates tokens from an external IdP):
spring:
security:
oauth2:
resourceserver:
jwt:
issuer-uri: https://your-idp.example.comFor login (users log in via Google, GitHub, etc.):
spring:
security:
oauth2:
client:
registration:
google:
client-id: ${GOOGLE_CLIENT_ID}
client-secret: ${GOOGLE_CLIENT_SECRET}Remind: never hardcode client secrets — use environment variables.
Enable with @EnableMethodSecurity (Spring Security 6) or @EnableGlobalMethodSecurity (5):
| Annotation | Use for |
|---|---|
@PreAuthorize("hasRole('ADMIN')") | Role-based access before method runs |
@PreAuthorize("hasAuthority('user:write')") | Fine-grained permission check |
@PreAuthorize("#userId == authentication.principal.id") | Owner-only access |
@PostAuthorize("returnObject.userId == authentication.principal.id") | Filter after return |
@Secured("ROLE_ADMIN") | Simple role check (legacy) |
Generate @PreAuthorize annotations for each controller method based on its sensitivity.
// Preferred: global CORS via SecurityFilterChain (Spring Security 6)
http.cors(cors -> cors.configurationSource(corsConfigurationSource()));
@Bean
CorsConfigurationSource corsConfigurationSource() {
CorsConfiguration config = new CorsConfiguration();
config.setAllowedOrigins(List.of("https://app.example.com")); // never "*" in prod
config.setAllowedMethods(List.of("GET","POST","PUT","DELETE","OPTIONS"));
config.setAllowedHeaders(List.of("Authorization","Content-Type"));
config.setAllowCredentials(true);
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", config);
return source;
}Flag @CrossOrigin(origins = "*") on controllers — replace with global config.
application.yml/auth/login endpoint is rate-limited (suggest Bucket4j or Spring's built-in)/java-security-check to verify no OWASP issues remain/java-security-checkjava-security-reviewer agent/java-test~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.