springboot-security

Reviews Spring Boot services for authentication, authorization, validation, and security configuration issues.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/freedom909/real-estate-saas --skill springboot-security-freedom909
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: springboot-security
Source: https://github.com/freedom909/real-estate-saas/tree/main/.trae/skills/springboot-security
Command: npx skills add https://github.com/freedom909/real-estate-saas --skill springboot-security-freedom909

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Spring Boot applications often ship with insecure defaults: missing authorization checks, unvalidated inputs, hardcoded secrets, and misconfigured CORS or CSRF. This Skill provides a structured security review checklist with concrete code patterns so you can harden Java services before release. ## Core Features & Use Cases - Authentication & Authorization Patterns: Stateless JWT filters, method-level security with @PreAuthorize, and deny-by-default access control. - Input & SQL Safety: Bean Validation on DTOs, parameterized queries, and BCrypt/Argon2 password encoding. - Configuration Hardening: CSRF posture, security headers, CORS restrictions, secrets externalization, and Bucket4j rate limiting. - Use Case: Before releasing a new admin API, run a review to confirm every endpoint has authorization guards, all DTOs are validated, no secrets are committed, and dependencies are scanned for CVEs. ## Quick Start Review my Spring Boot SecurityConfig and UserController for authentication, authorization, and input validation issues.

Frequently Asked Questions about springboot-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement JWT authentication in Spring Boot?▼

Implement JWT authentication with a OncePerRequestFilter that extracts the Bearer token from the Authorization header, validates it through a JwtService, and sets the Authentication in SecurityContextHolder. Prefer stateless tokens with a revocation list for logout support.

How to secure Spring Boot REST API endpoints by role?▼

Enable method security with @EnableMethodSecurity and annotate endpoints with @PreAuthorize("hasRole('ADMIN')") or custom expressions like @PreAuthorize("@authz.isOwner(#id, authentication)"). Deny by default and expose only required scopes.

Should I disable CSRF in Spring Security for REST APIs?▼

Disable CSRF only for pure APIs using stateless Bearer token authentication, since CSRF attacks target cookie-based sessions. For browser apps with session cookies, keep CSRF enabled and include the token in forms or headers.

How do I prevent SQL injection in Spring Data JPA?▼

Use Spring Data derived queries or parameterized native queries with :param bindings via @Param annotations. Never concatenate user input into query strings, as that bypasses the driver's escaping and allows injection.

What password hashing algorithm should Spring Boot use?▼

Use BCrypt or Argon2 through a PasswordEncoder bean, such as new BCryptPasswordEncoder(12) with cost factor 12. Never store plaintext passwords or use manual hashing outside the encoder abstraction.

Why is wildcard CORS configuration dangerous in production?▼

Wildcard allowed origins (*) let any website make credentialed requests to your API, enabling cross-site data theft. Configure CORS at the security filter level with an explicit origin list, restricted methods, and credentials only where needed.