/

CVE-2026-86160

Severity:

HIGH RISK

(7.3)

SQL Injection (CWE-89) in SourceCodester Online Voting System

CVE-2026-86160

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Database compromise, data manipulation, and potential unauthorized access

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

SourceCodester Online Voting System 1.0 contains a SQL injection vulnerability in the voting deletion endpoint. An attacker who can reach the remote endpoint may manipulate the ID argument to alter database queries, potentially exposing or modifying voting data.

Affected context

The vulnerability occurs in deployments of SourceCodester Online Voting System 1.0 where the /ajax.php?action=delete_voting endpoint is accessible over the network. Risk exists when the endpoint incorporates the supplied ID argument into a database query without sufficient parameterization or input validation.

Exploit preconditions

  • Attack surface: The remotely accessible /ajax.php?action=delete_voting application endpoint
  • Required access: Network access to the application; authentication requirements may depend on deployment configuration
  • Trigger point: Processing of the ID argument associated with voting deletion
  • Why exploitation is possible: User-controlled input may influence SQL query construction instead of being handled exclusively as a typed query parameter

Why this happens

The underlying bug is an injection flaw in which externally supplied data can affect the structure or behavior of a database query. If the ID argument is concatenated into SQL or insufficiently constrained before query execution, database syntax can be interpreted as part of the command rather than as data. This maps primarily to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection) and broadly relates to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component.

Potential impact

  • An attacker may read sensitive voting or application data
  • An attacker could modify or delete voting records
  • Database integrity and election-related results may be affected
  • The application may experience unauthorized administrative actions depending on database privileges
  • Sensitive information could be exposed through database query behavior

General mitigation guidance

Mitigation generally focuses on ensuring that database queries treat request values strictly as data.

Common defensive patterns include:

  • Using parameterized queries or prepared statements for all database operations
  • Applying allowlist validation and type checks to identifier fields such as ID
  • Avoiding dynamic SQL construction from request parameters
  • Limiting the database account to only the privileges required by the application
  • Separating administrative deletion functions from broadly reachable endpoints
  • Returning generic database errors that do not disclose query details
  • Enforcing authorization checks independently of input validation

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis rules identifying string concatenation or interpolation in SQL execution paths
  • Code review checks for request parameters passed directly to database APIs
  • Dynamic application testing for unexpected database errors and query behavior
  • Web application firewall or API policy rules monitoring suspicious database-oriented input patterns
  • Logging and alerting for unusual access to deletion endpoints or abnormal query failures

Automated security review tools may help identify unsafe query construction, but findings should be verified against the application's database access patterns.

Sources

SourceLink
github.comgithub.com/lwcc223/CVE/issues/2
vuldb.comvuldb.com/cve/CVE-2026-86160
vuldb.comvuldb.com/submit/895415
vuldb.comvuldb.com/vuln/399285
vuldb.comvuldb.com/vuln/399285/cti
sourcecodester.comsourcecodester.com/

Frequently asked

questions

Yes. The affected endpoint is remotely reachable in deployments where the application is exposed, although authentication and network controls may limit practical exploitability.

An attacker generally needs network access to the application and must satisfy any access controls enforced by the deployment. The key issue is whether attacker-controlled input reaches the database query.

Use parameterized queries or prepared statements, validate identifier values by type and allowlist, and enforce authorization separately from input validation.

Apply secure database-access patterns consistently, restrict database privileges, review endpoint handlers for dynamic SQL construction, and use automated static and dynamic testing during development.

Find out what's already
exploitable in your codebase.