Skip to content
Access control Disclosed report Intermediate

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.

Viridian Follow

Originally disclosed on Mozilla

  • 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:

PERL
[% 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:

PERL
[% 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:

  1. Is the User Story field enabled for the bug? (e.g. the component is not on the exclusion list)
  2. Is the caller's account nonzero and the User Story for the bug nonnull?
  3. Can the caller set the User Story for the bug?
PERL
[% 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)
  • Users:
    • Attacker (in the editbugs group)
    • Victim (admin, or otherwise in the insidergroup and editbugs groups of your instance)

(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

  1. 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.
  2. 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").
  3. As Attacker, browse to /show_bug.cgi?id=ID replacing ID with that of Victim's bug from Step 2 and observe the "Access Denied" error.
  4. Now browse to /show_bug.cgi?format=multiple&id=ID&id=ID replacing ID twice 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).

The original report as published on Mozilla's Bugzilla, by Viridian. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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

  1. As the victim, create a new private bug by marking the security checkboxes.
  2. As the victim, edit the bug and set the User Story field to some text.
  3. As the attacker, browse to the bug's normal URL and see an access denied error.
  4. 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.

More by Viridian

View all

4 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.