Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

GregorSams's avatar

Secure against Laravel 8.4.2 debug mode - Remote code execution

Hello,

I am using Laravel Framework 6.20.16 and I noticed that I get attacked. After some research I found that the attack is called: https://www.exploit-db.com/exploits/49424 (Laravel 8.4.2 debug mode - Remote code execution)

I searched my code for a *.phar file, however I haven`t found one yet.

I am not sure if the attacker was successful.

  1. Is there any way to check?
  2. How to filter such attacks out in the future? Is there any way to secure my vps even more?

I appreciate your replies!

0 likes
4 replies
devingray_'s avatar
Level 8

Running on an older version of Laravel is one of the reasons why you are getting attacked. (Although if you know how to prevent this, it would not be an issue)

The simplest solution would be to try to upgrade as best you can to the latest version of Laravel as there have been many security patches since 6.X

You can use a tool like shift to help you with this

https://laravelshift.com

You can read more about how this specific attack is used and try to work around it here

https://www.ambionics.io/blog/laravel-debug-rce

1 like
GregorSams's avatar

How can I prevent to get attacked even I am running a lower version?

MrMoto9000's avatar

Using Laravel 6 isn't the issue per se, as it has security fixes until September 6th, 2022, but you will need to update Laravel to the latest version (use composer update). I believe this will get patches (6.x.x).

That said I can't see a list of the Laravel 6 minor versions anywhere, so it's difficult to know what the latest 6.x you should be using is.

https://laravel.com/docs/6.x/releases

Please or to participate in this conversation.