Relationship Graph

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

View Issue Details

IDProjectCategoryView StatusLast Update
0037096mantisbtsecuritypublic2026-11-22 16:11
Reportersiunam Assigned Todregad  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionduplicate 
Product Version2.28.1 
Summary0037096: Private Bugnote Files Disclosure via Issue Cloning or Bulk Copying
Description

When a master issue is being cloned by the user, including private bugnotes attachments (bug_report.php line 66), or the user performs bulk issues copying (bug_actiongroup.php line 157), they will ultimately call function file_copy_attachments from core/file_api.php to copy attachments to the destination bug.

In that function, the INSERT SQL query did not insert the value for column bugnote_id. Therefore, all copied attachments will become issue-level instead of bugnote-level, including but not limited to private bugnotes attachments:

function file_copy_attachments( $p_source_bug_id, $p_dest_bug_id ) {
    // [...]
    for( $i = 0;$i < $t_count;$i++ ) {
        // [...]
        $t_query = 'INSERT INTO {bug_file} (
                bug_id, title, description, diskfile, filename, folder,
                filesize, file_type, date_added, user_id, content
            )
            VALUES ( '
            . db_param() . ', ' . db_param() . ', ' . db_param() . ', '
            . db_param() . ', ' . db_param() . ', ' . db_param() . ', '
            . db_param() . ', ' . db_param() . ', ' . db_param() . ', '
            . db_param() . ', ' . db_param() .
            ')';
        db_query( $t_query, array(
            $p_dest_bug_id, $t_bug_file['title'], $t_bug_file['description'],
            $t_new_diskfile_name, $t_new_file_name, $t_file_path,
            $t_bug_file['filesize'], $t_bug_file['file_type'], $t_bug_file['date_added'],
            $t_bug_file['user_id'], $t_bug_file['content']
        ) );
    }
}
Steps To Reproduce
  • Preparations:

    1. Create a new public issue if there's none (By default, private_bug_threshold is set to DEVELOPER. If the attacker already has that threshold, he/she can view any private bugnotes anyway)
    2. Create a private bugnote with any attachment
  • Issue cloning:

    1. Login as any user's account with at least access level "Reporter"
    2. Go to the bug issue that you want to clone (/view.php?id=<issue_id>)
    3. Click button "Clone"
    4. In section "Copy extended data from parent issue", check "Copy attachments"
    5. Click button "Submit Issue"
  • Issues bulk copying:

    1. Login as any user's account with at least access level "Reporter"
    2. Go to page "View Issues" (/view_all_bug_page.php)
    3. Check the issue(s) that you want to perform bulk copy
    4. Select "Copy" and click button "OK"
    5. Click button "Copy Issues"
    6. Go to the copied issue (/view.php?id=<copied_issue_id>)

A Proof-of-Concept video is also attached.

Additional Information

Patch

To patch this vulnerability, it is recommended that the INSERT SQL query should also insert bugnote_id into table {bug_file}:

function file_copy_attachments( $p_source_bug_id, $p_dest_bug_id ) {
    // [...]
    for( $i = 0;$i < $t_count;$i++ ) {
        // [...]
        $t_query = 'INSERT INTO {bug_file} (
                bug_id, title, description, diskfile, filename, folder,
                filesize, file_type, date_added, user_id, content, bugnote_id
            )
            VALUES ( '
            . db_param() . ', ' . db_param() . ', ' . db_param() . ', '
            . db_param() . ', ' . db_param() . ', ' . db_param() . ', '
            . db_param() . ', ' . db_param() . ', ' . db_param() . ', '
            . db_param() . ', ' . db_param() . ', ' . db_param() .
            ')';
        db_query( $t_query, array(
            $p_dest_bug_id, $t_bug_file['title'], $t_bug_file['description'],
            $t_new_diskfile_name, $t_new_file_name, $t_file_path,
            $t_bug_file['filesize'], $t_bug_file['file_type'], $t_bug_file['date_added'],
            $t_bug_file['user_id'], $t_bug_file['content'], $t_bug_file['bugnote_id']
        ) );
    }
}
TagsNo tags attached.
Attached Files
poc.mp4 (1,815,910 bytes)   

Relationships

duplicate of 0037027 closeddregad Clone Issue Copies Hidden Private-Note Attachments Into a Visible Child Issue 

Activities

siunam

siunam

2026-05-02 01:46

reporter   ~0071055

@dregad Any update on this?

dregad

dregad

2026-11-15 11:04

developer   ~0071597

Apologies for the long silence, I've been busy.

This vulnerability has already been identified previously by another security researcher (see 0037027), so I'm closing this issue as duplicate.

You will be co-credited for the finding.

siunam

siunam

2026-11-15 11:43

reporter   ~0071600

Thanks!