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 1373645 - useradd allows '.' and '..' as an username which is problematic
Summary: useradd allows '.' and '..' as an username which is problematic
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: shadow-utils
Version: 7.0
Hardware: All
OS: Linux
low
low
Target Milestone: pre-dev-freeze
: ---
Assignee: Tomas Mraz
QA Contact: Jaroslav Aster
URL:
Whiteboard:
Depends On:
Blocks: 1563599
TreeView+ depends on / blocked
 
Reported: 2016-09-06 20:52 UTC by Christopher Hailey
Modified: 2022-03-13 14:06 UTC (History)
2 users (show)

Fixed In Version: shadow-utils-4.1.5.1-25.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 08:04:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch to chkname.c to disalow usernames starting with dot (824 bytes, text/plain)
2016-09-06 20:52 UTC, Christopher Hailey
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3063 0 None None None 2018-10-30 08:04:30 UTC

Description Christopher 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

Comment 2 Tomas Mraz 2016-09-07 07:20:38 UTC
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.

Comment 3 Tomas Mraz 2016-09-07 07:22:28 UTC
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 4 Christopher 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.

Comment 7 Tomas Mraz 2018-04-24 14:38:02 UTC
I will also prevent creating all-numeric user names to sync with current Fedora.

Comment 12 errata-xmlrpc 2018-10-30 08:04:11 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.

https://access.redhat.com/errata/RHBA-2018:3063


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