java-framework-audit

Detects known vulnerability patterns in Spring, Struts2, Shiro, FastJSON, and MyBatis source code.

1.7k|238|Updated Dec 7, 2019
One-click install
npx skills add https://github.com/wgpsec/AboutSecurity --skill java-framework-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-framework-audit
Source: https://github.com/wgpsec/AboutSecurity/tree/main/skills/code-audit/java/java-framework-audit
Command: npx skills add https://github.com/wgpsec/AboutSecurity --skill java-framework-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Java white-box auditors often miss framework-level flaws because they focus only on business logic. This Skill provides a systematic checklist and detection patterns for the five most frequently exploited Java frameworks and components, so auditors can quickly locate known CVE patterns and framework misuse in source code.

Core Features & Use Cases

  • Framework Vulnerability Detection: Covers Spring (SpEL injection, Actuator exposure, Mass Assignment, Cloud Gateway), Struts2 (OGNL injection, Content-Type parsing), Shiro (RememberMe deserialization, URI bypass), FastJSON/Jackson/Gson (autotype and polymorphic deserialization), and MyBatis (${} SQL injection).
  • CVE Mapping Tables: Maps framework versions to known CVEs (e.g., CVE-2022-22965, S2-045, CVE-2016-4437) so auditors can confirm exploitability from pom.xml versions.
  • Evidence Chain Guidance: Each pattern defines an EVID evidence chain (Source-to-Sink data flow plus version/configuration proof) for audit reporting.
  • Use Case: During a white-box audit of a Spring Boot application, search for management.endpoints.web.exposure.include and SpelExpressionParser usage to identify exposed Actuator endpoints and SpEL injection sinks, then document the full evidence chain.

Quick Start

Audit this Java project's source code for framework-level vulnerabilities in Spring, Shiro, FastJSON, and MyBatis, and report each finding with its evidence chain.

Frequently Asked Questions about java-framework-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Java source code for Spring framework vulnerabilities?

Search for SpEL injection sinks like SpelExpressionParser and parseExpression, check management.endpoints.web.exposure.include for exposed Actuator endpoints, and verify @ModelAttribute bindings use setAllowedFields whitelists. Compare dependency versions against known CVEs such as CVE-2022-22965.

How to detect FastJSON deserialization vulnerabilities in code?

Search for JSON.parseObject or JSON.parse calls processing untrusted input, then check the FastJSON version in pom.xml and whether safeMode or autotype whitelists are configured. Versions before 1.2.83 have known autotype bypass chains.

What is the difference between ${} and #{} in MyBatis?

#{} uses PreparedStatement parameter binding and is safe from SQL injection, while ${} performs direct string concatenation equivalent to String.format. Any ${} usage in Mapper XML or @Select annotations is a SQL injection entry point unless protected by whitelist validation.

Does Shiro RememberMe deserialization still affect newer versions?

Shiro 1.2.4 and earlier ship a hardcoded AES key (CVE-2016-4437), but newer versions remain vulnerable if developers set custom but predictable or leaked cipher keys via setCipherKey. Audit by extracting the key value and comparing against known key dictionaries.

Why do Shiro URI bypass vulnerabilities happen with Spring?

Shiro's URL matching rules differ from Spring's path resolution, so payloads like /admin/;.js or /toLogin;/../admin pass Shiro filters but route to protected Spring endpoints. Audit by comparing ShiroFilterFactoryBean URL mappings against actual Spring routes.

What are the limitations of framework-level source code auditing?

This approach detects known vulnerability patterns and framework misuse but cannot find zero-day flaws in framework internals. It also requires accurate dependency version identification, since CVE applicability depends entirely on exact version numbers in build files.