[doc-en] master: Added CVEs to crypt (#3447)
| From: | Steve Thomas via GitHub | Date: | Mon, 31 Aug 2026 20:52:59 +0000 |
| Subject: | [doc-en] master: Added CVEs to crypt (#3447) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23680@lists.php.net to get a copy of this message | ||
Author: Steve Thomas (Sc00bz)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-08-31T22:52:56+02:00
Commit: https://github.com/php/doc-en/commit/4850727cb124abe071e9adaf851f86a872eb2adf
Raw diff: https://github.com/php/doc-en/commit/4850727cb124abe071e9adaf851f86a872eb2adf.diff
Added CVEs to crypt (#3447)
* Added CVEs to crypt
* Warning about CVEs
* crypt(): move the algorithm warning before the list and scope its claims
Changed paths:
M reference/strings/functions/crypt.xml
Diff:
diff --git a/reference/strings/functions/crypt.xml b/reference/strings/functions/crypt.xml
index b98a6e152431..90f31680d500 100644
--- a/reference/strings/functions/crypt.xml
+++ b/reference/strings/functions/crypt.xml
@@ -46,6 +46,20 @@
that start with the same eight characters will generate the same result
(when the same salt is used).
</para>
+ <warning>
+ <simpara>
+ None of the algorithms listed below are suitable for hashing new passwords.
+ <constant>CRYPT_STD_DES</constant>, <constant>CRYPT_EXT_DES</constant>
and
+ <constant>CRYPT_MD5</constant> are far too fast to resist offline cracking;
+ md5crypt was declared end of life for that reason (CVE-2012-3287).
+ The runtime of <constant>CRYPT_SHA256</constant> and
+ <constant>CRYPT_SHA512</constant> grows with the square of the length of
+ <parameter>string</parameter>, so unbounded input can be used to exhaust CPU
+ (CVE-2016-20013).
+ Use <function>password_hash</function> instead, which selects a suitable
+ algorithm and cost automatically.
+ </simpara>
+ </warning>
<simpara>
The following hash types are supported:
</simpara>