/

CVE-2026-14649

Severity:

HIGH RISK

(7.3)

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

CVE-2026-14649

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Data Integrity and Confidentiality 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

The Online Voting System 1.0 contains a SQL injection flaw in the test_input function within saveVote.php, where voter fields are incorporated into database queries insecurely.

A remote attacker who can submit crafted values for voterName, voterEmail, voterID, or selectedCandidate may manipulate the underlying SQL queries, potentially altering votes or accessing sensitive data.

Affected context

The vulnerability exists in the vote submission workflow of the Online Voting System 1.0, specifically when saveVote.php processes incoming form fields.

It arises when user-supplied values for voterName, voterEmail, voterID, and selectedCandidate are fed into SQL statements without robust parameterization.

This typically affects deployments where the application directly connects to a relational database and treats HTTP request data as trusted input during vote recording.

Exploit preconditions

  • Attack surface: Public-facing web endpoint handling vote submissions (/saveVote.php).
  • Required access: Ability to send HTTP requests to the voting endpoint (e.g., as a normal voter or unauthenticated user, depending on deployment).
  • Trigger point: Submission of specially crafted values in the voterName, voterEmail, voterID, or selectedCandidate parameters.
  • Why exploitation is possible: The test_input routine focuses on superficial input cleaning (e.g., trimming, basic escaping) rather than using parameterized queries or rigorous query separation, allowing attacker-controlled data to be interpreted as SQL syntax.

Why this happens

The core issue is embedding untrusted input directly into SQL query strings without using prepared statements or proper parameter binding.

The test_input function likely implements generic sanitization, such as stripping characters or applying simple escaping, which does not reliably prevent injection when data is concatenated into SQL.

This pattern maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, and is reinforced by CWE-74: Improper Neutralization of Special Elements in Output, since the application fails to clearly separate data from command context.

Potential impact

  • An attacker may read or enumerate sensitive voter records stored in the database.
  • An attacker may modify, delete, or corrupt vote entries, affecting election integrity.
  • An attacker could create or alter user or voter accounts within the database.
  • An attacker may execute additional SQL operations, such as dropping tables, leading to denial of service.
  • In some configurations, database-level SQL injection could pivot to underlying host compromise.

General mitigation guidance

Effective mitigation focuses on eliminating direct string concatenation of input into SQL and reducing trust in all externally supplied data.

Common defensive patterns include:

  • Using parameterized queries or prepared statements for all database operations involving user input.
  • Implementing allowlist validation for fields like voterID and selectedCandidate (e.g., numeric IDs or predefined candidate identifiers).
  • Separating data and commands by avoiding dynamic query construction where possible.
  • Applying least-privilege database accounts so that the application user has only the minimal permissions needed (e.g., no schema modification).
  • Centralizing secure database access patterns in a data access layer to make misuse more obvious and easier to review.

How teams detect issues like this

Detection typically combines code-level review and runtime observation:

  • Static analysis rules that flag string concatenation or interpolation of HTTP parameters into SQL statements, especially in saveVote.php and related components.
  • Manual code review focused on the test_input function and all call sites where its output flows into database queries.
  • Application security tests or dynamic scanners configured to send malicious payloads through the voterName, voterEmail, voterID, and selectedCandidate parameters and observe database error responses or behavioral anomalies.
  • CI/CD policies that require prepared-statement usage for all new database access code, enforced via linters or secure coding guidelines.

Sources

SourceLink
code-projects.orgcode-projects.org/
gist.github.comgist.github.com/c4ttr4ck/a29b2238099fa07b4f072c21123b55ef
vuldb.comvuldb.com/cve/CVE-2026-14649
vuldb.comvuldb.com/submit/846330
vuldb.comvuldb.com/vuln/376162
vuldb.comvuldb.com/vuln/376162/cti

Frequently asked

questions

Yes. Any attacker who can reach the voting submission endpoint and send crafted HTTP requests can attempt exploitation, without requiring local system access.

Typically only network access to the web application is required. If the voting page is publicly accessible, a normal user or even an unauthenticated party (depending on configuration) could exploit the flaw.

Refactor all database interactions so that user input is passed exclusively as bound parameters in prepared statements, and avoid constructing SQL queries via string concatenation. Combine this with strict input validation for each field according to its expected format.

Establish secure coding standards that mandate parameterized queries, incorporate automated checks for unsafe SQL construction into the development pipeline, and perform regular security-focused code reviews of database access layers and input-handling routines.

Find out what's already
exploitable in your codebase.