/

CVE-2018-25422

Severity:

HIGH RISK

(8.2)

SQL Injection in MOGG Web Simulator Script play.php

CVE-2018-25422

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Data Exposure and Arbitrary SQL Execution

Severity:

HIGH RISK

(8.2)

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

The MOGG web simulator Script suffers from an SQL injection vulnerability in the id parameter of play.php, where user input is incorporated into SQL queries without proper sanitization.

An unauthenticated attacker can send crafted GET requests to inject arbitrary SQL commands, potentially extracting sensitive database information such as usernames and other stored data.

Affected context

This vulnerability occurs in deployments of the MOGG web simulator Script that expose the play.php endpoint over HTTP/S and rely on a backend database for storing application data.

It is present when the id parameter from a GET request is passed directly or indirectly into SQL statements without parameterization or robust input validation.

Any environment where database credentials permit reading sensitive tables is at elevated risk, particularly if the application is Internet-facing and does not enforce authentication for accessing play.php.

Exploit preconditions

  • Attack surface: HTTP/S endpoint play.php accessible over the network.
  • Required access: None; exploitation can be performed by unauthenticated users able to send GET requests.
  • Trigger point: The id query parameter is processed by server-side code and concatenated into a SQL statement that is executed by the database.
  • Why exploitation is possible: The application dynamically builds SQL queries using unsanitized user input, lacking prepared statements, proper escaping, or input validation, allowing attackers to alter the intended query structure.

Why this happens

The root cause is the direct inclusion of user-controlled data from the id parameter into SQL queries without using safe query construction mechanisms.

This matches CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where an application fails to neutralize or correctly handle metacharacters such as quotes or operators.

Conceptually, the bug arises from building SQL strings via concatenation or interpolation of untrusted input, allowing attackers to inject additional clauses, UNION queries, or other SQL syntax that the database will execute.

Potential impact

  • Attackers may extract sensitive information such as usernames, email addresses, or other records from database tables.
  • Attackers could enumerate database structure (tables, columns, schemas) to support further attacks.
  • Depending on database privileges, attackers may modify or delete data, impacting integrity and availability.
  • In some environments, attackers could chain SQL injection into broader compromise, such as credential theft and account takeover.

General mitigation guidance

Effective mitigation focuses on building queries in a way that treats user input as data rather than executable SQL.

Common defensive patterns include:

  • Using parameterized queries or prepared statements for all database operations involving user input.
  • Applying strict input validation and whitelisting for parameters like id (e.g., ensuring it is numeric or from a constrained set of values).
  • Implementing centralized database access layers that prohibit ad-hoc string-concatenated SQL.
  • Applying least-privilege to database accounts so that even if injection is attempted, accessible data and operations are minimized.
  • Employing generic error handling that avoids exposing raw SQL errors, reducing useful feedback to attackers during testing of payloads.

How teams detect issues like this

Detection typically combines code-level review with runtime monitoring:

  • Static analysis rules targeting string concatenation in SQL query construction, particularly where variables like $_GET['id'] or equivalent are used directly.
  • Manual code review focusing on database access layers to ensure all queries are parameterized and that no raw input reaches SQL statements.
  • Web application firewalls (WAF) or intrusion detection systems configured to alert on common SQL injection patterns in URL parameters.
  • Logging and monitoring of database queries to detect anomalous patterns such as unexpected UNIONs, tautologies, or schema enumeration queries.

Sources

SourceLink
github.comgithub.com/spider312/mtgas
exploit-db.comexploit-db.com/exploits/45717
vulncheck.comvulncheck.com/advisories/mogg-web-simulator-script-all-version-sql-injection-via-play-php

Frequently asked

questions

Yes. As long as play.php is reachable over the network, an attacker can send crafted GET requests to exploit the SQL injection remotely.

No. The described vulnerability is exploitable by unauthenticated users, since the affected endpoint processes the id parameter without requiring prior login.

The most robust approach is to use parameterized queries or prepared statements for all database interactions, combined with strict input validation that constrains parameters like id to expected formats and ranges.

Adopt secure coding standards that forbid dynamic SQL construction with untrusted input, enforce these standards via code review and automated scanning, and centralize database access through vetted libraries or ORM layers that default to safe query APIs.

Find out what's already
exploitable in your codebase.