/

CVE-2026-55740

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in bus_info.php Ticket System

CVE-2026-55740

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Confidentiality and integrity compromise of database data

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An unauthenticated SQL injection in the bus-ticket application's bus_info.php script allows arbitrary SQL queries to be injected through the busid POST parameter.

When exposed to the internet without additional controls, a remote attacker can read sensitive data from the bus_service database and potentially abuse root-level database access.

Affected context

This vulnerability occurs in the Nur-Alam39 bus-ticket application when bus_info.php is deployed and reachable over HTTP.

The busid parameter supplied via POST is concatenated directly into a SELECT query in a numeric context without input validation or parameterization.

The application uses the MySQL root account with no password to connect to the bus_service database, which amplifies the consequences of any successful injection.

Exploit preconditions

  • Attack surface: Public or internal web endpoint exposing bus_info.php over HTTP.
  • Required access: None; the endpoint is exploitable without authentication.
  • Trigger point: Sending a crafted POST request with a malicious busid value that alters the SQL query structure.
  • Why exploitation is possible: The application constructs SQL by concatenating untrusted input directly into the WHERE clause (id=$busid) without quoting or parameterization, and executes it as root, allowing arbitrary data retrieval via UNION-based injection.

Why this happens

The underlying bug is a classic SQL injection pattern where user-controlled input is directly embedded into an SQL statement.

In this case, busid is treated as a numeric identifier and inserted unquoted into SELECT * FROM bus_info WHERE id=$busid, so attackers can inject additional SQL operators and clauses.

This aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command, where the application fails to separate data from control, does not use prepared statements, and provides overly privileged database credentials.

Potential impact

  • An attacker may read arbitrary data from tables within the bus_service database via UNION-based injection.
  • An attacker could enumerate user records, tickets, schedules, and other sensitive business data.
  • An attacker may infer or extract database schema details and internal configuration data.
  • An attacker could potentially modify or delete data if the query context is extended in related code paths or additional injectable queries exist.
  • The compromise of a root-level database account can enable broader misuse or pivoting to other application components that reuse the same credentials.

General mitigation guidance

Effective mitigation focuses on eliminating string-concatenated SQL and reducing database privilege exposure.

Recommended defensive patterns include:

  • Using parameterized queries or prepared statements for all database interactions, especially for identifier and filter fields.
  • Applying strict server-side validation for numeric parameters like busid, ensuring only expected formats are accepted.
  • Implementing least-privilege database accounts, avoiding use of the MySQL root account for application queries.
  • Centralizing database access logic to enforce consistent parameterization and validation.
  • Implementing generic error handling that avoids exposing detailed SQL errors that assist attackers.

These measures should be applied systematically across the application, not just to the affected endpoint.

How teams detect issues like this

Detection typically combines code-level and runtime approaches:

  • Static analysis rules that flag dynamic SQL construction using string concatenation, especially where variables sourced from $_POST, $_GET, or similar are embedded in queries.
  • Code review checklists that require parameterized queries and prohibit direct interpolation of request parameters into SQL.
  • Database query logging and monitoring for anomalous patterns such as UNION SELECT, unexpected numeric values, or error-inducing payloads.
  • Web application firewalls with rules to detect and block common SQL injection patterns, used as a defense-in-depth layer.
  • Automated security testing (SAST/DAST) integrated into CI pipelines to scan for SQL injection signatures across the codebase.

Sources

SourceLink
github.comgithub.com/Nur-Alam39/bus-ticket
github.comgithub.com/Nur-Alam39/bus-ticket/blob/459cabdbeb99c00225b26e46e3c2c30ae1de7bad/bus_info.php#L14-L16

Frequently asked

questions

Yes. If bus_info.php is accessible over the network, an attacker can exploit the injection remotely by sending crafted HTTP POST requests.

No. The vulnerable parameter is processed before any authentication checks, making the issue exploitable by unauthenticated users.

Replace all string-concatenated SQL with parameterized queries or prepared statements and enforce strict input validation, while also switching the application to use a minimally privileged database account.

Adopt a development standard that forbids dynamic SQL concatenation, require prepared statements in code reviews, enforce least-privilege database credentials, and run automated security scans to catch SQL injection patterns early in the development lifecycle.

Find out what's already
exploitable in your codebase.