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.
DescriptionChristopher Hailey
2016-09-06 20:52:05 UTC
Created attachment 1198419[details]
Patch to chkname.c to disalow usernames starting with dot
Description of problem: useradd allows usernames to start with a dot which is a problem since the user's home directory is the username.
This means that is a user is created like this, e.g. ".fred" then the user's home directory is also ".fred" which is a hidden directory. The real trouble starts if the username is just dot or dot-dot which are current directory and current directory parent i.e. /home/. and /home/.. - very bad. these to examples blow up, but the home directory is set to /home/. or /home/.. (!)
Version-Release number of selected component (if applicable): up to and including shadow-utils 4.1.5.1-18
How reproducible: useradd .fred or useradd . or useradd ..
Steps to Reproduce:
1.
2.
3.
Actual results: Accounts are created with fubar home directories (nothing created with dot and dot-dot, fortunately, i.e. /etc/skel
Expected results: useradd should complain
Additional info: suggested patch included as attachment
I am sorry but I do not think this is particularly severe problem. No security issue is created by it and traditionally no unix utilities prevented you from shooting your own foot.
Also please use regular Red Hat support contact to report issues with Red Hat Enterprise Linux so we can properly prioritize the fixes.
Also it might be acceptable to prevent . or .. user to be created, however anything else starting with dot should be allowable, there might be legitimate cases where having such user is needed.
Comment 4Christopher Hailey
2016-09-07 19:26:31 UTC
(In reply to Tomas Mraz from comment #3)
> Also it might be acceptable to prevent . or .. user to be created, however
> anything else starting with dot should be allowable, there might be
> legitimate cases where having such user is needed.
If the username is . then pam_mkhomedir will create all of the /etc/skel stuff in /home - that's bad.
If the username starts with dot then the home dir is hidden which is weird but probably not a huge problem.
I think disallowing "." and ".." is a good idea since it creates a broken state.
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.
https://access.redhat.com/errata/RHBA-2018:3063
Created attachment 1198419 [details] Patch to chkname.c to disalow usernames starting with dot Description of problem: useradd allows usernames to start with a dot which is a problem since the user's home directory is the username. This means that is a user is created like this, e.g. ".fred" then the user's home directory is also ".fred" which is a hidden directory. The real trouble starts if the username is just dot or dot-dot which are current directory and current directory parent i.e. /home/. and /home/.. - very bad. these to examples blow up, but the home directory is set to /home/. or /home/.. (!) Version-Release number of selected component (if applicable): up to and including shadow-utils 4.1.5.1-18 How reproducible: useradd .fred or useradd . or useradd .. Steps to Reproduce: 1. 2. 3. Actual results: Accounts are created with fubar home directories (nothing created with dot and dot-dot, fortunately, i.e. /etc/skel Expected results: useradd should complain Additional info: suggested patch included as attachment