Rapid7 Vulnerability & Exploit Database

PHP Laravel Framework token Unserialize Remote Command Execution

Back to Search

PHP Laravel Framework token Unserialize Remote Command Execution

Disclosed
08/07/2018
Created
07/12/2019

Description

This module exploits a vulnerability in the PHP Laravel Framework for versions 5.5.40, 5.6.x <= 5.6.29. Remote Command Execution is possible via a correctly formatted HTTP X-XSRF-TOKEN header, due to an insecure unserialize call of the decrypt method in Illuminate/Encryption/Encrypter.php. Authentication is not required, however exploitation requires knowledge of the Laravel APP_KEY. Similar vulnerabilities appear to exist within Laravel cookie tokens based on the code fix. In some cases the APP_KEY is leaked which allows for discovery and exploitation.

Author(s)

  • Ståle Pettersen
  • aushack <patrick@osisecurity.com.au>

Platform

Unix

Architectures

cmd

Development

Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/unix/http/laravel_token_unserialize_exec
msf exploit(laravel_token_unserialize_exec) > show targets
    ...targets...
msf exploit(laravel_token_unserialize_exec) > set TARGET < target-id >
msf exploit(laravel_token_unserialize_exec) > show options
    ...show and set options...
msf exploit(laravel_token_unserialize_exec) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security

;