← All guides

SECURITY COLLECTION

Java / Spring
Secure coding collection

100

JAVA-001SQL injection through JPQL/HQL string concatenationBeginner →JAVA-002JDBC Statement with string concatenationBeginner →JAVA-003MyBatis ${} in value positionsIntermediate →JAVA-004MyBatis ORDER BY ${sort} column injectionIntermediate →JAVA-005MyBatis ${} in LIKE searchesIntermediate →JAVA-006JPA @Query(nativeQuery=true) string concatenationIntermediate →JAVA-007Unvalidated Spring Data Sort input (JPA sorting injection)Intermediate →JAVA-008Wildcard injection in Spring Data method names or @Query LIKEBeginner →JAVA-009Direct entity binding in Spring MVC (mass assignment)Beginner →JAVA-010Exposing entity privilege fields without @Column(updatable)Intermediate →JAVA-011Missing Spring Security method authorization annotationsBeginner →JAVA-012IDOR: looking up by ID without ownership checksBeginner →JAVA-013Path traversal in file downloadsBeginner →JAVA-014Open redirect (redirect: view)Beginner →JAVA-015Spring4Shell (CVE-2022-22965): data binding and class-loader manipulationAdvanced →JAVA-016SpEL injection: evaluating user input as expressionsAdvanced →JAVA-017Thymeleaf server-side template injection (SSTI)Advanced →JAVA-018XSS through user HTML output with Thymeleaf th:utextBeginner →JAVA-019Unescaped JSP output using <%= %>Beginner →JAVA-020Disabling Spring Security CSRF (csrf().disable())Beginner →JAVA-021Overly permissive Spring Security path rules (permitAll abuse)Intermediate →JAVA-022Spring MVC path bypass (semicolon, case and slash variants)Advanced →JAVA-023Exposing all Actuator endpointsBeginner →JAVA-024Unauthenticated Actuator heapdumpAdvanced →JAVA-025Exposing stack traces or exception messagesBeginner →JAVA-026Spring Boot default error page and information disclosure (/error details)Beginner →JAVA-027Java deserialization of untrusted input (ObjectInputStream.readObject)Advanced →JAVA-028Jackson default typing (enableDefaultTyping)Advanced →JAVA-029Missing Jackson deserialization gadget protection (older versions)Advanced →JAVA-030Allowing XML external entities (XXE)Advanced →JAVA-031Default SAXParser/XMLReader settings (XXE)Advanced →JAVA-032Processing untrusted XML with JAXB/UnmarshallerAdvanced →JAVA-033File uploads: checking only extension and Content-TypeBeginner →JAVA-034Using the original uploaded filename (path manipulation)Beginner →JAVA-035Zip Slip: missing extraction-path validationAdvanced →JAVA-036OS command injection (Runtime.exec string concatenation)Beginner →JAVA-037SSRF: server requests a user-provided URLAdvanced →JAVA-038Spring Cloud Gateway SpEL-based SSRF/RCE (CVE-2022-22947)Advanced →JAVA-039Log4Shell (Log4j2 JNDI lookup)Advanced →JAVA-040Log injection: logging user-supplied newlinesIntermediate →JAVA-041Logging passwords, tokens or national ID numbersIntermediate →JAVA-042Hashing passwords with MessageDigest (MD5/SHA-1)Beginner →JAVA-043Using ECB mode or DES encryptionIntermediate →JAVA-044Generating tokens with java.util.RandomBeginner →JAVA-045Hardcoded passwords or keysBeginner →JAVA-046Allowing JWT algorithm none or skipping signature verificationAdvanced →JAVA-047Weak JWT signing keys or using a public key as an HMAC key (key confusion)Advanced →JAVA-048Not validating JWT expiry (exp) or audience (aud)Intermediate →JAVA-049Disabling Spring Security session fixation protectionIntermediate →JAVA-050No login-attempt limit (brute force)Intermediate →JAVA-051Plaintext password-reset tokens with no expiryAdvanced →JAVA-052Revealing account existence through different responsesBeginner →JAVA-053Using equals for password comparison (timing)Advanced →JAVA-054Missing Secure, HttpOnly and SameSite on session cookiesIntermediate →JAVA-055Plaintext secrets in configuration files (application.yml)Beginner →JAVA-056Exposed Git directory in static resources or configuration (.git)Intermediate →JAVA-057Debugging or H2 console enabled in productionBeginner →JAVA-058Disabling default Spring Security headersIntermediate →JAVA-059Permissive CORS (* with credentials)Intermediate →JAVA-060Using @RequestBody without input validation (missing Bean Validation)Beginner →JAVA-061No maximum page size (unbounded Pageable)Beginner →JAVA-062Regular expression denial of service (ReDoS)Advanced →JAVA-063Unlimited request body or file sizeBeginner →JAVA-064External API calls without timeouts (resource exhaustion)Intermediate →JAVA-065Swallowing exceptions and missing security eventsIntermediate →JAVA-066Sensitive information in exception messagesIntermediate →JAVA-067Shared mutable state across threads (SimpleDateFormat or global fields)Advanced →JAVA-068Balance updates without pessimistic or optimistic locking (race condition)Advanced →JAVA-069Partial updates due to missing @TransactionalIntermediate →JAVA-070Ignoring @Transactional self-invocationAdvanced →JAVA-071Returning JPA entities directly as JSON: sensitive fields and lazy loadingIntermediate →JAVA-072N+1 queries and excessive exposure through JPA lazy relationshipsIntermediate →JAVA-073Concatenating string property names in JPA Criteria or QueryDSLAdvanced →JAVA-074Misuse of Spring Data @Query SpEL parameter expansionAdvanced →JAVA-075Injecting input into MyBatis <if> OGNL conditionsAdvanced →JAVA-076Unbounded MyBatis <foreach> input arraysIntermediate →JAVA-077Dynamic table names using MyBatis <include>/${}Advanced →JAVA-078Confusing MyBatis #{} and ${} when constructing IN clausesIntermediate →JAVA-079Using LIMIT ${size} in MyBatis mappersIntermediate →JAVA-080Exposing JDBC/MyBatis errors (SQL state)Beginner →JAVA-081Evaluating user input with ScriptEngine or GroovyAdvanced →JAVA-082Using external input for JNDI lookupsAdvanced →JAVA-083Input-driven class loading through reflectionAdvanced →JAVA-084Cryptographically weak session IDs or predictable sequential IDsIntermediate →JAVA-085Creating temporary files with fixed names in /tmpIntermediate →JAVA-086Excessive permissions on sensitive files (world-readable key files)Intermediate →JAVA-087Public object settings in storage such as S3 (Spring Cloud AWS)Intermediate →JAVA-088Missing Content-Disposition on download responses (MIME sniffing)Intermediate →JAVA-089HTTP header injection: raw user input in headersIntermediate →JAVA-090Mixing CSRF tokens with state-changing GET requestsIntermediate →JAVA-091Bypassing two-factor authentication (trusting the OTP-stage session)Advanced →JAVA-092Not using a Spring Security UserDetails password encoder (NoOp)Intermediate →JAVA-093Long-password bcrypt 72-byte truncation and DoS (Argon2/PBKDF2 parameters)Advanced →JAVA-094Weak password policy (length and complexity)Beginner →JAVA-095Ignoring dependency vulnerabilities (no OWASP Dependency-Check)Beginner →JAVA-096Running end-of-life Spring Boot versions (such as unsupported 2.x)Beginner →JAVA-097Default administrator accounts or credentialsBeginner →JAVA-098Allowing the javascript: scheme in input such as email or image URLsIntermediate →JAVA-099Privilege escalation: missing administrator checks on role-change APIsIntermediate →JAVA-100Including development settings and tests in production artifactsBeginner →