Bug 903020

Summary: sudoers containing specially crafted aliases causes segfault of visudo
Product: Red Hat Enterprise Linux 6 Reporter: Aleš Mareček <amarecek>
Component: sudoAssignee: Daniel Kopeček <dkopecek>
Status: CLOSED ERRATA QA Contact: Aleš Mareček <amarecek>
Severity: high Docs Contact:
Priority: high    
Version: 6.4CC: ddumas, jwest, ksrot, pvrabec
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sudo-1.8.6p3-7.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 09:45:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 905536    
Attachments:
Description Flags
proposed patch none

Description Aleš Mareček 2013-01-22 23:17:41 UTC
Description of problem:
Sudoers file containing specially crafted aliases causes segfault of visudo.

Version-Release number of selected component (if applicable):
sudo-1.8.6p3-6.el6

How reproducible:
Always

Steps to Reproduce:
1. cat <<EOF >>/etc/sudoers
User_Alias YYY = FOO
User_Alias XXX = nobody
User_Alias FOO = XXX,YYY
FOO ALL=(ALL) NOPASSWD: ALL
EOF
2. visudo -c
3. echo $?
  
Actual results:
2. visudo: Warning: cycle in User_Alias `FOO'
Segmentation fault (core dumped)
3. 139

Expected results:
No segfault, works

Additional info:
If you insert these aliases with "visudo" it will segfault and changes won't store. Unfortunatelly when you store this arbitrary code by some other tool (vim, cat, ...) you won't be able to delete it with visudo because of segfault.

Comment 2 Daniel Kopeček 2013-01-23 11:01:47 UTC
This should be easily fixable. I'll try to prepare a patch ASAP.

Comment 3 Daniel Kopeček 2013-01-23 11:45:11 UTC
Created attachment 685835 [details]
proposed patch

Comment 5 Daniel Kopeček 2013-01-23 13:23:10 UTC
Upstream reply:

  http://www.sudo.ws/pipermail/sudo-workers/2013-January/000790.html

Comment 13 errata-xmlrpc 2013-02-21 09:45:14 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/RHBA-2013-0363.html