View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017812 | mantisbt | api soap | public | 2014-10-29 15:24 | 2014-12-05 18:33 |
Reporter | edwingozeling | Assigned To | dregad | ||
Priority | urgent | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.2.17 | ||||
Target Version | 1.2.18 | Fixed in Version | 1.2.18 | ||
Summary | 0017812: CVE-2014-8554: SQL injection in SOAP API | ||||
Description | CVE-2014-1609 mentions several SQL injection vulnerabilities. According to https://github.com/mantisbt/mantisbt/commit/7efe0175f0853e18ebfacedfd2374c4179028b3f one of the fixes is in function mc_project_get_attachments of api/soap/mc_project_api.php. Strange enough, line 711 is left untouched: When the project_id parameter of the SOAP-request starts with the integer of a project to which the user (or anonymous) is authorised, the ENTIRE value will become the first item of $t_projects. As this value is concatenated in the SQL statement, SQL-injection becomes possible. Please note that, while the parameter is passed to both project_exists() and mci_has_readonly_access(), both functions convert the parameter to an integer before validating it. The original value will remain unaltered. | ||||
Steps To Reproduce |
| ||||
Additional Information | Some possible values: 1) Return attachments to project 1 only 2) Return attachments to project 1 and 2 3) Return an <SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server With an SQL error as fault string (may vary due to PHP settings) | ||||
Tags | No tags attached. | ||||
Attached Files | 0001-CVE-2014-XXXX-SQL-injection-in-mc_project_get_attach.patch (1,198 bytes)
From bc5078a09cd91ae31738628e3be52554f03841fb Mon Sep 17 00:00:00 2001 From: Damien Regad <dregad@mantisbt.org> Date: Thu, 30 Oct 2014 15:31:36 +0100 Subject: [PATCH] CVE-2014-XXXX: SQL injection in mc_project_get_attachments() This is a follow-up on CVE-2014-1609 / issue #16880. Edwin Gozeling and Wim Visser from ITsec Security Services BV (http://www.itsec.nl) discovered that the fix in #16880 did not fully address the problem. Their research demonstrate that using a specially crafted project id parameter, an attacker could still perform an SQL injection. This patches fixes the problem by typecasting the Project ID parameter to Integer. Fixes #17812 --- api/soap/mc_project_api.php | 1 + 1 file changed, 1 insertion(+) diff --git a/api/soap/mc_project_api.php b/api/soap/mc_project_api.php index 252e31b..c50c947 100644 --- a/api/soap/mc_project_api.php +++ b/api/soap/mc_project_api.php @@ -680,6 +680,7 @@ function mc_project_get_attachments( $p_username, $p_password, $p_project_id ) { return mci_soap_fault_login_failed(); } + $p_project_id = (int)$p_project_id; $g_project_override = $p_project_id; # Check if project documentation feature is enabled. -- 2.1.1 | ||||
For more information, please contact me or my colleague: |
|
Many thanks for the bug report, we'll look into it and get back to you ASAP. |
|
Dear Edwin and Wim, I believe I have fixed the issue you've dicovered. Could you kindly test the attached patch and confirm that it does indeed resolve it ? Thanks in advance PS: with your confirmation, I'll request a CVE ID for the issue (giving you credit for the finding of course). Would you like to review the message before I send it ? |
|
Dear Dregad, the patch does indeed resolve the vulnerability. The implode() within an SQL-statement is used more often in the code, are the other instances validated as well? A quick search
|
|
CVE-2014-8554 was assigned as part of duplicate issue 0017823 |
|
MantisBT: master-1.2.x 99ffb0af 2014-10-30 06:31 Details Diff |
SQL injection in mc_project_get_attachments() This is a follow-up on CVE-2014-1609 / issue 0016880. Edwin Gozeling and Wim Visser from ITsec Security Services BV (http://www.itsec.nl) discovered that the fix in 0016880 did not fully address the problem. Their research demonstrate that using a specially crafted project id parameter, an attacker could still perform an SQL injection. The same issue was also reported by Paul Richards in issue 0017823. This patch fixes the problem by typecasting the Project ID parameter to Integer. Fixes 0017812, CVE-2014-8554 |
Affected Issues 0016880, 0017812, 0017823 |
|
mod - api/soap/mc_project_api.php | Diff File | ||
MantisBT: master 5faf97ab 2014-10-30 06:31 Details Diff |
SQL injection in mc_project_get_attachments() This is a follow-up on CVE-2014-1609 / issue 0016880. Edwin Gozeling and Wim Visser from ITsec Security Services BV (http://www.itsec.nl) discovered that the fix in 0016880 did not fully address the problem. Their research demonstrate that using a specially crafted project id parameter, an attacker could still perform an SQL injection. The same issue was also reported by Paul Richards in issue 0017823. This patch fixes the problem by typecasting the Project ID parameter to Integer. Fixes 0017812, CVE-2014-8554 |
Affected Issues 0016880, 0017812, 0017823 |
|
mod - api/soap/mc_project_api.php | Diff File |