CVE-2026-129160 in free-fs
Summary
by MITRE • 11/13/2026
free-fs 2.0.1 through 2.3.1 contains an SQL injection vulnerability in FileShareServiceImpl.getPages, which passes the orderBy parameter of the /apis/share/pages endpoint verbatim into the ORDER BY clause via MyBatis-Flex without a column whitelist. Authenticated users can supply CASE WHEN subquery expressions that use share ordering as a boolean oracle to read arbitrary database contents, such as share codes.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 11/13/2026
The vulnerability identified in free-fs versions 2.0.1 through 2.3.1 represents a critical SQL injection flaw located within the FileShareServiceImpl.getPages method. This component handles requests directed at the /apis/share/pages endpoint and is responsible for retrieving paginated lists of shared files or documents. The root cause lies in how the application processes the orderBy parameter provided by the client. Instead of validating this input against a predefined list of allowed column names, the framework passes the value directly into the SQL query's ORDER BY clause via MyBatis-Flex. This lack of strict validation allows an attacker to inject arbitrary SQL syntax, fundamentally breaking the intended separation between data and code within the database engine.
From a technical perspective, this is classified as CWE-89 Improper Neutralization of Special Elements used in an SQL Command. The specific nature of this vulnerability exploits the flexibility inherent in SQL ORDER BY clauses, which typically accept column names or integer indices to determine sort order. However, because MyBatis-Flex does not enforce a whitelist for these parameters, attackers can bypass standard restrictions by injecting complex expressions. In this particular instance, the attacker utilizes CASE WHEN subquery structures. By carefully crafting boolean conditions within these subqueries, an authenticated user can manipulate the database engine to evaluate arbitrary SQL statements based on whether certain conditions are true or false. This technique effectively turns the sorting mechanism into a blind Boolean-based oracle, allowing for data exfiltration without direct output from the query itself.
The operational impact of this vulnerability is severe due to the authentication requirement and the specific exploitation method employed. While the attacker must be authenticated, which limits the attack surface compared to unauthenticated exploits, it does not mitigate the risk significantly as valid credentials are often obtainable through phishing or credential stuffing attacks. Once authenticated, an adversary can use the boolean oracle technique to read sensitive data from the database incrementally. The primary target mentioned is share codes, but the capability extends to reading any accessible table content within the scope of the database user's privileges. This could lead to unauthorized access to private files, exposure of personal identifiable information, or further lateral movement if other system credentials are stored in the same database schema.
This attack vector aligns with MITRE ATT&CK technique T1059 Command and Scripting Interpreter, specifically SQL injection sub-techniques, as well as T1078 Valid Accounts for initial access and T1005 Data from Local System for exfiltration. The exploitation relies on the attacker's ability to interpret database responses based on boolean logic rather than direct data retrieval, a method often associated with blind SQL injection attacks. This makes detection more challenging for standard intrusion detection systems that may not monitor complex logical queries or subtle timing differences in response times caused by conditional execution.
To mitigate this vulnerability, immediate remediation is required by updating the free-fs software to version 2.3.2 or later where the issue has been addressed. For organizations unable to patch immediately, a temporary workaround involves implementing strict input validation on the server side for all parameters passed to SQL ORDER BY clauses. This should include enforcing a whitelist of allowed column names and rejecting any input that contains special characters such as parentheses, quotes, or keywords like CASE WHEN. Additionally, deploying Web Application Firewalls with rules specifically tuned to detect SQL injection patterns in query string parameters can provide an additional layer of defense. Regular security audits focusing on ORM framework configurations are also recommended to ensure that dynamic sorting features do not introduce similar risks in other parts of the application.