Laravel Encrypter Component Potential Decryption Failure Leading to Unintended Behavior
The Laravel Encrypter component is susceptible to a vulnerability that may result in decryption failure, leading to an unexpected return of false. Exploiting this issue requires the attacker to manipulate the encrypted payload before decryption. When combined with weak type comparisons in the application's code, such …
As published by the sources
Affected packages
- Affected
<5.5.40 || >=5.6.0,<5.6.15Fixed in5.5.405.6.15
Derived from the fixed versions above
What to do
Upgrade laravel/framework to the fixed version in your release line: 5.5.40, 5.6.15.
composer update laravel/framework --with-dependencies
To see which version you have installed, run composer show vendor/package. Running composer audit lists the known advisories that match your installed versions.
Quoted from the original advisory
Details
The Laravel Encrypter component is susceptible to a vulnerability that may result in decryption failure, leading to an unexpected return of false. Exploiting this issue requires the attacker to manipulate the encrypted payload before decryption. When combined with weak type comparisons in the application's code, such as the example below:
<?php
$decyptedValue = decrypt($secret);
if ($decryptedValue == '') {
// Code is run even though decrypted value is false...
}
References
- Advisoryhttps://github.com/laravel/framework/security/advisories/GHSA-4mg9-vhxq-vm7j
- Webhttps://github.com/laravel/framework/commit/28e53f23a76206fb130e9a54eb95aa3f010e79c9
- Webhttps://github.com/laravel/framework/commit/886d261df0854426b4662b7ed5db6a1c575a4279
- Webhttps://github.com/FriendsOfPHP/security-advisories/blob/master/laravel/framework/2018-03-30-1.yaml
- Packagehttps://github.com/laravel/framework
- Webhttps://medium.com/@taylorotwell/laravel-security-release-5-6-15-and-5-5-40-56f1257933a0