Description
Miantang/IoT-PHP's index.php implements a POST /userlogin route that reads the password directly from $_POST['pwd'] with no sanitization and concatenates it into a raw SQL string: mysql_query("select * from userlists where username='$username' and password='$password' limit 1"). The username value is passed through htmlspecialchars(), which does not encode single quotes by default and therefore does not prevent SQL injection through the password field. An unauthenticated attacker can submit a payload such as pwd=' OR '1'='1 to bypass authentication and, via UNION-based injection, extract arbitrary data from the database.
Published: 2026-08-05
Score: 9.8 Critical
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

SQL injection in the /userlogin route allows an attacker to bypass authentication and extract database contents. The vulnerability stems from directly concatenating the password, retrieved from POST data, into a SQL query without sanitization. By submitting a payload like pwd=' or '1'='1, an unauthenticated user can gain arbitrary data access and potentially employ UNION-based injections to read any table.

Affected Systems

Miantang:IoT-PHP – all versions containing the index.php login handler. No specific version numbers are listed in the CNA data, so all deployments with this functionality are considered vulnerable.

Risk and Exploitability

The score of 9.8 on the CVSS scale indicates critical severity, and although EPSS is not provided, the lack of any KEV listing does not mitigate the high risk. An attacker can exploit the flaw from any network location that can reach the /userlogin endpoint, requiring only a basic HTTP POST. Successful exploitation grants the attacker full read access to the user database and, with UNION-based injection, arbitrary data extraction.

Generated by OpenCVE AI on August 5, 2026 at 12:26 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Replace the raw SQL query with a parameterized statement or prepared statement that properly escapes user input.
  • Hash and salt passwords stored in the database instead of storing them in plaintext.
  • Implement access controls or authentication mechanisms for the API route to limit unauthenticated access.

Generated by OpenCVE AI on August 5, 2026 at 12:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

References
History

Wed, 05 Aug 2026 11:15:00 +0000

Type Values Removed Values Added
Description Miantang/IoT-PHP's index.php implements a POST /userlogin route that reads the password directly from $_POST['pwd'] with no sanitization and concatenates it into a raw SQL string: mysql_query("select * from userlists where username='$username' and password='$password' limit 1"). The username value is passed through htmlspecialchars(), which does not encode single quotes by default and therefore does not prevent SQL injection through the password field. An unauthenticated attacker can submit a payload such as pwd=' OR '1'='1 to bypass authentication and, via UNION-based injection, extract arbitrary data from the database.
Title Miantang IoT-PHP: Unauthenticated SQL Injection in /userlogin
Weaknesses CWE-89
References
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: TuranSec

Published:

Updated: 2026-08-05T10:56:31.037Z

Reserved: 2026-08-05T10:53:53.175Z

Link: CVE-2026-71237

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-05T12:30:12Z

Weaknesses
  • CWE-89

    Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')