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 1229472 - RFC: linux-pam hardcodes sha512 salt length to 8 bytes
Summary: RFC: linux-pam hardcodes sha512 salt length to 8 bytes
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pam
Version: 7.0
Hardware: All
OS: All
low
low
Target Milestone: rc
: ---
Assignee: Tomas Mraz
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 1203710 1229474
TreeView+ depends on / blocked
 
Reported: 2015-06-08 21:16 UTC by Paulo Andrade
Modified: 2020-01-17 15:31 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Cause: Consequence: Fix: Result:
Clone Of:
Environment:
Last Closed: 2016-01-19 14:56:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Paulo Andrade 2015-06-08 21:16:50 UTC
Looking at linux-pam git, it appears the salt is
always hardcoded at 8 bytes. This commit was the
last change in the related code:

https://git.fedorahosted.org/cgit/linux-pam.git/commit/modules/pam_unix/passverify.c?id=459e97431e99fa2c32e30e957993f95794b98dd0

---8<---
+	crypt_make_salt(sp, 8);
+	/* For now be conservative so the resulting hashes
+	 * are not too long. 8 bytes of salt prevents dictionary
+	 * attacks well enough. */
+	sp = crypt(password, salt);
---8<---

The salt can be up to 16 bytes.

Since the code was last touched in 2008, and was mostly
written before it, is it still a good enough value?

As a note, anaconda, in a clean install, creates
entries in /etc/shadow with 16 byte salt, but if one
changes the password, it becomes a 8 byte salt.

Comment 2 Tomas Mraz 2015-06-09 08:23:17 UTC
8 character salt provides the search space of 2^48 * number-of-precomputed-passwords. That's 281 TB * length of password hash per single password. That is still completely impractical value for creation of rainbow tables.

So there is no hurry to change this.

However I'll report it upstream and we'll probably change it to a higher value in the next upstream release.

Comment 3 Paulo Andrade 2015-06-09 13:01:50 UTC
(In reply to Tomas Mraz from comment #2)
> 8 character salt provides the search space of 2^48 *
> number-of-precomputed-passwords. That's 281 TB * length of password hash per
> single password. That is still completely impractical value for creation of
> rainbow tables.
> 
> So there is no hurry to change this.
> 
> However I'll report it upstream and we'll probably change it to a higher
> value in the next upstream release.

Could it be made configurable?
The user would like to be able to change the length.
It could be a pam_unix option, to choose from 8 to
16. Or a number larger than 8 if the default minimum
becomes larger.

Comment 4 Tomas Mraz 2015-06-09 13:08:13 UTC
I do not think it is worth adding an option for this. We would just raise the length if the current one is decided to be too short for foreseeable future.

Comment 8 RHEL Program Management 2016-01-19 14:56:02 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.


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