View Issue Details

IDProjectCategoryView StatusLast Update
0035893mantisbtsecuritypublic2025-11-01 07:49
ReporterAmazeng Assigned Todregad  
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Target Version2.27.2Fixed in Version2.27.2 
Summary0035893: CVE-2025-46556: Denial-of-Service (DoS) via Excessive Note Length
Description

A lack of server-side validation for note length in MantisBT allows attackers to permanently corrupt issue activity logs by submitting extremely long notes (tested with 4,788,761 characters). Once such a note is added:

  • The entire activity stream becomes unviewable (UI fails to render).
  • New notes cannot be displayed, effectively breaking all future collaboration on the issue.
Steps To Reproduce
  1. Navigate to any issue in MantisBT.

  2. Add a new note with 4788761 character.

  3. Submit the note.

  4. Observe:

    • The issue’s "Activity" section becomes blank/crashed.

    • Subsequent notes fail to appear in the UI.

TagsNo tags attached.
Attached Files

Relationships

related to 0006398 closeddregad No warning received to indicate NOTE has been truncated on insert into DB 

Activities

dregad

dregad

2025-04-28 13:09

developer   ~0070201

Thanks for the bug report; I confirm the behavior - even worse for me, after submitting the attack bugnote on my dev box, the whole Issue won't render at all.

Please let me know how you would like to be credited for the finding, and also your Github user id so I can add you to the security advisory for review and tests.

Amazeng

Amazeng

2025-04-28 17:37

reporter   ~0070202

Hi dregad,

Thank you for confirming the issue. I’m glad the report was helpful.

For credit, you can attribute the finding to:
Name: Mazen Mahmoud
GitHub ID: TheAmazeng

regards,
Mazen

dregad

dregad

2025-04-29 03:03

developer   ~0070203

Security advisory created https://github.com/mantisbt/mantisbt/security/advisories/GHSA-r3jf-hm7q-qfw5
CVE ID requested.

dregad

dregad

2025-04-30 03:47

developer   ~0070204

CVE-2025-46556 assigned

dregad

dregad

2025-05-04 06:08

developer   ~0070212

Started working on the fix.

To make things simpler, I'm planning to set a hardcoded limit for long text fields. I believe 64K chars would be an acceptable value; for comparison, Jira has a jira.text.field.character.limit setting for this, defaulting to 32767 chars (reference).

I'm not sure it's worth adding a new config option for this - thoughts appreciated @vboctor @atrol.

This should apply to textarea fields, and related back-end functions for: bugnotes, Issue description, steps_to_reproduce and additional_information for sure.

Other fields may be worth considering as well:

  • news.body
  • project.description
  • project_version.description
  • user_profile.description
  • tag.description
  • custom_field.text

Probably not necessary since they are not end-user input (or used by administrator): config.value, filters.filter_string, tokens.value, email.metadata and email.body

atrol

atrol

2025-05-04 15:53

developer   ~0070213

The limit of Azure DevOps is a lot higher.
Getting the following message when trying to add a large note

TF401262: Value of long text field Microsoft.VSTS.TCM.ReproSteps exceeds the maximum allowed length of 1048576.

I'm not sure it's worth adding a new config option for this -

Having a configuration option / function similar to $g_max_file_size / file_get_max_file_size() would be good.
I would introduce it as a global setting, use config_get_global().
I suspect $g_max_file_size uses config_get() just due to historical reasons.

Other fields may be worth considering as well:

To prevent DoS, at least the following fields should be protected, as they can be entered by non-admin / non-manager users.

  • user_profile.description
  • custom_field.text
vboctor

vboctor

2025-05-04 21:12

manager   ~0070215

@dregad I would apply a single limit to all the affected fields you listed. I'm OK with having it as a global config as @atrol suggested (e.g., $g_max_textarea_length). But I'm also OK with not having a config option initially (just a constant) and adding it later if we get feedback that it is needed. I assume the limit will not impact values already in the DB and will only impact new additions.

What I would avoid is spamming configs with a limit per entity.

dregad

dregad

2025-05-05 03:14

developer   ~0070216

Thanks both for your feedback

The limit of Azure DevOps is a lot higher [...] maximum allowed length of 1048576

That's 1 MiB, much too high IMHO, as only 4 notes with this size will be enough to achieve the same DoS attack reported in the original post.

Having a configuration option / function similar to $g_max_file_size / file_get_max_file_size() would be good.
I would introduce it as a global setting, use config_get_global().

OK I will amend my patch to switch from constant to config.

at least the following fields should be protected, as they can be entered by non-admin / non-manager users.

  • user_profile.description
  • custom_field.text

Agreed. Will include those in the patch.

What I would avoid is spamming configs with a limit per entity.

I was definitely not planning to add multiple configs for this, it would not add any value.

Related Changesets

MantisBT: master-2.27 d5cec6bf

2025-05-04 06:17

dregad


Details Diff
Limit size of bugnote text fields

Fixes 0035893
Affected Issues
0035893
mod - bug_actiongroup_add_note_inc.php Diff File
mod - bug_actiongroup_page.php Diff File
mod - bug_reminder_page.php Diff File
mod - bug_update_page.php Diff File
mod - bugnote_add_inc.php Diff File
mod - bugnote_edit_page.php Diff File
mod - core/bugnote_api.php Diff File

MantisBT: master-2.27 c99a4127

2025-05-24 09:51

dregad


Details Diff
Limit size of bug text fields

Description, steps_to_reproduce, additional_information & bugnote_text.

Fixes 0035893
Affected Issues
0035893
mod - bug_report_page.php Diff File
mod - bug_update_page.php Diff File
mod - core/bug_api.php Diff File
mod - core/commands/IssueAddCommand.php Diff File

MantisBT: master-2.27 e9119c68

2025-10-31 03:56

dregad


Details Diff
Restrict size of textarea fields

A lack of server-side validation for note length in MantisBT allows
attackers to permanently corrupt issue activity logs by submitting
extremely long notes. Once such a note is added:

- The entire activity stream becomes unviewable (UI fails to render).
- New notes cannot be displayed, effectively breaking all future
collaboration on the issue.

Fixes 0035893, CVE-2025-46556, GHSA-r3jf-hm7q-qfw5
Affected Issues
0035893
mod - account_prof_edit_page.php Diff File
mod - account_prof_menu_page.php Diff File
mod - admin/check/check_customfields_inc.php Diff File
mod - admin/check/index.php Diff File
mod - bug_actiongroup_add_note_inc.php Diff File
mod - bug_actiongroup_page.php Diff File
mod - bug_change_status_page.php Diff File
mod - bug_reminder_page.php Diff File
mod - bug_report_page.php Diff File
mod - bug_update_page.php Diff File
mod - bugnote_add_inc.php Diff File
mod - bugnote_edit_page.php Diff File
mod - bugnote_update.php Diff File
mod - config_defaults_inc.php Diff File
mod - core/bug_api.php Diff File
mod - core/bugnote_api.php Diff File
mod - core/cfdefs/cfdef_standard.php Diff File
mod - core/commands/IssueAddCommand.php Diff File
mod - core/constant_inc.php Diff File
mod - core/custom_field_api.php Diff File
mod - core/helper_api.php Diff File
mod - core/profile_api.php Diff File
mod - docbook/Admin_Guide/en-US/config/html.xml Diff File
mod - lang/strings_english.txt Diff File
mod - manage_custom_field_edit_page.php Diff File
mod - tests/rest/RestBase.php Diff File
add - tests/rest/RestIssueNotesTest.php Diff File
mod - tests/rest/RestIssueTest.php Diff File
mod - tests/soap/IssueAddTest.php Diff File
mod - tests/soap/IssueNoteTest.php Diff File
mod - tests/soap/SoapBase.php Diff File