Summary
The Simple Flight Ticket Booking System 1.0 contains a SQL injection vulnerability in the /Adminsearch.php endpoint via the flightno parameter.
An attacker can remotely manipulate database queries by injecting crafted input, potentially leading to data access, corruption, or administrative compromise when the parameter is used in SQL statements without proper sanitization.
Affected context
This vulnerability occurs in the administrative search functionality of the Simple Flight Ticket Booking System, specifically in the /Adminsearch.php script.
It is triggered when user-controlled data in the flightno parameter is incorporated into SQL queries without adequate input validation, parameterization, or escaping.
The issue typically arises in deployments where the web application server has direct access to the backend database and where administrative endpoints are reachable over the network, including potentially from the public internet.
Exploit preconditions
- Attack surface: HTTP requests sent to the /Adminsearch.php endpoint of the web application.
- Required access: Network access to the application; the level of authentication required depends on how the admin interface is exposed and protected in a given deployment.
- Trigger point: Submission of a crafted flightno parameter that is concatenated into a SQL query on the server.
- Why exploitation is possible: The application constructs SQL statements dynamically with untrusted input from flightno and does not consistently use parameterized queries or robust input handling, allowing attackers to alter the structure of the executed SQL.
Why this happens
The underlying bug class is SQL injection (CWE-89), where user-supplied input is embedded directly into SQL statements without using parameterized queries or safe query-building patterns.
In this case, the flightno parameter in /Adminsearch.php is treated as trusted data and concatenated into SQL, allowing attackers to inject SQL syntax such as logical operators, additional clauses, or unioned queries.
This pattern reflects a broader category of improper neutralization of special elements used in output contexts (CWE-74), where the database context is not adequately separated from user-controlled values.
Potential impact
- Retrieval of sensitive information from the database, including customer or booking details.
- Modification or deletion of flight, booking, or user records, which could affect application integrity.
- Creation of new administrative or application accounts stored in the database.
- Potential compromise of database service accounts and escalation to broader system access depending on configuration.
- Disruption of application functionality through tampered or dropped tables.
General mitigation guidance
Effective mitigation focuses on eliminating direct concatenation of untrusted input into SQL and reducing the trust boundary around web-exposed parameters.
Common defensive patterns include:
- Using parameterized queries or prepared statements for all database interactions involving user input.
- Applying strict server-side validation and whitelisting for fields like flight numbers (e.g., enforcing expected formats and lengths).
- Centralizing database access logic to enforce safe query construction patterns consistently.
- Applying least-privilege principles to database accounts so they only have the minimal rights needed for application operations.
- Separating administrative interfaces from public endpoints, for example by restricting access via network controls or dedicated authentication.
How teams detect issues like this
Organizations can detect SQL injection risks through a combination of static, dynamic, and review-based approaches:
- Static analysis rules that flag string concatenation used in SQL queries, especially where variables are sourced from HTTP parameters.
- Code review checklists that require verification of parameterized queries and validation logic for all input-dependent SQL.
- Runtime monitoring or web application firewalls configured to detect common SQL injection patterns in request parameters like flightno.
- Regular security testing, including automated scanners and focused manual testing on search and admin-related endpoints.

