#91554Refactor SHA1 dependent components
Description
Hello there,
as lined out in this article, SHA1 will soon be dropped from SSH since the standard is considered prone to collisions.
I think, since we are in an early phase of TYPO3 11 developments, it would be good to deprecate all methods and classes related to sha1 (or even md5 for that matter) that are still available in core.
Challenges:- TYPO3 uses the
sha1built-in PHP function 32 times, mentions “sha1” 35 as separate string (either array hash, value or function argument) thoughout the core (that’s 10 more instances of sha1 being called and two instances less as a string mention than back in TYPO3 9.5) - TYPO3 also still uses md5 functions around 169 times (!) in the core
Cryptographically safer functions might create quite a strain on the servers running the new code(on my benchmarks, usinghash('sha256'instead ofsha1was approximately 0.6% slower).
- Ensure more cryptographically safe software
- Get rid of really old code
- (Bragging rights for being the first CMS to throw out all old and cryptographically unsafe functions from its core?)
Best Regards
Tizian
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 1
History 6
-
Oliver Hader changed category <span data-processor="relativetime" data-value="2020-06-02T12:45:32+00:00" > 06/02/20, 12:45 </span>
-
Oliver Hader commented <span data-processor="relativetime" data-value="2020-06-02T12:51:39+00:00" > 06/02/20, 12:51 </span>
Concerning digest signatures (currently HMAC based on SHA1) we might consider
- either changing from
encryptionKeyto PKI signatures, e.g. based on ed25519 - or switching to SHA3-512
- either changing from
-
Benni Mack changed target version <span data-processor="relativetime" data-value="2020-12-22T11:15:36+00:00" > 12/22/20, 11:15 </span>
-
Oliver Hader changed Related to #106307 <span data-processor="relativetime" data-value="2025-04-03T12:25:18+00:00" > 04/03/25, 12:25 </span>
-
Georg Ringer commented and changed status
NewClosed <span data-processor="relativetime" data-value="2026-10-03T04:52:37+00:00" > 10/03/26, 04:52 </span>Here is the current state on
main, as this issue has been open since 2020 and a lot has changed in the meantime.Already done
With #106307 (commit “[!!!][TASK] Use stronger cryptographic algorithm for HMAC”), the enum
HashAlgowas introduced andHashServicegot an$algoargument. All publicly exposed signatures that would be breaking to change have been switched to HMAC-SHA3-256 (or SHA3-384), among them:- cHash (was HMAC-MD5)
- backend and frontend password recovery
FileDumpControllerandShowImageControllertokens- backend form protection, session backends, MFA setup checksums, sudo mode
- Extbase trusted properties and referrer arguments, EXT:form session and state
What is left
HashService::hmac(),appendHmac(),validateHmac()andvalidateAndStripHmac()still default toHashAlgo::SHA1. Around 45 calls in the Core rely on that default, mainly in FormEngine (inline/files/slug context, link and edit popups, image manipulation), CSP reporting,DenyListDeserializer, upload/delete resource pointers in Extbase and EXT:form, the EXT:form definition HMACs and the install tool cache busters. HMAC-SHA1 is not broken (collisions do not matter for HMAC), so this is hardening rather than an actual vulnerability. Changing it invalidates stored or transported HMACs and is therefore a breaking change.- The remaining
sha1()andmd5()calls (roughly 30 and 140 inClasses/) are used for cache identifiers, file names, log pseudonyms orconfigurationsha1. They have no security relevance; switching them would only change database columns and caches without real benefit. - SHA1 has to stay in two places:
Totp, because RFC 6238 and the authenticator apps expect it, andPhpassPasswordHash, which only exists to verify legacy password hashes.
A generic “replace all sha1/md5” issue cannot be reviewed or merged in a sensible way. therefore closing the issue
Thanks for bringing up this topic – in general I’d agree switching to more collision resistant cryptographic hashing algorithm.