📖 back to readme
Auth-middleware follows semantic versioning.
Any issues should be reported.
- no code changes
- fully support PHP 8.4
- drop support for PHP 8.0
- drop support for psr/log v1
- add support psr/log v2 and v3 (required dependency)
This update reflects security vulnerability patch for CVE-2021-46743 from firebase/php-jwt package in version 5.5 and 6.
As a result, the interface of FirebaseJwtDecoder and certain AuthWizard methods that create the decoder have been changed.
- [BC break] dropped PHP 7 support; PHP 8 is now required
- [BC break] removed
AuthFactory::defaultDecoderFactory, please usefn() => AuthWizard::defaultDecoder( new Secret($secret,$algo) )instead - [BC break] changed the constructor of
FirebaseJwtDecoderto only acceptSecretContractimplementations - [BC break] using
AuthWizard::defaultDecoder,AuthWizard::decodeTokens()andAuthWizard::factory()->decodeTokens()withstring$secretargument will now only decode tokens using the single defaultHS256algorithm- previously the same calls resulted in use of any one of the three
HS256,HS512,HS384algorithms (the attack vector) - to mitigate the issue, use an array of key-algo pairs (
Secret[]) along withkidheader parameter (see section 4.5 of RFC 7517)
- previously the same calls resulted in use of any one of the three
- the default
FirebaseJwtDecodernow only works withfirebase/php-jwtversions 5.5 and 6+ (5.5.* - 6.*) - added
AuthWizard::defaultDecodermethod that directly returns an instance of theFirebaseJwtDecoderdecoder
For more details, see this issue or release notes.
Provides means for mitigation of security vulnerability CVE-2021-46743 by using the new Secret configuration object.
The peer library for handling tokens firebase/php-jwt must be upgraded to v5.5 in order to do so.
- use a single secret+algorithm combination
- either using the
Secretobject instead of string constants when usingAuthWizardorAuthFactory - or passing an array with a single algorithm to the
$algosparameter ofFirebaseJwtDecoderconstructor when using the decoder as standalone
- either using the
- use multiple
Secretobjects and pass them to the$secretparameter AND use "kid" JWT header parameter when encoding the JWT- the JWT encoding must also factor-in the
kidparameter when using multiple possible secret+algorithm combinations
- the JWT encoding must also factor-in the
For more information, see firebase/php-jwt#351.
Improved default injector:
TokenManipulators::attributeInjectornow accepts a callable with signaturefn(Throwable): mixedfor producing a value to be written to the error attribute.- The default injector will no longer prefix the exception messages with
Token Error:prefix.
The initial release.