PHP RFC: Distrust SHA-1 Certificates
- Version: 0.3
- Date: 2016-11-25
- Last Update: 2017-05-29
- Author: Niklas Keller email@example.com
- Status: Under Discussion
- First Published at: http://wiki.php.net/rfc/distrust-sha1-certificates
As of 2016-01-01, the CA/B Forum forbids issuing new SHA-1 certificates. The CA/B has advised CAs starting 2015-01-16 to issue no SHA-1 certificates with an expiration date greater than 2017-01-01, as browsers had already announced (see references) to deprecate and remove SHA-1. NIST recommends that SHA-1 should no longer be used for digital signatures. Starting with Java 9, Java will also no longer accept SHA-1 starting 2017-01-01 by default.
Meanwhile, PHP doesn't have any restrictions here at all. There's no context option that let's users specify which signature algorithms they accept. Even worse, PHP currently accepts even MD5 certificates.
As of 23rd of February 2017, SHA-1 is considered broken. MD5 has been known to be broken for a way longer time.
This RFC proposes to introduce a new
“min_signature_bits” context option to restrict the accepted certificate message digests. The RFC proposes to set this option to
128 (accepting SHA2 and better) by default, allowing
80 (accepting also SHA1) to be set for legacy applications, but this is strongly discouraged. This setting will be applied to all certificates that are not in the trust store.
Backward Incompatible Changes
MD5 certificates won't be accepted any longer. SHA-1 certificates are no longer accepted by default starting in PHP 7.2. This break is intentional and is in line with the CA/B rules and major browser policies.
Proposed PHP Version(s)
All supported versions should be updated to restrict the usage of MD5 certificates. All versions except PHP 7.2 should default to
80 for lower BC impact. PHP 7.2 will default to
Browsers started on 2017-01-01 with no longer accepting SHA-1 certificates. The impact is expected to be rather low. People in need of SHA-1 certificates, e.g. for private CAs, can set the mentioned context option to
80 to get the previous behavior (except for MD5 not being accepted), but are strongly discouraged to do so. It is explicitly not possible to set this value lower than 80. There's no option to enable MD5.
The default can be increased later should the need arise.
Proposed Voting Choices
Requires a 2/3 majority.
Patches and Tests