Severity:

HIGH RISK

(7.3)

SQL Injection in FeMiner wms chkuser.php

CVE-2026-1059

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Unauthorized Database Access and Potential Compromise

Severity:

HIGH RISK

(7.3)

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

FeMiner wms contains a SQL injection flaw in /src/chkuser.php where the Username parameter is incorporated into database queries without sufficient sanitization or parameterization.

A remote attacker can manipulate this input to alter SQL logic, which may lead to unauthorized data access, account compromise, or complete database takeover under certain conditions.

Affected context

The vulnerability occurs in FeMiner wms deployments that expose the /src/chkuser.php endpoint and rely on a backend database for user lookup or authentication.

It manifests when the Username parameter supplied by a client is passed into SQL statements without robust input handling or use of prepared statements.

Any environment where this script is reachable over a network and tied to a privileged database account is at elevated risk, especially if database accounts have broad read/write permissions.

Exploit preconditions

  • Attack surface: Remote HTTP(S) access to the /src/chkuser.php functionality.
  • Required access: Ability to send crafted requests containing a controlled Username parameter (no prior authentication necessarily required, depending on deployment).
  • Trigger point: Application code that builds or executes SQL queries in chkuser.php using the Username value directly or via inadequate escaping.
  • Why exploitation is possible: User-controlled data is concatenated into SQL query strings or passed to the database without parameter binding, allowing attackers to inject additional SQL syntax and modify the intended query behavior.

Why this happens

This issue stems from constructing SQL queries by directly embedding the Username parameter into query strings, instead of using parameterized statements or a safe query builder.

The pattern maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where special characters such as quotes and control operators are not correctly handled.

It is also related to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, because the application forwards untrusted input to the downstream database engine without adequate neutralization.

The abstract bug class is: trusting raw user-supplied data as part of executable SQL, effectively merging data and control channels.

Potential impact

  • Bypassing authentication checks by manipulating credential- or user-lookup queries.
  • Reading sensitive data from arbitrary tables, including user records or application configuration, depending on database permissions.
  • Modifying or deleting records, leading to data loss, corruption, or business logic manipulation.
  • Creating or escalating database-level accounts and roles, potentially achieving full database compromise.
  • Using the database as a stepping stone for further attacks, such as writing web shells via SQL functions in misconfigured environments.

General mitigation guidance

Effective mitigation for this class of vulnerability typically focuses on separating data from control in all database interactions and minimizing trust in user input.

Recommended defensive patterns include:

  • Using parameterized queries or prepared statements for all database operations that consume user input, ensuring the Username value is treated purely as data.
  • Adopting an ORM or query builder that enforces parameter binding by default and discourages raw string concatenation.
  • Implementing a centralized input-handling layer that treats identifiers like usernames as strictly constrained data (e.g., length-limited, character-whitelisted).
  • Applying least-privilege to database accounts so that the credentials used by chkuser.php can only perform the minimal required operations (e.g., read-only on specific tables).
  • Implementing defense-in-depth with application-level authorization checks that do not rely solely on database queries being well-formed.
  • Avoiding dynamic SQL where possible; where dynamic behavior is needed, constructing it from fixed, code-defined fragments rather than user-controlled strings.

How teams detect issues like this

Organizations can detect and monitor for SQL injection risk in several ways:

  • Static analysis: Configure SAST tools or custom rules to flag string concatenation or interpolation patterns in SQL query construction, especially in authentication-related code such as chkuser.php.
  • Code review: During manual reviews, specifically inspect database access layers to ensure all user-influenced parameters are bound through prepared statements and not directly embedded into query strings.
  • Runtime monitoring: Use database activity monitoring tools and application logs to detect anomalous queries, such as those containing unexpected SQL keywords or always-true conditions.
  • Security testing: Regularly perform automated and manual penetration testing focused on input vectors like Username, incorporating fuzzing and injection payloads to verify that sanitization and parameterization controls are effective.
  • Policy enforcement: Enforce secure coding guidelines and CI checks that block deployment of code paths where raw user input appears in SQL strings without parameter binding.

Sources

SourceLink
github.comgithub.com/wangchaoxing/CVE/issues/1
vuldb.comvuldb.com/?ctiid.341628
vuldb.comvuldb.com/?id.341628
vuldb.comvuldb.com/?submit.731236

Frequently asked

questions

Yes. As described, an attacker can exploit the issue remotely by sending crafted requests to the exposed /src/chkuser.php endpoint, provided it is reachable over the network.

Typically, only the ability to interact with the application like a normal user (or even as an unauthenticated client, if the endpoint is public) is required. No direct database access is needed, since the attack rides through the application layer.

The most robust approach is to refactor all affected queries to use prepared statements or parameterized queries, ensuring that the Username value is passed as a bound parameter rather than concatenated into SQL strings. In parallel, apply strict input constraints and reduce database privileges for the application account.

Adopting secure coding standards for data access, using frameworks that enforce parameterization by default, integrating static analysis into CI pipelines, and performing regular security-focused code reviews help prevent SQL injection. Training developers on the principle of separating data from control in all interpreter and database interactions is also key.

Find out what's already
exploitable in your codebase.