Summary
Projectworlds Car Rental Project 1.0 contains a SQL injection flaw in the book_car.php parameter handler, where the fname argument is incorporated into database queries without proper safeguards.
A remote attacker can manipulate this parameter to interfere with SQL query structure, potentially extracting or modifying data and impacting application integrity, especially given that public exploit code is available.
Affected context
The vulnerability occurs in the Projectworlds Car Rental Project 1.0 application within the book_car.php booking flow.
It is exposed when user-controlled input (specifically the fname parameter) is passed from HTTP requests into SQL queries through the parameter handler without adequate input validation, encoding, or use of parameterized statements.
Environments where the web application has direct access to production databases and error details are exposed to clients are at increased risk of impactful exploitation.
Exploit preconditions
- Attack surface: Public or internal web interface that processes requests to
/book_car.php. - Required access: Network-level access to the web server; no prior authentication may be required depending on how booking is implemented.
- Trigger point: Supplying crafted values for the
fnameparameter in HTTP requests so that they are incorporated into SQL statements. - Why exploitation is possible: The parameter handler concatenates or interpolates raw user input into SQL queries without using prepared statements or proper escaping, allowing attackers to alter query logic.
Why this happens
This issue stems from constructing SQL queries by directly embedding user input from the fname parameter into query strings.
Instead of treating input as data, the application blends it with SQL control syntax, which aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
The reference to CWE-74 highlights that untrusted input is not safely neutralized before being used in a downstream interpreter (the SQL engine), representing a classic injection flaw in the parameter handling logic.
Potential impact
- Unauthorized reading of sensitive customer or booking information from the database.
- Modification or deletion of rental records, customer profiles, or transactional data.
- Creation of new accounts or elevation of privileges within the application data model.
- Disruption of application functionality through tampered or corrupted records.
- Potential pivot to server-level compromise if database functions or stacked queries are accessible.
General mitigation guidance
Effective mitigation focuses on treating all external input as untrusted and separating query logic from data.
Recommended defensive patterns include:
- Using parameterized queries or prepared statements for all database operations involving user-controlled input.
- Applying strict server-side validation for fields like
fname, enforcing expected character sets and length limits. - Centralizing database access in a data access layer that prohibits dynamic query concatenation.
- Enforcing least-privilege on the database account used by the application, limiting its ability to perform destructive or administrative operations.
- Implementing generic error handling so database errors are not exposed to clients, reducing the feedback available to attackers.
How teams detect issues like this
High-level detection strategies can include:
- Static analysis rules that flag dynamic SQL construction patterns and direct string concatenation with request parameters (e.g.,
$_GET,$_POST, or equivalent). - Targeted code reviews focusing on the parameter handler and booking-related scripts such as
book_car.php, checking for prepared statement usage and validation routines. - Web application firewall (WAF) policies tuned to detect anomalous or injection-like patterns in parameters such as
fname. - Security testing (SAST/DAST) as part of CI/CD pipelines to automatically identify SQL injection patterns and regression issues in future changes.

