Severity:

HIGH RISK

(7.3)

SQL Injection in Accounting System 1.0 /viewin_costumer.php

CVE-2026-5150

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Database Compromise and Data Integrity Violation

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

The Accounting System 1.0 application contains a SQL injection vulnerability in the viewin_costumer.php endpoint, where the cos_id parameter is processed unsafely by the Parameter Handler component.

A remote attacker can manipulate this parameter to inject arbitrary SQL queries, potentially accessing or modifying backend database data when the vulnerable code path is invoked.

Affected context

This vulnerability appears in web deployments of the code-projects Accounting System 1.0 where:

  • The viewin_costumer.php page is exposed over HTTP/S
  • The cos_id parameter is passed from user-controlled input (e.g., query string or form data)
  • The application builds SQL queries incorporating cos_id without proper parameterization or strict validation

It is most relevant in environments where the application has direct access to production databases containing customer or financial records.

Exploit preconditions

  • Attack surface: Public or internal web interface exposing viewin_costumer.php.
  • Required access: Network access to the web application; no special privileges are necessarily required beyond the ability to send crafted HTTP requests.
  • Trigger point: Server-side processing of the cos_id parameter by the Parameter Handler within viewin_costumer.php.
  • Why exploitation is possible: The application appears to concatenate untrusted cos_id input directly into SQL statements (or equivalent), without consistently using parameterized queries or robust input validation, enabling attacker-controlled SQL fragments to be executed by the database.

Why this happens

The underlying bug is an instance of CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

The Parameter Handler likely constructs SQL queries using string concatenation or interpolation with the cos_id parameter, treating user input as part of the command rather than as data.

This pattern fails to neutralize SQL metacharacters (such as quotes, comment markers, or logical operators), allowing attackers to alter the structure of queries.

The presence of CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component further reflects that data passed to the database (a downstream component) is not appropriately sanitized or bound, creating a general injection risk.

Potential impact

  • May allow attackers to read sensitive customer or accounting records from the database.
  • Could enable modification or deletion of financial or customer data, impacting integrity.
  • Can permit creation of new accounts or manipulation of authentication data stored in the database.
  • Might allow enumeration of database schema, including table and column names.
  • In some configurations, could be leveraged to execute database-level functions that impact availability or facilitate further compromise.

General mitigation guidance

Effective mitigation focuses on treating all externally supplied parameters as untrusted and ensuring they cannot alter SQL structure:

  • Prefer parameterized queries / prepared statements for all database interactions, binding cos_id as a strictly typed parameter.
  • Apply allowlist validation to identifier-like parameters such as cos_id (e.g., numeric-only checks), rejecting or safely handling unexpected formats.
  • Centralize query construction in a data access layer that enforces parameter binding and forbids ad-hoc string-built SQL.
  • Minimize database privileges for the application account so that, even if a query is abused, the accessible operations and data are constrained.
  • Adopt secure-by-default frameworks or ORM patterns that discourage or block raw query concatenation.

How teams detect issues like this

Organizations can detect and monitor for this class of issue using a combination of code-focused and operational techniques:

  • Static analysis: Configure SAST rules to flag dynamic SQL construction where input-derived variables (e.g., $_GET['cos_id'], $_POST['cos_id']) are concatenated directly into query strings.
  • Code review: During manual review, look for direct use of superglobals or request parameters in SQL, especially in files such as viewin_costumer.php and any shared parameter-handling utilities.
  • Security testing: Use automated scanning tools or targeted penetration tests to probe parameterized endpoints for SQL injection behavior, focusing on error messages, response time anomalies, and content changes.
  • Runtime monitoring: Analyze database logs and application logs for unusual query patterns (e.g., injected operators like OR 1=1, comment sequences, or UNION queries) and correlate them with specific web requests.

Sources

SourceLink
code-projects.orgcode-projects.org/
github.comgithub.com/Xu-Zhihan/CVE/issues/11
vuldb.comvuldb.com/submit/780199
vuldb.comvuldb.com/vuln/354183
vuldb.comvuldb.com/vuln/354183/cti

Frequently asked

questions

Yes. An attacker with network access to the web interface can send crafted HTTP requests targeting the viewin_costumer.php endpoint and manipulate the cos_id parameter.

The description does not mandate authentication, so it may be exploitable from an unauthenticated context if the page is publicly reachable.

In deployments where viewin_costumer.php is behind a login, an attacker would first need valid credentials or another way to access the protected page.

The most robust fix is to refactor all queries using cos_id to rely on prepared statements or parameterized queries and to enforce strict type and format validation on cos_id before it reaches the data access layer.

Adopting a consistent data access abstraction that only allows parameterized queries, combining this with secure coding guidelines, automated static analysis in CI, and periodic security reviews, significantly reduces the chance of new injection flaws being introduced.

Find out what's already
exploitable in your codebase.