/

CVE-2026-105166

Severity:

HIGH RISK

(7.3)

SQL Injection (CWE-89) in Food Waste Management System

CVE-2026-105166

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Unauthorized database access and data manipulation

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

A high-severity SQL injection vulnerability in the Food Donation Form allows remotely supplied input in the image-choice argument to influence database queries. An attacker who can reach the donation form may be able to read, alter, or otherwise manipulate application data when input is incorporated into SQL without adequate parameterization.

Affected context

The vulnerability occurs in the insert function of fooddonateform.php, which processes submissions from the Food Donation Form. It becomes risky when the remotely supplied image-choice value is included in database operations without being treated strictly as data, and when the application database account has broader permissions than required.

Exploit preconditions

  • Attack surface: The remotely accessible Food Donation Form
  • Required access: Ability to submit requests to the affected form; authentication requirements depend on deployment configuration
  • Trigger point: Processing of the image-choice argument by the insert function in fooddonateform.php
  • Why exploitation is possible: User-controlled input can affect SQL statement interpretation when query construction does not use reliable parameter binding

Why this happens

The underlying bug is an injection flaw in which externally controlled form data is combined with SQL syntax or passed to a database operation without sufficient separation between code and data. This maps primarily to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection). The broader CWE-74 classification reflects the unsafe handling of input that changes the meaning of an interpreted command.

Potential impact

  • An attacker may read sensitive records from the application database
  • An attacker could modify, delete, or corrupt donation and user data
  • The vulnerability may enable unauthorized database actions through the application's privileges
  • Exposed records could contribute to privacy violations or further attacks
  • Database disruption could affect food donation workflows and application availability

General mitigation guidance

Mitigation generally focuses on ensuring that all database operations treat request values as data rather than executable query syntax.

Common defensive patterns include:

  • Use parameterized queries or prepared statements for every database operation
  • Apply allowlist validation for fields with a limited set of valid values
  • Avoid building SQL statements through string concatenation
  • Use a database account with only the permissions required by the application
  • Add consistent server-side validation rather than relying on client-side controls
  • Limit database exposure and protect sensitive records through appropriate access controls
  • Return generic error messages so database details are not disclosed

How teams detect issues like this

Organizations can identify similar issues through:

  • Static analysis rules that flag SQL string concatenation involving request parameters
  • Code review checks for direct use of form, query-string, or cookie values in database calls
  • Dynamic testing of form inputs with harmless SQL metacharacters and error-based indicators
  • Runtime monitoring for anomalous queries, repeated database errors, and unusual record access
  • Policy enforcement requiring prepared statements or approved database abstraction layers
  • Automated security scanning and code-review tools configured to detect injection patterns

Sources

SourceLink
github.comgithub.com/kishor-23/food-waste-management-system/
github.comgithub.com/kishor-23/food-waste-management-system/issues/6
vuldb.comvuldb.com/cve/CVE-2026-105166
vuldb.comvuldb.com/submit/970270
vuldb.comvuldb.com/vuln/413398
vuldb.comvuldb.com/vuln/413398/cti

Frequently asked

questions

Yes. The affected input is processed through a remotely reachable Food Donation Form, although network exposure and any authentication requirements depend on the deployment.

An attacker generally needs the ability to submit requests to the affected form. They do not necessarily need direct database access because the application performs database operations on their behalf.

Use parameterized queries or prepared statements for all database interactions, validate inputs server-side, and restrict the database account to the minimum required privileges.

Establish secure database-access standards, review request-to-query data flows, enforce approved query APIs in CI, and monitor production systems for abnormal database activity.

Find out what's already
exploitable in your codebase.