Closed Bug 529416 (CVE-2009-3386) Opened 15 years ago Closed 15 years ago

[SECURITY] Dependency lists display bug aliases even for bugs the user cannot access

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

3.3.2
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.4

People

(Reporter: jruderman, Assigned: justdave)

References

()

Details

(Keywords: regression, selenium)

Attachments

(3 files, 7 obsolete files)

https://bugzilla.mozilla.org/show_bug.cgi?id=389014 reveals the alias of the two security-sensitive bugs it blocks :(
Attached patch Patch v1 for 3.4 (obsolete) — Splinter Review
this is already deployed on b.m.o
Assignee: create-and-change → justdave
Attachment #412965 - Flags: review?(mkanat)
Comment on attachment 412965 [details] [diff] [review]
Patch v1 for 3.4

>-    if ($options->{use_alias} && $link_text =~ /^\d+$/ && $bug_alias) {
>+    if ($options->{use_alias} && $link_text =~ /^\d+$/ && $bug_alias && Bugzilla->user->can_see_bug($bug_num)) {

This should go later in the code where we already call can_see_bug().
Attachment #412965 - Flags: review?(mkanat) → review-
This is a regression due to bug 470262. Affects 3.4 and newer.
Depends on: 470262
Flags: blocking3.4.4+
Keywords: regression
OS: Mac OS X → All
Hardware: x86 → All
Target Milestone: --- → Bugzilla 3.4
Version: unspecified → 3.4.3
Summary: Blocks-alias is shown even for bugs the user cannot access → [SECURITY] Dependency lists display bug aliases even for bugs the user cannot access
This has been assigned CVE-2009-3386.
Alias: CVE-2009-3386
(In reply to comment #2)
> (From update of attachment 412965 [details] [diff] [review])
> >-    if ($options->{use_alias} && $link_text =~ /^\d+$/ && $bug_alias) {
> >+    if ($options->{use_alias} && $link_text =~ /^\d+$/ && $bug_alias && Bugzilla->user->can_see_bug($bug_num)) {
> 
> This should go later in the code where we already call can_see_bug().

I was thinking that, but that section of code is dependent on having a status or something, and didn't know how that would affect it, that's why I didn't move it.
Comment on attachment 412965 [details] [diff] [review]
Patch v1 for 3.4

No, actually, this is the right fix. The can_see_bug below is unrelated.

I'd like to create an $user var and re-use it so that we don't have to manually do Bugzilla->user->can_see_bug in both places, but this works OK.
Attachment #412965 - Flags: review+
Flags: approval?
Flags: approval3.4?
Attached patch Patch v2 for trunk (obsolete) — Splinter Review
Attachment #412965 - Attachment is obsolete: true
Attachment #413030 - Flags: review?(mkanat)
Comment on attachment 413030 [details] [diff] [review]
Patch v2 for trunk

>-    if ($options->{use_alias} && $link_text =~ /^\d+$/ && $bug->alias) {
>+    if ($options->{use_alias} && $link_text =~ /^\d+$/
>+        && $bug->alias && $user->can_see_bug($bug)) {

  Tiny stylistic nit: brace goes on the next line aligned with the "i" in "if". (It's perlstyle.)

  I'll test this, but this looks fine.
Attachment #413030 - Flags: review?(mkanat) → review+
Attached patch Patch v2 for 3.4 branch (obsolete) — Splinter Review
Attachment #413031 - Flags: review?(mkanat)
Comment on attachment 413031 [details] [diff] [review]
Patch v2 for 3.4 branch

Same stylistic nit. Also looks fine.
Attachment #413031 - Flags: review?(mkanat) → review+
Attached patch Patch v3 for trunk (obsolete) — Splinter Review
nit addressed (might as well get it right before we commit ;)
Attachment #413030 - Attachment is obsolete: true
Attached patch Patch v3 for 3.4 branch (obsolete) — Splinter Review
Attachment #413031 - Attachment is obsolete: true
Attachment #413033 - Flags: review+
Blocks: 529481
Comment on attachment 413034 [details] [diff] [review]
Patch v3 for 3.4 branch

>+    if ($options->{use_alias} && $link_text =~ /^\d+$/
>+        && $bug_alias && $user->can_see_bug($bug_num))

As I said earlier, this should be moved into the IF block below. All bugs have a bug status. We use it to check if the bug ID points to an existing bug. If the bug doesn't exist, it's undefined, else it exists. No need to call can_see_bug() twice.

>+        if ($user->can_see_bug($bug_num)) {
Attachment #413034 - Flags: review-
Comment on attachment 413033 [details] [diff] [review]
Patch v3 for trunk

The same comment applies here too.
Attachment #413033 - Flags: review-
Flags: approval?
Flags: approval3.4?
Actually, I think the patch as justdave wrote it is more readable, and there's no performance penalty for calling can_see_bug multiple times.
Comment on attachment 413034 [details] [diff] [review]
Patch v3 for 3.4 branch

LpSolit pointed out that in this version we're calling can_see_bug before verifying that the bug exists, so this one indeed should have a different patch.
Attachment #413034 - Flags: review-
Attached patch Patch v4 for trunk (obsolete) — Splinter Review
Attachment #413033 - Attachment is obsolete: true
Attachment #413182 - Flags: review?(mkanat)
Attachment #413182 - Attachment description: Patch v5 for trunk → Patch v4 for trunk
Attached patch Patch v4 for 3.4 branch (obsolete) — Splinter Review
Attachment #413034 - Attachment is obsolete: true
Attachment #413183 - Flags: review?(mkanat)
Attachment #413182 - Attachment is obsolete: true
Attachment #413185 - Flags: review?(mkanat)
Attachment #413182 - Flags: review?(mkanat)
Attachment #413183 - Attachment is obsolete: true
Attachment #413186 - Flags: review?
Attachment #413183 - Flags: review?(mkanat)
Version: 3.4.3 → 3.3.2
Comment on attachment 413186 [details] [diff] [review]
Patch v5 for 3.4 branch

Now the logic makes sense. r=LpSolit
Attachment #413186 - Flags: review? → review+
Comment on attachment 413185 [details] [diff] [review]
Patch v5 for trunk

Here too, I'm now fine with this patch. r=LpSolit
Attachment #413185 - Flags: review+
Flags: approval3.4+
Flags: approval+
Attachment #413185 - Flags: review?(mkanat) → review+
tip:

Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v  <--  Template.pm
new revision: 1.115; previous revision: 1.114
done

3.4:

Checking in Bugzilla/Template.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Template.pm,v  <--  Template.pm
new revision: 1.99.2.4; previous revision: 1.99.2.3
done
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Security advisory sent, unlocking bug.
Group: bugzilla-security
Flags: testcase?
Attached patch Selenium scriptSplinter Review
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/qa/4.2/
modified t/test_security.t
Committed revision 218.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/qa/4.0/
modified t/test_security.t
Committed revision 205.
Flags: testcase? → testcase+
Keywords: selenium
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: