Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1730662

Summary: guest_u and xguest_u should by default not be allowed to execute binaries in their home dirs or /tmp
Product: Red Hat Enterprise Linux 7 Reporter: Huzaifa S. Sidhpurwala <huzaifas>
Component: doc-SELinux_Users_and_Administrators_GuideAssignee: Mirek Jahoda <mjahoda>
Status: CLOSED CURRENTRELEASE QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.7CC: lvrabec, mmalik, plautrba, rhel-docs, ssekidde, vmojzis, zpytela
Target Milestone: rcKeywords: Documentation
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1730694 (view as bug list) Environment:
Last Closed: 2019-09-09 08:06:00 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: 1730694    

Description Huzaifa S. Sidhpurwala 2019-07-17 09:54:14 UTC
Not sure across what component to file this flaw. But this came via a customer, and seems like we should fix this asap.

As per: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-targeted_policy-confined_and_unconfined_users

Execute in home directory and /tmp (default) -> No

The document further says:

"By default, Linux users in the guest_t and xguest_t domains cannot execute applications in their home directories or the /tmp directory, preventing them from executing applications, which inherit users' permissions, in directories they have write access to. This helps prevent flawed or malicious applications from modifying users' files."

However this is not the case as it can be seen from:

[root@lenovo-rd230-01 ~]# getsebool -a | grep -i "exec_content"
auditadm_exec_content --> on
dbadm_exec_content --> on
guest_exec_content --> on
logadm_exec_content --> on
secadm_exec_content --> on
staff_exec_content --> on
sysadm_exec_content --> on
user_exec_content --> on
xguest_exec_content --> on

Which is also suggested by:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-Security-Enhanced_Linux-Confining_Users-Booleans_for_Users_Executing_Applications

which means either the documentation is wrong or the policy has a bug.

I think the policy has a bug, and  guest_u  and xguest_u should by default not be allowed to execute binaries in their home dirs or /tmp

Same is applicable to rhel-8 as well.

Comment 2 Milos Malik 2019-07-17 10:12:22 UTC
# rpm -qa selinux\*
selinux-policy-targeted-3.13.1-252.el7.noarch
selinux-policy-3.13.1-252.el7.noarch
# getsebool -a | grep exec_content
auditadm_exec_content --> on
dbadm_exec_content --> on
guest_exec_content --> on
logadm_exec_content --> on
secadm_exec_content --> on
staff_exec_content --> on
sysadm_exec_content --> on
user_exec_content --> on
xguest_exec_content --> on
#