Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New configs to restrict access to Export and Print issues #1810

Merged
merged 21 commits into from May 16, 2022

Conversation

dregad
Copy link
Member

@dregad dregad commented May 12, 2022

Add 2 new config options, $g_print_reports_threshold and $g_export_issues_threshold (both defaulting to VIEWER), to restrict access to the mass export functions on view_all_bugs_page.php:

  • CSV and Excel export
  • Print reports

Fixes #22224, #25492

This replaces PR #1021, which I finally got around to reviewing. The code looks good and tested OK with just a minor correction: adding a missing access check in print_all_bug_page_word.php.

Many thanks @MrBricodage for the initial submission and your work on this, with our apologies for taking so long to handle it.

@dregad dregad self-assigned this May 12, 2022
@dregad
Copy link
Member Author

dregad commented May 12, 2022

On second thoughts, considering that the Print Reports functionality can be leveraged to perform DOS attacks, I'll set $g_print_reports_threshold to a safer default of UPDATER, so it is not accessible out of the box by anonymous or self-registered users.

@dregad
Copy link
Member Author

dregad commented May 12, 2022

The last 5 commits are just code cleanup

Bob Le Bricodeur and others added 21 commits May 16, 2022 11:55
Restricts access to export functions.
Display export buttons only if access level is valid
Allow CSV content generation according to new configuration parameter
Allow Excel Export content generation according to new configuration
parameter
Add new configuration option information
according to atrol suggestion during code review
code is readable enough without temp variable
According to atrol suggestion during code review
Based on vboctor comments
Remove help provided in description for 6 configuration options
Add the new option in config file
Use the new configuration option in code
option documented
Considering that the Print Reports functionality can be leveraged to
perform DOS attacks, it is safer to set $g_print_reports_threshold* to
`UPDATER`, so it is not accessible out of the box by anonymous or
self-registered users.
Having the write_bug_rows() function in the middle of the markup makes
the code difficult to read and defeats the purpose of having it a
function in the first place...
@dregad dregad merged commit 20cd415 into mantisbt:master May 16, 2022
@dregad dregad deleted the pr1021 branch May 16, 2022 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants