Loading...
Loading...
Run SpotBugs with Find Security Bugs plugin on Java code. Detects injection flaws, XXE, insecure crypto, SSRF, deserialization, and other JVM security bugs.
npx skill4agent add vchirrav/owasp-secure-coding-md sast-spotbugsspotbugs-maven-pluginfindsecbugs-pluginpom.xmlcom.github.spotbugsfindsecbugs-pluginspotbugs -versionmvn spotbugs:check -Dspotbugs.plugins=com.h3xstream.findsecbugs:findsecbugs-plugin:LATEST
mvn spotbugs:spotbugs # generates XML reportspotbugs -textui -effort:max -low \
-pluginList findsecbugs-plugin.jar \
-xml:withMessages -output spotbugs-results.xml \
./target/classes| # | Priority | Category | Bug Type | Class:Line | Finding | Remediation |
|---|----------|----------|----------|------------|---------|-------------|| Bug Pattern | Risk |
|---|---|
| SQL_INJECTION | SQL injection |
| COMMAND_INJECTION | OS command injection |
| XXE_DOCUMENT | XML External Entity |
| INSECURE_COOKIE | Missing Secure/HttpOnly flags |
| WEAK_MESSAGE_DIGEST | Insecure hash (MD5/SHA1) |
| OBJECT_DESERIALIZATION | Unsafe deserialization |
| SSRF | Server-Side Request Forgery |
| PATH_TRAVERSAL | Directory traversal |
| CIPHER_INTEGRITY | Insecure cipher mode |
| HARD_CODE_PASSWORD | Hardcoded credentials |