Summary
A SQL injection vulnerability in the Folder Management functions of oretnom23 file-management-system-php allows remotely supplied input to influence database queries. An attacker who can reach the affected functionality may be able to read, alter, or interfere with application data, depending on database permissions and query construction.
A SQL injection vulnerability in the Folder Management functions of oretnom23 file-management-system-php allows remotely supplied input to influence database queries. An attacker who can reach the affected functionality may be able to read, alter, or interfere with application data, depending on database permissions and query construction.
Affected context
The weakness occurs in the Folder Management implementation of file-management-system-php, particularly the save_folder, delete_folder, delete_file, file_rename, and save_files functions in admin_class.php. It becomes risky when values such as name, parent_id, id, type, folder_id, or description are incorporated into database queries without reliable parameterization or equivalent query-safety controls. The product uses a rolling release model, so affected deployment states may not correspond to conventional version numbers.
The weakness occurs in the Folder Management implementation of file-management-system-php, particularly the save_folder, delete_folder, delete_file, file_rename, and save_files functions in admin_class.php. It becomes risky when values such as name, parent_id, id, type, folder_id, or description are incorporated into database queries without reliable parameterization or equivalent query-safety controls. The product uses a rolling release model, so affected deployment states may not correspond to conventional version numbers.
Exploit preconditions
- Attack surface: Remotely reachable Folder Management functionality
- Required access: Access sufficient to submit requests to the affected application endpoints; authentication requirements depend on deployment configuration
- Trigger point: Processing of folder or file-management parameters by the affected functions
- Why exploitation is possible: User-controlled values may influence SQL statement structure instead of being treated strictly as data
- Attack surface: Remotely reachable Folder Management functionality
- Required access: Access sufficient to submit requests to the affected application endpoints; authentication requirements depend on deployment configuration
- Trigger point: Processing of folder or file-management parameters by the affected functions
- Why exploitation is possible: User-controlled values may influence SQL statement structure instead of being treated strictly as data
Why this happens
The underlying bug is insufficient separation between application data and SQL command structure. When request-controlled values are concatenated into database queries or otherwise handled without safe parameter binding, SQL metacharacters can change the query's intended meaning. This maps primarily to CWE-89, SQL Injection; CWE-74 broadly describes the failure to neutralize special elements within an interpreted command or data language.
The underlying bug is insufficient separation between application data and SQL command structure. When request-controlled values are concatenated into database queries or otherwise handled without safe parameter binding, SQL metacharacters can change the query's intended meaning. This maps primarily to CWE-89, SQL Injection; CWE-74 broadly describes the failure to neutralize special elements within an interpreted command or data language.
Potential impact
- An attacker may read unauthorized database records.
- An attacker could modify or delete application data.
- Database integrity and file-management metadata may be compromised.
- The application may experience unauthorized administrative actions or denial of service.
- Sensitive information could be exposed, depending on database privileges and application design.
- An attacker may read unauthorized database records.
- An attacker could modify or delete application data.
- Database integrity and file-management metadata may be compromised.
- The application may experience unauthorized administrative actions or denial of service.
- Sensitive information could be exposed, depending on database privileges and application design.
General mitigation guidance
Mitigation generally focuses on ensuring that all database operations use
parameterized queries, prepared statements, or a well-designed data-access
layer that separates values from SQL syntax.
Defensive patterns include:
- Treating every request parameter as untrusted, including values used for identifiers and descriptions.
- Applying allowlist validation and appropriate type constraints before database access.
- Avoiding dynamic SQL where a fixed query or controlled query builder is sufficient.
- Restricting the database account to the minimum permissions required by the application.
- Separating administrative functions from broadly reachable application routes.
- Using secure-by-default error handling that does not disclose query details.
- Retaining database backups and integrity monitoring appropriate to the application's data.
Mitigation generally focuses on ensuring that all database operations use
parameterized queries, prepared statements, or a well-designed data-access
layer that separates values from SQL syntax.
Defensive patterns include:
- Treating every request parameter as untrusted, including values used for identifiers and descriptions.
- Applying allowlist validation and appropriate type constraints before database access.
- Avoiding dynamic SQL where a fixed query or controlled query builder is sufficient.
- Restricting the database account to the minimum permissions required by the application.
- Separating administrative functions from broadly reachable application routes.
- Using secure-by-default error handling that does not disclose query details.
- Retaining database backups and integrity monitoring appropriate to the application's data.
How teams detect issues like this
Detection approaches may include:
- Static analysis for string concatenation, interpolation, or formatting of request values into SQL statements.
- Code review of all Folder Management handlers and shared database helper functions.
- Dynamic testing with benign input variations to identify unexpected query behavior, without using destructive payloads.
- Web application firewall or API policy rules covering anomalous database-oriented input patterns.
- Database monitoring for unusual query shapes, privilege use, bulk access, or unexpected data changes.
- CI policy checks requiring prepared statements or approved data-access abstractions.
Automated code review and software composition tools may help identify recurring SQL construction patterns, but should be combined with manual review.
Detection approaches may include:
- Static analysis for string concatenation, interpolation, or formatting of request values into SQL statements.
- Code review of all Folder Management handlers and shared database helper functions.
- Dynamic testing with benign input variations to identify unexpected query behavior, without using destructive payloads.
- Web application firewall or API policy rules covering anomalous database-oriented input patterns.
- Database monitoring for unusual query shapes, privilege use, bulk access, or unexpected data changes.
- CI policy checks requiring prepared statements or approved data-access abstractions.
Automated code review and software composition tools may help identify recurring SQL construction patterns, but should be combined with manual review.
Sources
| Source | Link |
|---|---|
| github. | github.com/ |
| github. | github.com/ |
| vuldb. | vuldb.com/ |
| vuldb. | vuldb.com/ |
| vuldb. | vuldb.com/ |
| vuldb. | vuldb.com/ |

