Code review java

From NoorQureshi/security-skills · View interactive version

Code review java is an AI agent skill from the GitHub repository NoorQureshi/security-skills. Security review of Java code — dangerous sinks and Spring pitfalls. Load when reviewing a Java/ Spring codebase/PR, on .java source in scope, or "review this Java". Signals: pom.xml/build.gradle, Spring/Spring Boot, ObjectInputStream, XML parsers, Runtime.exec, JNDI/lookups.

How to use this skill

Skill file

Java / Spring source review

When it applies

Reviewing Java source, most often a Spring/Spring Boot service. Java's biggest hitters are

deserialization, XXE-by-default, and expression-language injection — all high impact and all

grep-able.

Why it works

Several Java APIs are unsafe by default (XML parsers resolve external entities; ObjectInputStream

instantiates arbitrary classes) and frameworks expose powerful expression languages (SpEL/OGNL) that

turn a string into code. Tracing the source to a request parameter or message body confirms reach.

Sinks & patterns (grep, then trace to user input)

types, XMLDecoder, SnakeYAML new Yaml().load, unsafe readValue with type info → RCE gadgets.

setFeature(disallow-doctype)/secure-processing.

(Struts), MVEL; template engines with unescaped output.

Framework specifics

exposed/unsecured Actuator endpoints, @RequestMapping path traversal, permit-all misconfig in

SecurityFilterChain, SpEL in @PreAuthorize.

Method

  1. rg for the sinks; trace to controller params, headers, or message consumers.
  2. Check XML parser factory configuration everywhere XML is read.
  3. Review the Spring Security config for accidental permitAll()/disabled CSRF on state-changing routes.
  4. Confirm with web-deserialization, web-xxe, web-ssrf, or web-command-injection.

Gotchas

References

OWASP Deserialization & XXE cheat sheets; SpEL/OGNL injection research; find-sec-bugs rules.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.