RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 886648 - Access granted with invalid sudoRunAsUser/sudoRunAsGroup
Summary: Access granted with invalid sudoRunAsUser/sudoRunAsGroup
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sudo
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Daniel Kopeček
QA Contact: David Spurek
URL:
Whiteboard:
Depends On:
Blocks: 947775 1006991 1026904
TreeView+ depends on / blocked
 
Reported: 2012-12-12 18:46 UTC by Nikolai Kondrashov
Modified: 2015-03-02 05:27 UTC (History)
6 users (show)

Fixed In Version: sudo-1.8.6p3-8.el6
Doc Type: Bug Fix
Doc Text:
No documentation needed.
Clone Of:
: 1006991 1026904 (view as bug list)
Environment:
Last Closed: 2013-11-21 23:12:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed patch (1.74 KB, patch)
2013-08-08 14:33 UTC, Daniel Kopeček
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:1701 0 normal SHIPPED_LIVE Low: sudo security, bug fix and enhancement update 2013-11-20 21:52:06 UTC

Description Nikolai Kondrashov 2012-12-12 18:46:07 UTC
Description of problem:
Sudo still grants access when the matching sudo rule, accessed either with ldap or sssd sudoers plugin, has sudoRunAsUser or sudoRunAsGroup set to an invalid user or group ID in the form of #id#, e.g. #10002#.

Version-Release number of selected component (if applicable):
sssd-client-1.9.2-37.el6.x86_64
sssd-1.9.2-37.el6.x86_64
sudo-1.8.6p3-6.el6.x86_64
libsss_idmap-1.9.2-37.el6.x86_64
libsss_sudo-1.9.2-37.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. Create a sudo rule employing #id-format value in sudoRunAsUser or sudoRunAsGroup.
2. Verify that access is granted.
3. Append '#' character to the value.
4. Try getting access again.

Actual results:
access is granted

Expected results:
access is denied

Comment 2 RHEL Program Management 2012-12-16 06:51:13 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 3 Daniel Kopeček 2013-08-08 14:32:58 UTC
Sudo accepts the invalid strings because it uses atoi() to convert the string to an uid/gid. I've changed the code to use strtol and added checks that the whole string was accepted by it.

Comment 4 Daniel Kopeček 2013-08-08 14:33:56 UTC
Created attachment 784416 [details]
proposed patch

Comment 9 Nikolai Kondrashov 2013-09-11 17:26:56 UTC
Verified fixed with sudo-1.8.6p3-11.el6.x86_64.

Relevant sudo suite output:

:: [   PASS   ] :: attrs_runasuser_user_id_invalid (Expected 0, got 0)
:: [   PASS   ] :: attrs_runasgroup_id_invalid (Expected 0, got 0)

Comment 10 errata-xmlrpc 2013-11-21 23:12:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-1701.html


Note You need to log in before you can comment on or make changes to this bug.