Summary
An SQL injection flaw in the Simple Flight Ticket Booking System allows crafted input in the Username POST parameter to manipulate backend database queries.
When user-supplied data is concatenated directly into SQL statements in checkUser.php, a remote attacker can tamper with authentication logic and access or modify data.
Affected context
The issue occurs in the Simple Flight Ticket Booking System 1.0 within the authentication or user lookup logic implemented in checkUser.php.
The vulnerable context involves handling the Username parameter from HTTP POST requests without adequate input validation or query parameterization.
Any deployment that exposes this script over a network and connects it to a relational database backend may be affected, especially when default or sample configurations are used.
Exploit preconditions
- Attack surface: Public or internally exposed web endpoint accepting POST requests to
checkUser.php. - Required access: Network access to the application; no prior authentication is necessarily required if the endpoint is part of the login or user check workflow.
- Trigger point: Submission of a specially crafted
Usernamevalue that is passed directly into an SQL query. - Why exploitation is possible: The application appears to interpolate raw user input into SQL statements without using prepared statements, escaping, or filtering, enabling the attacker to alter query structure.
Why this happens
The underlying bug is improper construction of SQL queries from untrusted input, aligning with CWE-89: Improper Neutralization of Special Elements used in an SQL Command.
In checkUser.php, the Username POST parameter is likely concatenated directly into a query string (e.g., in a WHERE clause) rather than being bound as a parameter.
This insecure pattern allows attacker-controlled characters—such as quotes, comment markers, and logical operators—to change the intent of the SQL command.
The presence of CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component) reflects that database queries are a downstream consumer of improperly sanitized data.
Potential impact
- Bypass of authentication checks by manipulating user lookup or password verification queries
- Unauthorized access to sensitive user or booking records
- Modification or deletion of flight ticket data and related tables
- Extraction of full database contents, including credential hashes and personal information
- Potential platform compromise if chained with other weaknesses (e.g., weak passwords, reused credentials)
General mitigation guidance
Effective mitigation centers on treating all incoming request parameters as untrusted and separating data from SQL logic.
Helpful patterns include:
- Using parameterized queries or prepared statements for all database access operations
- Implementing a central data access layer that disallows ad hoc string-built SQL
- Applying strict server-side validation and normalization of identifiers like usernames, enforcing allowed character sets and lengths
- Minimizing database privileges so that web application accounts have only the operations they strictly need
- Introducing defensive coding guidelines that prohibit dynamic SQL without explicit justification and review
How teams detect issues like this
Detection often combines code-level inspection with behavior monitoring:
- Static analysis rules that flag string concatenation or interpolation involving user input in SQL queries, especially in authentication-related files like
checkUser.php - Manual code reviews focused on data access layers, checking whether all queries use bound parameters and avoiding raw query construction
- Web application firewalls (WAFs) configured with signatures and anomaly detection for SQL injection patterns in parameters such as
Username - Database audit logs or query monitoring to identify anomalous queries, such as those containing unexpected comments, tautologies, or UNION clauses
Automated SAST and DAST tools can help highlight potentially injectable points, but findings should be correlated with code review.

