/

CVE-2026-71237

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in IoT-PHP Web Login Endpoint

CVE-2026-71237

Received

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Authentication Bypass and Database Disclosure

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

A critical SQL injection vulnerability in Miantang/IoT-PHP allows unauthenticated attackers to influence the password value used by the user login query. Under the affected login flow, an attacker may bypass authentication and could extract arbitrary database information through crafted SQL input.

Affected context

The vulnerability occurs in the POST /userlogin route when the application constructs a SQL query from request parameters. The password field is incorporated into the query without effective parameterization or equivalent escaping, while the limited handling applied to the username does not protect the password expression. Deployments that expose this login route and connect it to a database may be at risk.

Exploit preconditions

  • Attack surface: HTTP POST /userlogin endpoint
  • Required access: No authentication is generally required to submit login requests
  • Trigger point: Processing of the pwd request parameter during authentication
  • Why exploitation is possible: User-controlled input is concatenated into a raw SQL statement, allowing submitted data to alter query logic
  • Required backend condition: The application must process the request through the vulnerable database query path

Why this happens

The root cause is the construction of a SQL statement by concatenating untrusted request data into a query string. This insecure pattern allows input to modify the intended SQL expression instead of being treated solely as a password value. The issue maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, commonly known as SQL injection.

Potential impact

  • An attacker may bypass application authentication
  • Sensitive records and database metadata could be disclosed
  • Database contents may be modified or deleted, depending on account privileges
  • Other application functions relying on the compromised database could be affected
  • Credentials, session data, or personal information may be exposed

General mitigation guidance

Mitigation generally focuses on ensuring that user input cannot alter SQL structure and that database access is narrowly privileged.

Common defensive patterns include:

  • Use parameterized queries or prepared statements for every request value
  • Avoid building SQL commands through string concatenation
  • Apply allowlist validation appropriate to each field without treating validation as a substitute for parameterization
  • Use a database account with only the permissions required by the login operation
  • Keep authentication comparisons within well-defined data-access abstractions
  • Avoid returning detailed database errors or query behavior to clients
  • Enforce secure defaults through shared database libraries and application policies

How teams detect issues like this

Organizations can identify similar issues through:

  • Static analysis rules that flag request parameters concatenated into SQL strings
  • Code review checks for raw query construction in authentication and search handlers
  • Dynamic testing that submits boundary characters and verifies that query structure cannot be influenced
  • Database activity monitoring for unexpected authentication-query patterns, errors, or unusual read volume
  • Policy enforcement requiring prepared statements or approved data-access APIs
  • Neutral automated code-review tools that identify unsafe data flows from HTTP input to database execution

Sources

SourceLink
github.comgithub.com/Miantang/IoT-PHP

Frequently asked

questions

Yes. If the vulnerable login route is reachable over the network, an unauthenticated user may submit HTTP requests that reach the unsafe SQL construction.

Typically no. The affected route processes login input before successful authentication, although network access controls or deployment-specific routing may limit exposure.

Use parameterized queries or prepared statements so password input is always handled as data rather than SQL syntax. Pair this with least-privilege database permissions.

Standardize secure data-access APIs, prohibit SQL string concatenation with request data, review authentication handlers, and use static and dynamic testing to verify that input cannot change query behavior.

Find out what's already
exploitable in your codebase.