Severity:

HIGH RISK

(7.3)

SQL Injection in FilePress Shares Filelist API

CVE-2026-8133

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-74, CWE-89

Impact:

Unauthorized Data Access and Modification via SQL Injection

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

FilePress up to version 2.2.0 contains a SQL injection vulnerability in the Shares Filelist API (dzz/shares/admin.php), where the order argument is incorporated into database queries without sufficient sanitization.

A remote attacker can manipulate this parameter to inject arbitrary SQL, potentially accessing or modifying database contents through crafted HTTP requests.

Affected context

The vulnerability occurs within the Shares Filelist API of FilePress when handling requests routed through dzz/shares/admin.php.

It manifests when user-controlled input, particularly the order argument used for sorting or ordering results, is passed into SQL statements without robust validation or whitelisting.

Environments that expose the Shares Filelist API to untrusted clients or the public internet are more susceptible, especially where the application connects to databases containing sensitive or high-value data.

Exploit preconditions

  • Attack surface: HTTP interface of the Shares Filelist API in FilePress.
  • Required access: Remote, unauthenticated or low-privileged access to endpoints that process the order parameter (depending on deployment and access controls).
  • Trigger point: Submission of crafted requests where the order argument contains malicious SQL fragments or unexpected query syntax.
  • Why exploitation is possible: The application concatenates or interpolates the order argument into SQL queries without strict validation, escaping, or whitelisting, allowing attacker-controlled input to alter the structure of the executed query rather than being treated purely as data.

Why this happens

This vulnerability stems from constructing SQL queries using untrusted input for dynamic ordering without enforcing a safe, constrained set of values.

Instead of mapping the order parameter to a predefined list of allowed columns and sort directions, the application allows user-supplied strings to influence the query text directly.

This behavior aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), and may also touch CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, as unsafe data is propagated into the database layer without proper neutralization.

The core pattern is mixing control and data in SQL statements, where parameters influencing query structure are not segregated or normalized before use.

Potential impact

  • An attacker may read sensitive information from database tables beyond what the application normally exposes.
  • An attacker could modify, insert, or delete records, leading to data tampering or loss.
  • Application integrity may be compromised, affecting user accounts, permissions, or configuration data.
  • In some environments, SQL injection could be chained to achieve further compromise, such as writing files or escalating privileges within the database.
  • Logging and auditing data can be altered, undermining incident response and forensics.

General mitigation guidance

Effective mitigation focuses on treating all client-supplied input as untrusted and separating query structure from data:

  • Restrict dynamic ordering to a hard-coded whitelist of allowed columns and sort directions, mapping user-provided tokens to safe internal constants.
  • Use parameterized queries or prepared statements for user-supplied values, ensuring that data is never concatenated directly into SQL strings.
  • Normalize and validate ordering-related inputs by rejecting any value that does not match expected simple identifiers (e.g., predefined field names and ASC/DESC only).
  • Apply least-privilege to the database account used by the application, granting only the minimal set of operations required.
  • Introduce centralized data access layers or ORM abstractions where query-building patterns are reviewed and hardened once, instead of ad hoc SQL assembly across the codebase.

How teams detect issues like this

Detection typically combines code-level analysis with runtime monitoring:

  • Use static analysis rules to flag raw SQL construction that interpolates request parameters (particularly fields like order, sort, or column).
  • During code review, look for patterns where query fragments (e.g., ORDER BY clauses) are built from unsanitized input or where whitelisting is missing or incomplete.
  • Employ application-level security checks that enforce consistent use of parameterized queries and forbid direct concatenation of request parameters into SQL strings.
  • Monitor database logs and web access logs for abnormal query patterns, such as unexpected operators, comment markers, or concatenated expressions in ORDER BY clauses originating from user input.
  • Integrate security-focused automated review tools into CI pipelines to regularly scan for SQL injection patterns and other injection flaws.

Sources

SourceLink
github.comgithub.com/xiaohaiyang-ai/Web-Security-Research/tree/main/FilePress/Shares-API-PreAuth-SQLi
github.comgithub.com/zyx0814/FilePress/
github.comgithub.com/zyx0814/FilePress/commit/e20ec58414103f781858f2951d178e19b1736664
github.comgithub.com/zyx0814/FilePress/issues/70
github.comgithub.com/zyx0814/FilePress/pull/71
vuldb.comvuldb.com/submit/808819
vuldb.comvuldb.com/vuln/361923
vuldb.comvuldb.com/vuln/361923/cti

Frequently asked

questions

Yes. As long as the Shares Filelist API endpoint is reachable over the network and processes attacker-controlled order parameters, a remote attacker can attempt to exploit the SQL injection without local access.

Typically, only the ability to send HTTP requests to the vulnerable endpoint is required. Whether authentication is needed depends on how FilePress is deployed and what access controls are configured around the Shares Filelist API.

The most robust approach is to eliminate direct concatenation of the order argument into SQL and instead map user input to a fixed set of allowed sort options, combined with parameterized queries for all variable parts of the statement.

Establish coding standards that mandate parameterized queries, strict input validation, and whitelisting for any input that influences query structure. Reinforce these standards with automated checks in CI, security-conscious code review practices, and regular security testing focused on injection risks.

Find out what's already
exploitable in your codebase.