Bug 1649461 - httpd_suexec_t doesn't have search permissions on httpd_user_script_exec_t
Summary: httpd_suexec_t doesn't have search permissions on httpd_user_script_exec_t
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 29
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-13 16:17 UTC by Joe Orton
Modified: 2019-11-27 22:14 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-27 22:14:48 UTC


Attachments (Terms of Use)
/etc/httpd/conf.d/userdir.conf (530 bytes, text/plain)
2018-11-13 16:17 UTC, Joe Orton
no flags Details

Description Joe Orton 2018-11-13 16:17:57 UTC
Created attachment 1505365 [details]
/etc/httpd/conf.d/userdir.conf

Description of problem:
I'm getting search denied avc when suexec tries to find CGI scripts in home directory correctly labelled httpd_user_script_exec_t

Version-Release number of selected component (if applicable):
selinux-policy-3.14.2-42.fc29.noarch

How reproducible:
always

Steps to Reproduce:
1. mkdir ~/public_html/cgi-bin
2. enable /home/*/public_html/cgi-bin in httpd config (attached /etc/httpd/conf.d/userdir.conf)
3. curl http://localhost/~someuser/cgi-bin/script.sh

Actual results:
type=AVC msg=audit(1542125420.040:1118): avc:  denied  { search } for  pid=32091 comm="suexec" name="cgi-bin" dev="dm-3" ino=2644265 scontext=system_u:system_r:httpd_suexec_t:s0 tcontext=unconfined_u:object_r:httpd_user_script_exec_t:s0 tclass=dir permissive=0

Expected results:
success

Additional info:

Comment 1 Joe Orton 2018-11-13 16:19:00 UTC
This is with both --

# getsebool httpd_enable_cgi httpd_enable_homedirs
httpd_enable_cgi --> on
httpd_enable_homedirs --> on

Comment 2 Milos Malik 2018-11-13 18:37:02 UTC
----
type=PROCTITLE msg=audit(11/13/2018 19:36:17.915:317) : proctitle=/usr/sbin/suexec ~1000 1000 script.sh 
type=PATH msg=audit(11/13/2018 19:36:17.915:317) : item=0 name=/home/unconfined-user/public_html/cgi-bin inode=16898057 dev=fc:02 mode=dir,775 ouid=unconfined-user ogid=unconfined-user rdev=00:00 obj=unconfined_u:object_r:httpd_user_script_exec_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 
type=CWD msg=audit(11/13/2018 19:36:17.915:317) : cwd=/home/unconfined-user/public_html 
type=SYSCALL msg=audit(11/13/2018 19:36:17.915:317) : arch=x86_64 syscall=chdir success=no exit=EACCES(Permission denied) a0=0x7ffc8b12b5b0 a1=0x1000 a2=0x7ffc8b12d5b0 a3=0x8 items=1 ppid=2373 pid=2671 auid=unset uid=unconfined-user gid=unconfined-user euid=unconfined-user suid=unconfined-user fsuid=unconfined-user egid=unconfined-user sgid=unconfined-user fsgid=unconfined-user tty=(none) ses=unset comm=suexec exe=/usr/sbin/suexec subj=system_u:system_r:httpd_suexec_t:s0 key=(null) 
type=AVC msg=audit(11/13/2018 19:36:17.915:317) : avc:  denied  { search } for  pid=2671 comm=suexec name=cgi-bin dev="vda2" ino=16898057 scontext=system_u:system_r:httpd_suexec_t:s0 tcontext=unconfined_u:object_r:httpd_user_script_exec_t:s0 tclass=dir permissive=0 
----

Comment 3 Milos Malik 2018-11-13 18:38:26 UTC
Caught in permissive mode:
----
type=PROCTITLE msg=audit(11/13/2018 19:37:24.521:322) : proctitle=/usr/sbin/suexec ~1000 1000 script.sh 
type=PATH msg=audit(11/13/2018 19:37:24.521:322) : item=0 name=/home/unconfined-user/public_html/cgi-bin inode=16898057 dev=fc:02 mode=dir,775 ouid=unconfined-user ogid=unconfined-user rdev=00:00 obj=unconfined_u:object_r:httpd_user_script_exec_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 
type=CWD msg=audit(11/13/2018 19:37:24.521:322) : cwd=/home/unconfined-user/public_html 
type=SYSCALL msg=audit(11/13/2018 19:37:24.521:322) : arch=x86_64 syscall=chdir success=yes exit=0 a0=0x7ffd22fce4e0 a1=0x1000 a2=0x7ffd22fcf4e0 a3=0x8 items=1 ppid=2373 pid=2693 auid=unset uid=unconfined-user gid=unconfined-user euid=unconfined-user suid=unconfined-user fsuid=unconfined-user egid=unconfined-user sgid=unconfined-user fsgid=unconfined-user tty=(none) ses=unset comm=suexec exe=/usr/sbin/suexec subj=system_u:system_r:httpd_suexec_t:s0 key=(null) 
type=AVC msg=audit(11/13/2018 19:37:24.521:322) : avc:  denied  { search } for  pid=2693 comm=suexec name=cgi-bin dev="vda2" ino=16898057 scontext=system_u:system_r:httpd_suexec_t:s0 tcontext=unconfined_u:object_r:httpd_user_script_exec_t:s0 tclass=dir permissive=1 
----
type=PROCTITLE msg=audit(11/13/2018 19:37:24.521:323) : proctitle=/usr/sbin/suexec ~1000 1000 script.sh 
type=PATH msg=audit(11/13/2018 19:37:24.521:323) : item=0 name=/home/unconfined-user/public_html/cgi-bin inode=16898057 dev=fc:02 mode=dir,775 ouid=unconfined-user ogid=unconfined-user rdev=00:00 obj=unconfined_u:object_r:httpd_user_script_exec_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 
type=CWD msg=audit(11/13/2018 19:37:24.521:323) : cwd=/home/unconfined-user/public_html/cgi-bin 
type=SYSCALL msg=audit(11/13/2018 19:37:24.521:323) : arch=x86_64 syscall=lstat success=yes exit=0 a0=0x7ffd22fce4e0 a1=0x7ffd22fce3c0 a2=0x7ffd22fce3c0 a3=0x8 items=1 ppid=2373 pid=2693 auid=unset uid=unconfined-user gid=unconfined-user euid=unconfined-user suid=unconfined-user fsuid=unconfined-user egid=unconfined-user sgid=unconfined-user fsgid=unconfined-user tty=(none) ses=unset comm=suexec exe=/usr/sbin/suexec subj=system_u:system_r:httpd_suexec_t:s0 key=(null) 
type=AVC msg=audit(11/13/2018 19:37:24.521:323) : avc:  denied  { getattr } for  pid=2693 comm=suexec path=/home/unconfined-user/public_html/cgi-bin dev="vda2" ino=16898057 scontext=system_u:system_r:httpd_suexec_t:s0 tcontext=unconfined_u:object_r:httpd_user_script_exec_t:s0 tclass=dir permissive=1 
----

Comment 4 Ben Cotton 2019-10-31 19:30:32 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 Ben Cotton 2019-11-27 22:14:48 UTC
Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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