View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0027369 | mantisbt | security | public | 2020-10-01 03:16 | 2021-01-09 16:55 |
Reporter | d3vpoo1 | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | won't fix | ||
Platform | Windows | OS | Windows | OS Version | Windows10 |
Summary | 0027369: Reporter can set the ETA although the field is not visible in the UI | ||||
Description | After enabling the ETA field the reporter can set the | ||||
Steps To Reproduce |
Plain request
Exploit request
Exploit response (I just select the success part)
| ||||
Additional Information |
| ||||
Tags | No tags attached. | ||||
The same thing with Update weird behavior :
I ran diff (default config and to my modified config) |
|
Proposed fix would be to only allow update of the fields defined in $g_bug_report_page_fields.
I can't reproduce this. Could be caused by using a category with an assigned to defined to your admin account. |
|
@vboctor provided the following feedback:
Based on that, I will close this as won't fix as what you reported as a security issue is in fact expected behavior. |
|
For the record, attached is the proposed fix that led to this decision. 0001-Only-update-allowed-fields-when-reporting-issues.patch (2,491 bytes)
From 661c00515842794f56629c1affec195940616784 Mon Sep 17 00:00:00 2001 From: Damien Regad <dregad@mantisbt.org> Date: Sun, 22 Nov 2020 12:03:52 +0100 Subject: [PATCH] Only update allowed fields when reporting issues Prior to this, users were able to update fields that are not available in bug_report_page.php ($g_bug_report_page_fields). Fixes #27369 --- core/commands/IssueAddCommand.php | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/core/commands/IssueAddCommand.php b/core/commands/IssueAddCommand.php index e3b5e45b9..fe8607259 100644 --- a/core/commands/IssueAddCommand.php +++ b/core/commands/IssueAddCommand.php @@ -161,6 +161,10 @@ class IssueAddCommand extends Command { 'User does not have access right to report issues', ERROR_ACCESS_DENIED ); } + + # Making sure we're not setting any fields that are not available + # due to config settings. + $this->exclude_unavailable_fields( $t_issue ); $t_handler_id = isset( $t_issue['handler'] ) ? mci_get_user_id( $t_issue['handler'] ) : NO_USER; $t_priority_id = isset( $t_issue['priority'] ) ? mci_get_priority_id( $t_issue['priority'] ) : config_get( 'default_bug_priority' ); @@ -505,5 +509,50 @@ class IssueAddCommand extends Command { } return $t_tag_id; } + + /** + * Remove unavailable fields from the payload. + * + * Remove from the Issue payload the fields that are not available in report + * issue context based on configuration. + * @see $g_bug_report_page_fields + * + * @param array $t_issue + */ + private function exclude_unavailable_fields( array &$t_issue ) { + $t_available_fields = array_merge( + columns_filter_disabled( config_get( 'bug_report_page_fields' ) ), + array( 'custom_fields', 'profile' ) + ); + + foreach( array_keys( $t_issue ) as $t_field ) { + # Mapping fields names from payload to config when different + switch( $t_field ) { + case 'additional_information': + $t_field = 'additional_info'; + break; + case 'files': + $t_field = 'attachments'; + break; + case 'category': + $t_field = 'category_id'; + break; + case 'os_build': + $t_field = 'os_version'; + break; + case 'build': + $t_field = 'product_build'; + break; + case 'version': + $t_field = 'product_version'; + break; + } + + # Remove the field + if( !in_array( $t_field, $t_available_fields ) ) { + unset( $t_issue[$t_field] ); + } + } + } } -- 2.25.1 |
|