springboot-security

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

1|Updated Oct 11, 2025
One-click install
npx skills add https://github.com/ibytechaos/claude --skill springboot-security-ibytechaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: springboot-security
Source: https://github.com/ibytechaos/claude/tree/main/plugins/everything-claude-code/skills/springboot-security
Command: npx skills add https://github.com/ibytechaos/claude --skill springboot-security-ibytechaos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Spring Boot applications often ship with insecure defaults: unvalidated inputs, hardcoded secrets, missing authorization checks, and misconfigured CORS or CSRF. This Skill provides a structured security review checklist with concrete code patterns so you can catch vulnerabilities before release. ## Core Features & Use Cases - Authentication & Authorization Patterns: JWT filter implementation, method-level security with @PreAuthorize, and deny-by-default configuration. - Input & SQL Safety: Bean Validation on DTOs, parameterized queries, and password hashing with BCrypt. - Hardening Guidance: CSRF posture, security headers, CORS restrictions, rate limiting with Bucket4j, secrets management, and dependency CVE scanning. - Use Case: Before releasing a new REST API, run a security review to verify every endpoint has authorization guards, all DTOs are validated, no secrets are committed, and rate limiting protects expensive endpoints. ## Quick Start Review my Spring Boot application for security issues and check that authentication, input validation, and secrets management follow best practices.

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 JWT service, and sets the Authentication in the SecurityContextHolder. Configure the security filter chain as stateless with CSRF disabled for pure token-based APIs.

How to secure Spring Boot REST API endpoints with roles?

Enable method security with @EnableMethodSecurity and annotate endpoints with @PreAuthorize, such as hasRole('ADMIN') or custom expressions like @authz.isOwner(#id, authentication). Follow a deny-by-default policy and expose only the required scopes per endpoint.

Should I disable CSRF in Spring Security for REST APIs?

Disable CSRF only for stateless APIs using Bearer tokens, since CSRF attacks rely on browser cookies. For browser session-based applications, keep CSRF enabled and include the token in forms or request 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 is the best way to store secrets in a Spring Boot application?

Externalize secrets using environment variable placeholders like ${DB_PASSWORD} in application.yml, or integrate Spring Cloud Vault for centralized secret management. Never commit credentials to source control, and rotate tokens and database passwords regularly.

How do I add rate limiting to Spring Boot endpoints?

Use Bucket4j in a OncePerRequestFilter to create per-client-IP buckets with bandwidth limits, such as 100 requests per minute. Return HTTP 429 with an error message when the bucket is exhausted, and log bursts for alerting.