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)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.2
People
(Reporter: bbaetz, Assigned: LpSolit)
References
Details
(Whiteboard: [infrasec:access])
Attachments
(3 files, 1 obsolete file)
(deleted),
patch
|
glob
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
glob
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
glob
:
review+
|
Details | Diff | Splinter Review |
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.....
Updated•16 years ago
|
Severity: blocker → critical
Flags: blocking3.2?
OS: Linux → All
Hardware: PC → All
Assignee | ||
Comment 1•16 years ago
|
||
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
Comment 2•16 years ago
|
||
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
Comment 3•16 years ago
|
||
We're too close to 3.2 and this is too minor to be a blocker.
Flags: blocking3.2? → blocking3.2-
Assignee | ||
Comment 5•15 years ago
|
||
I will give it a look once 3.6 is released.
Target Milestone: --- → Bugzilla 3.2
Updated•15 years ago
|
Blocks: q2-review-bmo
Assignee | ||
Comment 6•15 years ago
|
||
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).
Updated•15 years ago
|
Attachment #445238 -
Flags: review?(mkanat) → review-
Comment 7•15 years ago
|
||
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/
Updated•15 years ago
|
Whiteboard: [infrasec:access]
Assignee | ||
Updated•15 years ago
|
Flags: blocking3.6.2+
Assignee | ||
Comment 8•14 years ago
|
||
Attachment #445238 -
Attachment is obsolete: true
Attachment #456033 -
Flags: review?(mkanat)
Assignee | ||
Updated•14 years ago
|
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+
Assignee | ||
Comment 10•14 years ago
|
||
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?
Assignee | ||
Updated•14 years ago
|
Attachment #456033 -
Attachment description: patch, v2 → patch for 3.6 - 4.2, v2
Assignee | ||
Comment 11•14 years ago
|
||
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)
Assignee | ||
Comment 12•14 years ago
|
||
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 13•14 years ago
|
||
Comment on attachment 458238 [details] [diff] [review]
patch for 3.4, v1
r=glob
Attachment #458238 -
Flags: review?(bugzilla) → review+
Comment 14•14 years ago
|
||
Comment on attachment 458240 [details] [diff] [review]
patch for 3.2, v1
r=glob
Attachment #458240 -
Flags: review?(bugzilla) → review+
Assignee | ||
Comment 15•14 years ago
|
||
ok, this bug is ready for checkin. Thanks glob for the reviews.
Flags: approval3.4?
Flags: approval3.2?
Assignee | ||
Updated•14 years ago
|
Summary: Can sudo a user without sending email → [SECURITY] Can sudo a user without sending email
Assignee | ||
Updated•14 years ago
|
Version: unspecified → 2.22
Updated•14 years ago
|
Alias: CVE-2010-2757
Assignee | ||
Updated•14 years ago
|
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+
Assignee | ||
Comment 16•14 years ago
|
||
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
You need to log in
before you can comment on or make changes to this bug.
Description
•