Closed Bug 450013 (CVE-2010-2757) Opened 16 years ago Closed 14 years ago

[SECURITY] Can sudo a user without sending email

Categories

(Bugzilla :: User Accounts, defect)

2.22
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.2

People

(Reporter: bbaetz, Assigned: LpSolit)

References

Details

(Whiteboard: [infrasec:access])

Attachments

(3 files, 1 obsolete file)

The cookie for sudo is the userid. 1. Find out user's id (some queries with debug=1 will expose this) 2. Add cookie 'sudo=<id>' 3. Visit bugzilla site Actual: Have sudoed user Expected: Fails. This needs to use a cookie from the token table (that verifies the (originaluser, targetuser) tuple, or something similar. You need to have privileges to sudo, so its not a permissions exploit, but its still not good.....
Severity: blocker → critical
Flags: blocking3.2?
OS: Linux → All
Hardware: PC → All
I wouldn't qualify this bug as critical as you cannot do more than what the normal workflow lets you do. The only difference is that no email is sent to the one being sudo'ed, which is by far much less critical than being able to sudo someone in the bz_sudo_protect group (which you cannot do) or being able to sudo someone despite you don't belong to the bz_sudoers group (which you cannot do).
Severity: critical → major
Heck, I didn't even want the email to be sent, when we implemented sudo. :-) So I'm not super-concerned about this, but I do agree it's a security bug in a minor sense.
Severity: major → normal
We're too close to 3.2 and this is too minor to be a blocker.
Flags: blocking3.2? → blocking3.2-
I will give it a look once 3.6 is released.
Target Milestone: --- → Bugzilla 3.2
Attached patch patch, v1 (obsolete) — Splinter Review
The cookie now contains a token, which is only created when using the correct way to impersonate users. If something goes wrong, we now throw an error rather than silently falling back to the sudoer (impersonation is critical enough to notify the sudoer).
Assignee: user-accounts → LpSolit
Status: NEW → ASSIGNED
Attachment #445238 - Flags: review?(mkanat)
Attachment #445238 - Flags: review?(mkanat) → review-
Comment on attachment 445238 [details] [diff] [review] patch, v1 Man, we really need to make tokens into objects. That's for a later time, though. >+ if (!$user_id >+ || $user_id != $authenticated_user->id >+ || !detaint_natural($sudo_target_id) >+ || time() - str2time($date) > MAX_SUDO_TOKEN_AGE) I'd like to see parens around that last time()- condition, to make the precedence clearer. >Index: relogin.cgi >+ my $time_string = time2str('%a, %d-%b-%Y %T %Z', time+(MAX_SUDO_TOKEN_AGE), Those parens probably aren't necessary now. >Index: template/en/default/global/user-error.html.tmpl >+ [% ELSIF error == "sudo_invalid_cookie" %] >+ [% title = "Invalid Sudo Cookie" %] >+ Your sudo cookie is invalid. Either it expired or you didn't start >+ a sudo session correctly. For the case where it expired, we should tell the user that they can just refresh the page or load another page to continue what they are doing as themselves. >+ [% ELSIF error == "sudo_illegal_action" %] >+ [% ELSE %] >+ The user you try to impersonate doesn't exist. s/try/tried/
Whiteboard: [infrasec:access]
Flags: blocking3.6.2+
Attachment #445238 - Attachment is obsolete: true
Attachment #456033 - Flags: review?(mkanat)
Attachment #456033 - Flags: review?(mkanat) → review?(bugzilla)
Comment on attachment 456033 [details] [diff] [review] patch for 3.6 - 4.2, v2 r=glob
Attachment #456033 - Flags: review?(bugzilla) → review+
It needs a backport for 3.4 and 3.2.
Flags: blocking4.0+
Flags: blocking3.4.8+
Flags: blocking3.2.8+
Flags: approval?
Flags: approval4.0?
Flags: approval3.6?
Attachment #456033 - Attachment description: patch, v2 → patch for 3.6 - 4.2, v2
Same patch as for 3.6-4.2, except that it fixes a small bitrot due to context lines which changed in Constants.pm.
Attachment #458238 - Flags: review?(bugzilla)
Minor bitrot in Bugzilla.pm for 3.2 due to |use DateTime::TimeZone| which doesn't exist there. No other changes.
Attachment #458240 - Flags: review?(bugzilla)
Comment on attachment 458238 [details] [diff] [review] patch for 3.4, v1 r=glob
Attachment #458238 - Flags: review?(bugzilla) → review+
Comment on attachment 458240 [details] [diff] [review] patch for 3.2, v1 r=glob
Attachment #458240 - Flags: review?(bugzilla) → review+
ok, this bug is ready for checkin. Thanks glob for the reviews.
Flags: approval3.4?
Flags: approval3.2?
Summary: Can sudo a user without sending email → [SECURITY] Can sudo a user without sending email
Blocks: 580214
Version: unspecified → 2.22
Alias: CVE-2010-2757
Flags: approval?
Flags: approval4.0?
Flags: approval4.0+
Flags: approval3.6?
Flags: approval3.6+
Flags: approval3.4?
Flags: approval3.4+
Flags: approval3.2?
Flags: approval3.2+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla.pm modified relogin.cgi modified Bugzilla/Constants.pm modified template/en/default/global/user-error.html.tmpl Committed revision 7429. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.0/ modified Bugzilla.pm modified relogin.cgi modified Bugzilla/Constants.pm modified template/en/default/global/user-error.html.tmpl Committed revision 7370. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/3.6/ modified Bugzilla.pm modified relogin.cgi modified Bugzilla/Constants.pm modified template/en/default/global/user-error.html.tmpl Committed revision 7158. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/3.4/ modified Bugzilla.pm modified relogin.cgi modified Bugzilla/Constants.pm modified template/en/default/global/user-error.html.tmpl Committed revision 6772. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/3.2/ modified Bugzilla.pm modified relogin.cgi modified Bugzilla/Constants.pm modified template/en/default/global/user-error.html.tmpl Committed revision 6393.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Security advisory sent, unlocking bug.
Group: bugzilla-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: