Summary
Projectworlds Car Rental System 1.0 contains a SQL injection flaw in pay.php where the mpesa parameter is processed without sufficient sanitization.
A remote attacker can send crafted HTTP requests to manipulate database queries, potentially exposing or altering application data and impacting application integrity.
Affected context
The issue occurs in the pay.php script of Projectworlds Car Rental System 1.0 within the parameter handling logic for the mpesa argument.
It typically manifests when user-supplied request parameters are concatenated into SQL queries without reliable input validation or prepared statements.
Any deployment that exposes pay.php over a network and processes untrusted mpesa values may be affected, especially if the database account has broad privileges.
Exploit preconditions
- Attack surface: HTTP interface to pay.php (web-accessible endpoint)
- Required access: Network access to the web application; no prior authentication may be required depending on configuration
- Trigger point: Submission of a crafted mpesa parameter value in the request (GET or POST, depending on implementation)
- Why exploitation is possible: The mpesa parameter is passed into SQL statements without proper neutralization or use of parameterized queries, allowing injected SQL syntax to be interpreted by the database engine.
Why this happens
This vulnerability stems from dynamically building SQL queries using untrusted user input, specifically the mpesa parameter, without adequate neutralization.
This aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection), where attacker-controlled data is embedded directly into SQL.
The reference to CWE-74 indicates that the core pattern is injection of special characters into a downstream interpreter (the SQL engine), caused by mixing data and control instructions in a single string.
In abstract terms, the code likely accepts request parameters, performs little or no validation, and concatenates the mpesa value into a query string before sending it to the database.
Potential impact
- Retrieval of sensitive information from the database (customer details, bookings, payment metadata)
- Modification or deletion of rental records, user accounts, or transaction data
- Creation of new accounts or escalation of privileges within the application's data model
- Disruption of application behavior by corrupting or dropping tables
- Potential pivoting to impact other systems if shared databases or credentials are reused
General mitigation guidance
Risk reduction focuses on separating data from control in database interactions and enforcing strict handling of user input:
- Use parameterized queries or prepared statements so that mpesa and other parameters are always treated as data, never as SQL code.
- Apply strict server-side validation for payment-related parameters, limiting them to expected formats (e.g., numeric or well-defined token patterns).
- Centralize input handling logic with a consistent encoding and validation strategy for all database-bound parameters.
- Apply least-privilege principles to the database account used by the application, restricting it to only the operations required.
- Introduce a secure-by-default data access layer that abstracts query construction away from request-handling code.
How teams detect issues like this
Detection efforts can combine code-centric and behavior-centric approaches:
- Use static analysis tools or linters configured with rules that flag string-concatenated SQL queries and direct inclusion of request parameters in SQL.
- During code review, look for any occurrences where variables derived from $_GET, $_POST, or similar sources are interpolated into query strings.
- Implement runtime application monitoring and logging to detect anomalous SQL patterns (e.g., unexpected use of SQL keywords in parameter values).
- Include SQL injection test cases in automated security testing (DAST) to probe endpoints like pay.php for injection behavior.
- Enforce development policies requiring parameterized queries and input validation for any new database access code.

