/

CVE-2018-25431

Severity:

HIGH RISK

(7.1)

SQL Injection in No-Cms manage_privilege Export Endpoint

CVE-2018-25431

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Information Disclosure via SQL Injection

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

No-Cms 1.0 contains an SQL injection vulnerability in the order_by parameter of the manage_privilege export endpoint, allowing authenticated users to manipulate database queries.

By sending crafted POST requests to /nocms/main/manage_privilege/index/export, an attacker can inject SQL through order_by[0] and potentially extract sensitive data from the underlying database.

Affected context

The vulnerability appears in the privilege management/export functionality of No-Cms 1.0, specifically when handling the order_by parameter in export requests.

It manifests in environments where:

  • The manage_privilege module is enabled and reachable to authenticated users
  • User-controlled request parameters (e.g., order_by[0]) are interpolated directly into SQL queries
  • The underlying database executes dynamically constructed SQL without adequate parameterization or filtering

Exploit preconditions

  • Attack surface: HTTP POST requests to /nocms/main/manage_privilege/index/export
  • Required access: Authenticated access to the No-Cms admin or privilege management interface
  • Trigger point: Processing of the order_by[0] parameter when generating export queries
  • Why exploitation is possible: The application appears to concatenate the order_by value into the SQL statement without proper parameter binding, escaping, or allowlisting, enabling attackers to alter the query structure.

Why this happens

This issue stems from dynamically constructing SQL statements using untrusted input from the order_by parameter.

Instead of using parameterized queries or restricting the ORDER BY clause to a fixed set of allowed columns, the code likely interpolates raw request data into the query string.

This maps directly to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, where lack of proper input handling allows an attacker to inject additional SQL tokens and modify query behavior.

Potential impact

  • Extraction of sensitive data, including user records or privilege information, from the database
  • Enumeration of database schema details (tables, columns) via injected queries
  • Bypassing of application-level access controls if injected queries alter filtering or join conditions
  • Potential pivot to more severe database operations (e.g., writing or deleting data) depending on query context and DB permissions

General mitigation guidance

Mitigation should focus on eliminating direct string concatenation of SQL and treating all client input as untrusted:

  • Use parameterized queries / prepared statements for all database access, including ORDER BY-related logic where supported
  • Restrict sort and filter parameters to a predefined, allowlisted set of column names, mapping user-facing values to internal constants
  • Normalize and validate all user input for structural parameters (e.g., sort columns, sort direction) rather than passing it through directly
  • Apply least-privilege to the database account so that even if a query is abused, its ability to access or modify data is limited
  • Centralize query-building helpers to enforce safe patterns and avoid ad-hoc SQL construction across the codebase

How teams detect issues like this

Detection efforts can combine code-centric review with runtime monitoring:

  • Use static analysis or linters to flag string-based SQL construction that incorporates request parameters (particularly for sorting, filtering, and export functionality)
  • During code review, look for:
  • Direct concatenation of $_POST, $_GET, or framework request variables into SQL
  • Dynamic ORDER BY, LIMIT, or WHERE clauses built from user input without a clear allowlist
  • Add application-level logging around export and privilege-management endpoints to detect anomalous order_by values containing SQL syntax (quotes, comments, logical operators)
  • Incorporate database-side monitoring for unusual query patterns, such as queries containing unexpected concatenations or schema enumeration attempts
  • Consider using Web Application Firewalls (WAFs) or API gateways configured with generic SQL injection signatures as a defense-in-depth layer

Sources

SourceLink
codeload.github.comcodeload.github.com/goFrendiAsgard/No-CMS/zip/master
github.comgithub.com/goFrendiAsgard/No-CMS
exploit-db.comexploit-db.com/exploits/45903
vulncheck.comvulncheck.com/advisories/no-cms-sql-injection-via-order-by-parameter

Frequently asked

questions

Yes. Any attacker who can authenticate to the affected No-Cms instance and reach the manage_privilege export endpoint can attempt exploitation over the network.

It requires authenticated access. The exact role needed depends on how No-Cms is configured, but generally the attacker must be able to access /nocms/main/manage_privilege/index/export.

Replace dynamic SQL string concatenation with parameterized queries, and constrain order_by and similar parameters to a strict allowlist of supported columns and directions mapped to constants.

Adopt a development policy that forbids raw SQL concatenation with user input, centralize secure data-access utilities, enforce input validation and allowlists for structural query parameters, and integrate static analysis and security review into the CI/CD pipeline.

Find out what's already
exploitable in your codebase.