The vulnerability is a SQL injection that allows bypassing a blacklist in JeecgBoot. The root cause was the failure of the application's security controls to properly parse and inspect the database schema name within SQL queries. This allowed attackers to craft queries targeting sensitive schemas like information_schema and performance_schema, which the existing filters did not detect.
The patch addresses this issue in two key areas:
-
SqlInjectionUtil.java: The methods specialFilterContentForOnlineReport and specialFilterContentForDictSql, which are responsible for sanitizing SQL input, were updated. They now explicitly check for and block the usage of the blacklisted schemas. The absence of this check was the primary vulnerability. During an exploit of the /online/cgreport/head/parseSql endpoint, the specialFilterContentForOnlineReport function would be in the call stack, making it a key runtime indicator.
-
AbstractQueryBlackListHandler.java: The isPass method, which validates queries against a blacklist, was enhanced. The patch updated the underlying SQL parsing library (minidao) and modified isPass to extract and check the database name from the query. Before this fix, the handler was blind to the specific schema being queried, creating a security hole.
By identifying these specific functions, security teams can set up targeted monitoring and profiling to detect exploit attempts. Any invocation of these functions with SQL queries referencing information_schema or performance_schema in vulnerable versions of JeecgBoot should be considered a strong indicator of compromise.