0

My website built upon Laravel is currently under attack.

Only the index.php file was changed, and by that I mean that every line of code is inserted above the original Laravel code. So this code executes before the legitimate Laravel code.

It is harming my SEO.

  • What is causing this massive exploitation?
  • How do you protect yourself against it?
7
  • Someone else asked almost exactly this question less than an hour ago, so it sounds like there's widespread exploitation of some Laravel bug happening right now. security.stackexchange.com/questions/256054/…
    – Polynomial
    Oct 13, 2021 at 14:01
  • How can I prevent from it. @Polynomial Oct 13, 2021 at 14:06
  • 1
    All you've told us is "my site got breached", so it's impossible to know what the cause is. Maybe you left some of the config files exposed like the other person? Try following the advice in the accepted answer to this question: security.stackexchange.com/questions/39231/…
    – Polynomial
    Oct 13, 2021 at 14:09
  • Check for the existence of the file /vendor/voku/portable-ascii/src/voku/helper/data/functions.php. It looks like the attacker is creating that file, and it's probably where their malicious code is. Just removing it won't stop you from being exploited again, though, through whatever method they used before.
    – Polynomial
    Oct 13, 2021 at 14:25
  • 2
    Does this answer your question? How do I deal with a compromised server?
    – kelalaka
    Oct 13, 2021 at 17:18

1 Answer 1

1

For Context: This answer was written before any more infos on the incident were available. At the time, it was uncertain whether this was a common configuration issue, a vulnerability in Laravel itself or a commonly used module.


As it is impossible for us to tell what could be the cause for this exploitation. There are several possibilities, such as a zero-day exploit in Laravel itself or a related module, or a widespread configuration issue.

Here are some steps you can take:

1. Take your App Offline. NOW!

Your application is compromised and so an attacker can do as they wish on your server. That includes stealing all your data, compromising all your user data and generally endangering your users.

Take the application offline. NOW!

2. Inform your Users

Inform your users that a security incident occurred and that it is possible, likely even, that user data was stolen. If some of your users are affected by GDPR, you may need to file a Notification of a personal data breach to the supervisory authority.

3. Contact a Professional Forensics Specialist

I know that this step will sting financially, but depending on your setup, contacting a forensics specialist may be a way to find out how they gained entry, what they did and the full extent of the damage.

At any rate, you need to find the source of the breach before you put the application back online. It's as if a fuse burned out - just replacing it won't fix the underlying problem. If you just replaced the fuse and turned on the power again, the next fuse will burn out again immediately.

4. Fix the Vulnerability

Depending on the nature of the vulnerability, this could be done through an update, through a configuration change or any number of ways. The important part is that just removing the web shell won't fix the issue!. That web shell got there for a reason, so before that reason is addressed, don't put the server back online.

5. Wipe your Server Clean

That means full reinstall from a known-good backup, then applying all the necessary fixed before re-deploying your application.

Yes, it sucks, but it's the only way to be sure. Attempting to "doctor around" will likely result in an attacker having continued access to your server. Remember: They tricked you once - there is no reason to assume they can't trick you again.

2
  • It would be nice if you added the guideline to disable debug mode in case of CVE-2021-3129 Oct 15, 2021 at 15:43
  • Debug mode only applies to a single vulnerability on a defined Laravel version. MeckMK1 answer applies to any scenario of a hacked web application in any language.
    – ThoriumBR
    Oct 15, 2021 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.