Summary
A SQL injection vulnerability in the CMS administrative database handler allows authenticated administrators to influence a SHOW COLUMNS FROM query through an unsanitized table_name parameter. Depending on database permissions and application behavior, an attacker may enumerate schema details, access system metadata, and extract sensitive credential data through secondary injection paths.
Affected context
The issue occurs in the CMS administrative database functionality, specifically around admin/db_data.php and its handling of the table_name GET or POST parameter. It becomes risky when authenticated administrative input is incorporated into a database statement without strict identifier validation or safe query construction, particularly where the database account can read schema metadata or sensitive application tables.
Exploit preconditions
- Attack surface: Administrative database-management functionality
- Required access: Valid authenticated administrator access, or another account capable of reaching the affected administrative endpoint
- Trigger point: Processing of the
table_nameGET or POST parameter in the database-column inspection operation - Why exploitation is possible: Untrusted input is incorporated into a
SHOW COLUMNS FROMstatement without adequate validation or safe handling of dynamic database identifiers
Why this happens
The underlying bug is improper neutralization of special elements in SQL statements, matching CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). The application treats a request-controlled table identifier as trusted query structure instead of constraining it to an approved set of identifiers or safely separating data from SQL syntax. This can permit boolean-based, time-based, error-based, or metadata-oriented query manipulation.
Potential impact
- An attacker may enumerate database schemas, tables, and columns
- The vulnerability could expose database metadata from sources such as
information_schema - Sensitive application records, including credential-related data, may be disclosed
- Database availability could be affected through expensive or delayed queries
- Compromised data may support account takeover or further administrative abuse
General mitigation guidance
Mitigation generally focuses on ensuring that dynamic database identifiers cannot be supplied directly from untrusted requests.
Common defensive patterns include:
- Restricting table and column names to a server-side allowlist mapped to fixed identifiers
- Using database APIs that safely represent identifiers where dynamic names are necessary
- Avoiding string concatenation when constructing SQL statements
- Applying strict input validation based on expected identifier formats and allowed values
- Limiting the database account to the minimum read and metadata permissions required
- Separating administrative database inspection from access to credential and other sensitive tables
- Returning generic database errors and avoiding detailed query diagnostics in responses
How teams detect issues like this
Organizations commonly detect this class of issue through:
- Static analysis rules for SQL construction involving request parameters
- Code review checks for concatenated GET or POST values in database queries
- Tests that verify dynamic identifiers are allowlisted and rejected when unexpected
- Monitoring for unusual administrative database requests, repeated metadata enumeration, and abnormal query timing
- Database audit policies that alert on unexpected access to schema catalogs or credential-related tables
- Automated security review tools that identify unsanitized input reaching SQL execution APIs

