/

CVE-2022-51034

Severity:

HIGH RISK

(8.2)

SQL Injection (CWE-89) in Tangshan Pingsheng SIM API

CVE-2022-51034

Received

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Database Information Disclosure

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

Tangshan Pingsheng Reservoir Safety Supervision Platform builds through 2022-11-30 contain an unauthenticated SQL injection flaw in the SIM recharge-records service. If the service is reachable, an attacker may use crafted requests to infer database information, such as the database user, version, and name.

Affected context

The issue is described in the simcardId parameter of /WebServices/SIMMaintainService.asmx/GetAllRechargeRecordsBySIMCardId in affected platform builds. It becomes risky when the endpoint is accessible to an attacker and the parameter is incorporated into a database query without effective separation from SQL syntax.

Exploit preconditions

  • Attack surface: The HTTP-accessible SIM maintenance web service
  • Required access: No authentication is described as necessary
  • Trigger point: A POST request to the recharge-records endpoint containing a crafted simcardId value
  • Why exploitation is possible: The parameter is reportedly processed in a way that permits SQL injection, including time-based inference against MSSQL

Why this happens

The underlying bug is SQL injection, mapped to CWE-89: Improper Neutralization of Special Elements used in an SQL Command. The insecure pattern occurs when application data is combined with SQL command text rather than handled as a parameter, allowing input to alter query behavior.

Potential impact

  • An attacker may infer database details, including the database user, version, and name.
  • Further database information could be exposed depending on query permissions and application behavior.
  • Database performance or service availability could be affected by abusive queries.

General mitigation guidance

Defensive approaches focus on keeping input separate from query structure and limiting the consequences of database access:

  • Use parameterized queries or prepared statements rather than composing SQL with request values.
  • Treat request parameters as untrusted and apply suitable type, length, and format validation.
  • Give the application database account only the privileges required for its function.
  • Avoid exposing sensitive database errors or details through service responses.
  • Limit access to the endpoint through appropriate authentication, authorization, and network controls where feasible.

How teams detect issues like this

Review database-access code for request parameters concatenated into SQL and check whether queries consistently use parameter binding. Monitor service and database logs for unusual request patterns, repeated timing differences, and unexpected query activity associated with the recharge-records endpoint. Static analysis and CI policies can flag unsafe query construction and require parameterized database access.

Sources

SourceLink
github.comgithub.com/projectdiscovery/nuclei-templates/blob/main/http/vulnerabilities/other/pingsheng-electronic-sqli.yaml
github.comgithub.com/y1hub/poc_exp/blob/main/20231228%E6%9F%90%E7%94%B5%E5%AD%90%E6%B0%B4%E5%BA%93%E5%AE%89%E5%85%A8%E7%9B%91%E7%AE%A1%E5%B9%B3%E5%8F%B0sql%E6%B3%A8%E5%85%A5/readme.md
github.comgithub.com/zan8in/pxplan/blob/main/goby_pocs/10-13-crack/redteam_20230316121609/CVD-2022-5560.go
vulncheck.comvulncheck.com/advisories/reservoir-safety-supervision-platform-sql-injection-via-simmaintainservice-asmx

Frequently asked

questions

It may be exploitable over the network when the affected web service is reachable; the description reports that authentication is not required.

No authenticated access is described as necessary. The attacker would need to send requests to the exposed endpoint.

Use parameterized queries so the simcardId value is treated as data, not as part of SQL command syntax.

Apply consistent parameter binding, validate inputs, minimize database-account privileges, and include code scanning and query-construction reviews in development workflows.

Find out what's already
exploitable in your codebase.