View Issue Details

IDProjectCategoryView StatusLast Update
0037371mantisbtsecuritypublic2026-11-22 16:11
Reporterkanokwut Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionduplicate 
Product Version2.28.4 
Summary0037371: Custom-field write-access-control bypass via group actions
Description

bug_actiongroup.php case 'CUSTOM' (line 337) writes a custom field via custom_field_set_value() without calling custom_field_has_write_access(). The single-issue path (bug_update.php:404) enforces this correctly. A user who can only VIEW a bug can set any custom field whose access_level_rw is above their level through the group-action endpoint.

This is the only case (1 of 16) in the switch block without an action-specific access check. The code has been this way since the CUSTOM case was added in commit 10a38e166 (2005-01-29), roughly 21 years.

Steps To Reproduce
  1. Install MantisBT with default settings (any DB engine).
  2. As admin: create a custom field (e.g. approval_status) with access_level_rw = MANAGER (70). Link it to a public project. Create a bug in that project and set the field to an initial value.
  3. Self-register a new account (REPORTER=25, the default).
  4. As the REPORTER: attempt to update the field via the single-issue path (bug_update.php) — correctly denied (HTTP 403).
  5. As the same REPORTER:
    • GET bug_actiongroup_page.php?action=customfield<CF_ID>&bug_arr[]=<BUG_ID> — scrape bug_actiongroup_CUSTOM_token
    • POST bug_actiongroup.php with action=CUSTOM, custom_field_id=<CF_ID>, bug_arr[]=<BUG_ID>, customfield<CF_ID>=<PAYLOAD>, and the scraped token
    • The field is written despite the user lacking write access.
Additional Information

Vulnerable code (bug_actiongroup.php:337-349):
case 'CUSTOM':
if( 0 === $f_custom_field_id ) {
throw new ClientException( "Invalid custom field Id", ERROR_GENERIC );
}
$t_form_var = 'customfield' . $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 custom_field_has_write_access() check here
bug_update_date( $t_bug_id );
email_bug_updated( $t_bug_id );
helper_call_custom_function( 'issue_update_notify', array( $t_bug_id ) );
break;

Correct enforcement on the single-issue path (bug_update.php:404):
if( !custom_field_has_write_access( $t_cf_id, $f_bug_id ) ) {
throw new ClientException( "Access denied", ERROR_ACCESS_DENIED );
}

TagsNo tags attached.

Relationships

duplicate of 0037059 closeddregad Bulk Custom-Field Update Bypasses access_level_rw Enforcement 

Activities

dregad

dregad

2026-09-07 08:02

developer   ~0071416

Thanks for the report.

This vulnerability has already been identified by another researcher (see 0037059) so I'm resolving this Issue as duplicate.