View Issue Details

IDProjectCategoryView StatusLast Update
0037059mantisbtsecuritypublic2026-11-22 16:08
Reporterninjasec Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.0.0 
Target Version2.29.0Fixed in Version2.29.0 
Summary0037059: Bulk Custom-Field Update Bypasses access_level_rw Enforcement
Description

The bulk group-action handler bug_actiongroup.php processes action=CUSTOM (custom-field update) without verifying that the actor has write access to the targeted field. The normal single-bug update path (bug_update.php) calls custom_field_has_write_access() and aborts with ERROR_ACCESS_DENIED if the check fails. The bulk path skips this check entirely, allowing any user who can VIEW a bug to overwrite the value of any custom field - including those restricted to higher access levels - on any bug they can view.

Steps To Reproduce

Preconditions:
At least one custom field CF-A must be linked to the project with access_level_rw ≤ the actor's access level (so the actor can get a valid bug_actiongroup_CUSTOM CSRF token).
A second custom field CF-B must be linked to the same project with access_level_rw higher than the actor's access level.

  1. Configure project with two custom fields:
    CF-A: access_level_rw=25 (reporter-writable)
    CF-B: access_level_rw=70 (manager-only)
  2. Authenticate as a reporter-level user.
  3. Load bug_actiongroup_page.php?action=customfield<CF-A-id>&bug_arr[]=<bug-id> to get a valid bug_actiongroup_CUSTOM CSRF token.
  4. Submit a forged POST to bug_actiongroup.php:
POST /bug_actiongroup.php
action=CUSTOM
bug_actiongroup_CUSTOM_token=<token>
custom_field_id=<CF-B-id>
custom_field_<CF-B-id>=<injected-value>
bug_arr[]=<bug-id>
  1. Observe the write succeeds and CF-B is updated on the target bug.
Additional Information

Severity:
Medium

Type:
Authorization bypass (privilege escalation via bulk action)

Affected code:
bug_actiongroup.php lines 334-346 (case 'CUSTOM':)
Compare: bug_update.php lines 371-373

Why it happens:
bug_actiongroup.php CUSTOM case:

case 'CUSTOM':
    if( 0 === $f_custom_field_id ) {
        trigger_error( ERROR_GENERIC, ERROR );
    }
    $t_form_var = 'custom_field_' . $f_custom_field_id;
    $t_custom_field_value = gpc_get_custom_field( $t_form_var, $t_custom_field_def['type'], null );
    custom_field_set_value( $f_custom_field_id, $t_bug_id, $t_custom_field_value );
    // ... no access check
    break;

custom_field_set_value() does not check access_level_rw - it only validates the value format and writes directly to the database.

The single-bug update path (bug_update.php) does enforce it:

if( !custom_field_has_write_access( $t_cf_id, $f_bug_id ) ) {
    trigger_error( ERROR_ACCESS_DENIED, ERROR );
}

Additionally, the CSRF token for all CUSTOM bulk actions is keyed to bug_actiongroup_CUSTOM regardless of which custom field is targeted. A user who legitimately has write access to any low-access custom field can obtain this token and then reuse it in a forged request targeting a higher-access field.

The UI in core/bug_group_action_api.php line 317 does filter the dropdown to only show fields the user has write access to, but this is a client-side gate with no corresponding server-side enforcement.

Impact:
A reporter or updater can modify the value of manager-only custom fields on any bug they can view.
Depending on field usage (e.g., internal classifications, SLA tier, security flag), this can cause direct data integrity harm.
The normal single-bug update path rejects the same operation with ERROR_ACCESS_DENIED.

TagsNo tags attached.

Relationships

has duplicate 0037371 closeddregad Custom-field write-access-control bypass via group actions 

Activities

dregad

dregad

2026-09-07 08:05

developer   ~0071417

Last edited: 2026-09-09 03:45

Issue has been independently confirmed by another security researcher (@kanokwut, see 0037371).

dregad

dregad

2026-10-03 11:49

developer   ~0071482

Advisory https://github.com/mantisbt/mantisbt/security/advisories/GHSA-5xh9-366r-7965 created and CVE request sent (on 2026-09-11).

Related Changesets

MantisBT: master 68eb1d3b

2026-09-07 12:29

dregad


Details Diff
Prevent unauthorized bulk custom field update

Add an access check in bug_actiongroup to prevent a user from changing
a custom field's value if updating it is restricted in the definition
(access_level_rw).

Fixes 0037059, GHSA-5xh9-366r-7965
Affected Issues
0037059
mod - bug_actiongroup.php Diff File
mod - bug_actiongroup_page.php Diff File