Skip to main content

Java and Spring

Vulkro finds the endpoints in a Java project, reads the access rules on each one, traces request data across files to dangerous sinks and checks dependencies against the local CVE bundle.

vulkro scan .
vulkro discover . # endpoint map only

What is analysed​

AreaCoverage
Project detectionpom.xml, build.gradle, build.gradle.kts. Spring Boot is detected from org.springframework.boot, spring-boot-starter, spring-web or spring-webmvc
Spring MVC / WebFlux@GetMapping, @PostMapping, @PutMapping, @DeleteMapping, @PatchMapping, @RequestMapping; a class-level base path is joined to the method path
JAX-RS@Path with @GET, @POST, @PUT, @DELETE, @PATCH, @HEAD, @OPTIONS
Access control@PreAuthorize, @PostAuthorize, @Secured, @RolesAllowed, @PermitAll, @DenyAll, SpEL role expressions, and the HttpSecurity filter chain (requestMatchers, antMatchers, mvcMatchers, anyRequest). Feeds the OWASP API Top 10 checks
Taint sources@RequestParam, @PathVariable, @RequestBody, @RequestHeader, @CookieValue, HttpServletRequest, servlet doGet / doPost / doPut / doDelete / service
Cross-file taintCalls are followed by the receiver's declared type to the one project class that can run, so a controller to service to repository flow keeps its full chain (JAVA-TAINT-* rules)
Dependenciespom.xml (properties, <dependencyManagement> and parent POMs in the same repository), gradle.lockfile. No remote BOM import and no transitive resolution. See Dependencies and CVEs

Java detectors​

FamilyFinding IDs
InjectionJAVA-SQLI-001, JAVA-CMDI-001, JAVA-LDAP-001, JAVA-XPATH-001, JAVA-SPEL-001, JAVA-SCRIPT-001, JAVA-JNDI-001, JAVA-REFLECT-001, JAVA-NOSQL-001, JAVA-XSS-001, JAVA-CRLF-001, JAVA-REDIRECT-001, JAVA-SSRF-001, JAVA-REDOS-001
Deserialization and XMLJAVA-DESER-001, JAVA-XXE-001
Crypto and TLSJAVA-CRYPTO-001, JAVA-TLS-001, JAVA-RANDOM-001, JAVA-JWT-001, JAVA-TIMING-001
ConfigurationJAVA-COOKIE-001, JAVA-SECCONF-001, JAVA-ACTUATOR-001, JAVA-CORS-001, JAVA-ERROR-001
Files and bindingJAVA-PATH-001, JAVA-FILEPERM-001, JAVA-TOCTOU-001, JAVA-MASSASSIGN-001

vulkro explain <ID> prints what each one flags and how to fix it.

Example finding​

@GetMapping("/users")
public String find(@RequestParam String name) throws Exception {
try (Connection c = dataSource.getConnection(); Statement st = c.createStatement()) {
ResultSet rs = st.executeQuery("SELECT * FROM users WHERE name = '" + name + "'");
return rs.next() ? rs.getString(1) : "";
}
}
CRITICAL Attacker-controlled request value reaches a JDBC / JPA / Spring / Hibernate SQL
execution sink without parameter binding
CWE-89 SQL injection · proven (admitted)
UserController.java:20
id: java-taint-sql-001:...