CVE-2018-15133 in laravel

The LogPulse agent checks every host for the vulnerable version of this software, so you see where the CVE is present.

What the vulnerability is

In Laravel Framework through 5.5.40 and 5.6.x through 5.6.29, remote code execution might occur as a result of an unserialize call on a potentially untrusted X-XSRF-TOKEN value. This involves the decrypt method in Illuminate/Encryption/Encrypter.php and PendingBroadcast in gadgetchains/Laravel/RCE/3/chain.php in phpggc. The attacker must know the application key, which normally would never occur, but could happen if the attacker previously had privileged access or successfully accomplished a previous attack.

Affected software: laravel

Scores

What LogPulse has for it

How to mitigate it

Upgrade Laravel to 5.6.30 or later and rotate APP_KEY (CVE-2018-15133)

Patch or upgrade. Laravel 5.6.30 turns off serialization of cookie values, so a forged X-XSRF-TOKEN can no longer trigger PHP object unserialization. An attacker who has the APP_KEY can still forge cookies, so rotate the key too.

Applies to: Laravel Framework 5.5.40 and earlier, and 5.6.x before 5.6.30. Also any later version where EncryptCookies $serialize was set back to true.

  1. In the application folder, run: composer show laravel/framework (or check laravel/framework in composer.lock) to read the installed version.
  2. If the version is 5.5.x or 5.6.x below 5.6.30, set laravel/framework to ^5.6.30 or a supported later major release in composer.json, then run composer update laravel/framework.
  3. If you use Laravel Passport, upgrade to 6.0.7 or later and call Passport::withoutCookieSerialization() in AppServiceProvider. If you use Dusk, upgrade to 4.0.0.
  4. Open app/Http/Middleware/EncryptCookies.php and make sure protected static $serialize is not set to true. Setting it to true turns the vulnerable behaviour back on.
  5. Create a new key with php artisan key:generate, deploy the new APP_KEY to every instance, and expect all existing sessions to be logged out.
  6. Check that .env, storage/logs and debug pages (APP_DEBUG=false in production) can never be reached through the web server, so the key cannot leak again.

Sources:

Source data: NIST NVD, CISA KEV and FIRST EPSS. LogPulse processes new CVEs every hour.

We build every detection with great care, but no two environments are the same. Log sources, parsing and configuration differ, so test a detection in your own environment before you rely on it.

Start free with LogPulse