Any BMO user with editbugs can view the User Story for any private bug due to edge case in show-multiple.html.tmpl
A user in the editbugs group could view the User Story field of any private bug by loading show_bug.cgi with the multiple format, because the template rendered the User Story outside the permission check. This could reveal confidential information about unreleased products.
- Fixed in 4 days
- Paid in 10 days
- Disclosed after 4 days
Summary
Users in the editbugs group can set the "User Story" field on bugs (and are generally trusted to edit most bug fields), but only on bugs that they have permission to read.
As editbugs users are not admins or part of an insidergroup, by default they will receive an error if they try to view a bug whose visibility is restricted ("private bug").
There however exists an edge case where the User Story for any private bug can be revealed when show_bug.cgi is loaded with the multiple format.
This is likely because in the show-multiple template, the sub-processing block for comments lives outside of the bug.error if-statement, causing it to be rendered even if the bug's error state is NotPermitted:
[% BLOCK bug_display %]
<h1>
# ...
</h1>
<table class="bugfields">
[% IF bug.error %]
# (if the bug is private and the attacker can't see it,
# the NotPermitted error is rendered and we stop here)
[% ELSE %]
# (if the bug is public or the attacker can see it,
# the bug fields are rendered here)
[% END %]
[% Hook.process("last_row", "bug/show-multiple.html.tmpl") %]
</table>
<br>
[% PROCESS bug/comments.html.tmpl
comments = bug.comments %]
# (regardless, the User Story for the bug is rendered here)
[% END %]
The sub-processing block for comments checks for privacy and prevents any comments on the private bug from being returned, but the User Story is a special field called by the comment_banner hook outside of the main processing block:
[% Hook.process("comment_banner") %]
The comment_banner hook returns early if any of the following checks fail, but since we are an editbugs user and the User Story does exist, all checks pass and the User Story is returned:
- Is the User Story field enabled for the bug? (e.g. the component is not on the exclusion list)
- Is the caller's account nonzero and the User Story for the bug nonnull?
- Can the caller set the User Story for the bug?
[% RETURN UNLESS bug.user_story_visible.0 %]
[% RETURN IF user.id == 0 && bug.cf_user_story == "" %]
[% can_edit_story = bug.check_can_change_field('cf_user_story', 0, 1).allowed %]
# (the code after this point fetches and renders the User Story for the bug)
Environment
- Bugzilla version:
- 20221202.1
- Confirmed on:
- Local Docker container (
bmo.test)
- Local Docker container (
- Users:
- Attacker (in the
editbugsgroup) - Victim (admin, or otherwise in the
insidergroupandeditbugsgroups of your instance)
- Attacker (in the
(I could not reproduce this issue on bugzilla-dev.allizom.org because, while I can create security-sensitive bugs on this instance, my test users are not in the editbugs group.)
Steps to Reproduce
- As Victim, create a new bug with the visibility restricted ("private bug"). You can do this by browsing to
/enter_bug.cgi?format=__default__, selecting a product, and then marking the "Security" checkboxes before you submit. - Browse to the newly created bug, select "Edit Bug", and set the "User Story" field to text of your choice (e.g. "this is a User Story on a private bug").
- As Attacker, browse to
/show_bug.cgi?id=IDreplacingIDwith that of Victim's bug from Step 2 and observe the "Access Denied" error. - Now browse to
/show_bug.cgi?format=multiple&id=ID&id=IDreplacingIDtwice with that of Victim's bug from Step 2 and observe that you can view the User Story despite not having access to the underlying bug.
Impact
Any user in the editbugs group can view the User Story associated with any private bug, which in production may reveal the existence and functionality of unreleased Mozilla products (which in turn may be confidential data).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
Any user in the editbugs group could view the User Story of any private bug, potentially revealing confidential information about unreleased products.
What the attacker needed
Attacker in editbugs group; victim creates private bug with User Story
How it was found
- As the victim, create a new private bug by marking the security checkboxes.
- As the victim, edit the bug and set the User Story field to some text.
- As the attacker, browse to the bug's normal URL and see an access denied error.
- As the attacker, browse to the bug's URL with format=multiple and the id parameter repeated, and see the User Story.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Bugzilla is a bug tracking system. Some bugs are marked private so only certain people can see them. The editbugs group can normally edit bugs but should not see private ones. However, a mistake in a web page template meant that when a special view was used, the 'User Story' text of a private bug was shown anyway. This let those users read sensitive information.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.