Severity:

HIGH RISK

(7.3)

SQL Injection in code-projects CMS /pages.php

CVE-2026-0567

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Data Exposure and Database Compromise

Severity:

HIGH RISK

(7.3)

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

code-projects Content Management System 1.0 contains a SQL injection flaw in /pages.php where the ID parameter is used unsafely in database queries.

An attacker can send crafted requests remotely to manipulate the underlying SQL queries, which may lead to data disclosure, modification, or application compromise when the parameter is not properly validated or sanitized.

Affected context

The vulnerability occurs in code-projects CMS 1.0 within the /pages.php script, where an ID argument influences database lookups.

It typically manifests when user-controlled request parameters (e.g., query string or form fields) are passed into SQL statements without proper escaping, parameterization, or validation.

The issue is more likely to appear in deployments where direct database credentials are configured in the application and there is no additional query firewall or strict least-privilege database role configuration.

Exploit preconditions

  • Attack surface: Public web interface exposing /pages.php
  • Required access: Network access to the web application (no prior authentication necessarily required, depending on route protection)
  • Trigger point: Supplying a crafted ID parameter in HTTP requests that reach /pages.php
  • Why exploitation is possible: The ID argument is incorporated into SQL statements in a dynamic manner, without parameterized queries or robust input validation, allowing attacker-controlled content to alter the structure of the SQL query.

Why this happens

This vulnerability stems from constructing SQL statements by concatenating or directly interpolating user input (the ID parameter) into the query string.

Instead of using parameterized queries or prepared statements, the code likely treats the incoming ID as trusted data, failing to enforce type constraints or sanitize special SQL metacharacters.

This pattern aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), and is related to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, since untrusted input flows into the database layer.

Potential impact

  • Retrieval of sensitive information from database tables the application account can read
  • Modification or deletion of content, including website pages, user data, or configuration records
  • Creation of new accounts or escalation of privileges within the application data model
  • Database service disruption through crafted queries that cause errors or heavy load
  • Potential execution of additional database-native functionality (e.g., file operations, stored procedures) depending on the DBMS and its configuration

General mitigation guidance

Mitigation generally focuses on removing direct string concatenation and treating all external input as untrusted:

  • Use parameterized queries or prepared statements for all database access, binding the ID as a typed parameter rather than embedding it in the SQL string.
  • Apply strict server-side validation for identifier and numeric parameters, enforcing expected formats (e.g., integer-only, whitelisting known values).
  • Centralize database access patterns in a data access layer that consistently enforces safe query construction practices.
  • Configure database accounts with least privilege so the application can only access the minimum required tables and operations.
  • Consider adding an application-level or database-level query firewall or policy engine that can detect anomalous query patterns.

How teams detect issues like this

Detection approaches usually combine code-level and behavior-level analysis:

  • Static analysis: Use linters or SAST tools to flag dynamic SQL construction where request parameters (such as $_GET['ID'] or equivalent) flow into query strings without parameterization.
  • Code review: Look for direct concatenation of request variables into SQL queries in /pages.php and related database helper functions; verify that all queries use prepared statements.
  • Runtime monitoring: Analyze database logs and web access logs for unusual patterns, such as queries containing tautologies, comment operators, or concatenated clauses originating from the ID parameter.
  • Security testing: Incorporate automated DAST or manual penetration testing that systematically tests request parameters to identify injection points in the CMS.

Sources

SourceLink
code-projects.orgcode-projects.org/
github.comgithub.com/Limingqian123/CVE/issues/14
vuldb.comvuldb.com/?ctiid.339379
vuldb.comvuldb.com/?id.339379
vuldb.comvuldb.com/?submit.729229

Frequently asked

questions

Yes. The issue can typically be exploited remotely by sending crafted requests to the /pages.php endpoint, as long as it is reachable over the network and the vulnerable code path is exposed.

Not necessarily. If /pages.php and the affected ID parameter are accessible without logging in, an unauthenticated attacker could attempt exploitation. If access is restricted, the attacker would first need valid credentials or another way to reach that functionality.

The most robust fix is to refactor all affected queries to use parameterized statements or prepared queries, ensuring that untrusted input is bound as data only. Complement this with strict input validation for the ID parameter to enforce the expected data type and range.

Adopting a consistent secure coding standard that mandates parameterized queries, centralizing database access, performing regular security-focused code reviews, and integrating SAST/DAST tools into the development pipeline can significantly reduce the likelihood of future injection flaws.

Find out what's already
exploitable in your codebase.