CVE-2020-24913: SQL Injection Vulnerability in qcubed/qcubed
Summary
CVE-2020-24913: qcubed SQL injection vulnerability in profile.php via the strQuery parameter. Affects qcubed/qcubed versions < 3.2. Fixed in 3.2. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
qcubed is an open-source PHP framework that provides a rapid application development environment. It offers a range of features and components to simplify the development process. The vulnerability affects all versions of qcubed, including 3.1.1. The framework includes a profile.php file that is vulnerable to SQL injection attacks when the strQuery parameter is not properly sanitized. This allows an attacker to inject malicious SQL code through a crafted POST request.
Vulnerability Detail
The SQL injection vulnerability in qcubed's profile.php file allows an unauthenticated attacker to access the database by injecting SQL code through a specially crafted POST request. This can lead to unauthorized access, data manipulation, and potentially the compromise of sensitive information stored in the database. The vulnerability has a CVSS score of 9.8, indicating its critical severity.
How To Fix
Minimum fixed version
3.2
This is the first release that contains the fix.
composer require qcubed/qcubed:3.2
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to the latest version is not immediately feasible, a temporary workaround can be implemented by manually sanitizing and validating the strQuery parameter in the profile.php file. This can be done by using prepared statements or parameterized queries to ensure that user input is properly escaped and treated as data rather than executable code. Here is an example of how to use prepared statements in PHP to mitigate the vulnerability:
// Assuming $strQuery contains the user input
$stmt = $pdo->prepare('SELECT * FROM profiles WHERE query = ?');
$stmt->execute([$strQuery]);
$results = $stmt->fetchAll();
Conclusion
The SQL injection vulnerability in qcubed's profile.php file poses a significant risk to the security and integrity of the application. It is crucial to upgrade to qcubed version 3.2 or later to mitigate the vulnerability. If immediate upgrading is not possible, implementing the provided workaround can help protect against potential attacks. For further assistance and support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for qcubed/qcubed →
FAQ
The vulnerability allows an attacker to execute arbitrary SQL queries, potentially leading to unauthorized access, data manipulation, and exposure of sensitive information.
All users of qcubed versions up to and including 3.1.1 are affected by this vulnerability.
No, the vulnerability can be exploited by an unauthenticated attacker.
Yes, the vulnerability has been fixed in qcubed version 3.2 and later.
There are no known instances of this vulnerability being exploited in the wild at the time of this report.
Related vulnerabilities
Recent vulnerabilities recorded for qcubed/qcubed.