Bug 159905

Summary: Squid cachemgr.cgi exec denied by Selinux
Product: [Fedora] Fedora Reporter: Derek Carter <derek>
Component: selinux-policy-strictAssignee: Daniel Walsh <dwalsh>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-11-03 22:29:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Derek Carter 2005-06-08 22:40:42 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050416 Fedora/1.0.3-1.3.1 Firefox/1.0.3

Description of problem:
Targeted SELinux policy denies execute on /usr/lib/squid/cachemgr.cgi when run as a cgi script from that directory

cachemgr is labeled as follows:

system_u:object_r:lib_t

by re-labeling to:

system_u:object_r:httpd_exec_t

Apache can execute the script with no problems


Version-Release number of selected component (if applicable):
selinux-policy-targeted-1.17.30-2.96 squid-2.5.STABLE6-3

How reproducible:
Always

Steps to Reproduce:
1. Enable /usr/lib/squid as a scriptalias
2. visit cachemgr.cgi from a web browser
3. check logs in /var/log/messages and /var/log/httpd/error_log
  

Actual Results:  /var/log/messages:
Jun  8 16:13:23 server1 kernel: audit(1118268803.919:0): avc:  denied  { execute } for  pid=12595 exe=/usr/sbin/httpd name=cachemgr.cgi dev=hda3 ino=2458468 scontext=root:system_r:httpd_t tcontext=system_u:object_r:lib_t tclass=file

/var/log/httpd/error_log:
[Wed Jun 08 16:13:23 2005] [error] [client 127.0.0.1] (13)Permission denied: exec of '/usr/lib/squid/cachemgr.cgi' failed
[Wed Jun 08 16:13:23 2005] [error] [client 127.0.0.1] Premature end of script headers: cachemgr.cgi


Expected Results:  cachemgr.cgi should have executed and allowed access to the cgi script's interface

Additional info:

Comment 2 Daniel Walsh 2005-11-03 22:29:02 UTC
Change has been made in upstream version and will be backported to fc4.  You
change should remain for FC3.