Summary
A high-severity SQL injection vulnerability in the Online Medicine Delivery System affects the phone-number lookup used by its password recovery interface. A remote attacker may manipulate the submitted phone-number value to alter database queries, potentially exposing or changing data when the endpoint is reachable.
Affected context
The vulnerability occurs in the password recovery interface, specifically in the Customer::find_phone function within /passwordrecover.php. It becomes risky when externally supplied phone-number input is incorporated into a database query without reliable separation between data and SQL syntax.
Exploit preconditions
- Attack surface: Network-accessible password recovery interface
- Required access: Ability to submit requests to the recovery endpoint; prior authentication may not be required
- Trigger point: Processing of the
phonenumberargument byCustomer::find_phone - Why exploitation is possible: The supplied value may influence SQL statement structure if query construction does not safely bind input parameters
Why this happens
The underlying bug is improper neutralization of externally supplied input before it is used in a database query. This maps primarily to CWE-89: SQL Injection, a specific form of CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component. The insecure pattern occurs when application code builds SQL commands from request data instead of treating that data strictly as a bound value.
Potential impact
- An attacker may retrieve unauthorized customer or account information
- An attacker could alter, insert, or delete database records, depending on database permissions
- Password recovery workflows may be manipulated or disrupted
- The application may experience data integrity loss or service availability issues
- Sensitive information could be exposed through database error behavior or query results
General mitigation guidance
Mitigation generally focuses on ensuring that request data cannot become part of SQL command structure.
Common defensive patterns include:
- Use parameterized queries or prepared statements for every database operation
- Apply server-side validation and narrowly defined input formats for phone numbers
- Avoid dynamically assembled SQL and do not rely on escaping alone
- Use database accounts with only the permissions required by password recovery
- Return generic recovery responses and avoid exposing database errors
- Centralize data-access controls so secure query handling is consistent across the application
How teams detect issues like this
Organizations can assess for this weakness through:
- Static analysis rules that identify string concatenation or interpolation in SQL statements
- Code review checks for request parameters passed directly into database APIs
- Dynamic testing of recovery endpoints using non-destructive input variations
- Web application firewall or API policy monitoring for suspicious query-manipulation patterns
- Database audit logging that highlights abnormal query shapes, access volume, or error rates
Automated application-security review tools may help identify unsafe query construction, but findings should be validated against the actual data-access implementation.

