Vulnerability response Response to vulnerability that arbitrary code is executed in Laravel
Overview
Information disclosure date
2021/04/13
Target version
Laravel 8.4.2 and earlier
and the related package "facade/ignition" is less than 1.16.15
Vulnerability details
A vulnerability that allows arbitrary code to be executed has been reported in the PHP framework "Laravel" adopted by Exment.
reference:
CVE-2021-3129
Article Qiita
How it was discovered
By various information articles.
Occurrence condition
Arbitrary code is executed under the following conditions:
- Laravel 8.4.2 and earlier
- Related package "facade/ignition" is less than 1.16.15
- When "APP_DEBUG" is set to "true" in the configuration file ".env". When debug mode is on.
Threats posed by vulnerabilities
- Arbitrary code is executed on the server.
- A Laravel package is infected with malware.
Confirmation and deletion of malware "kdevtmpfsi" and "kinsing"
# Malware presence confirmation
find / -name kdevtmpfsi
find / -name kinsing
# Example
/var/lib/docker/overlay2/afab93b1a...74902e08061140e/diff/tmp/kdevtmpfsi
/var/lib/docker/overlay2/afab93b1...a1eb129902e08061140e/merged/tmp/kdevtmpfsi
/var/lib/docker/overlay2/afab93b1a2...742e08061140e/diff/tmp/kinsing
/var/lib/docker/overlay2/afab93...750902e08061140e/merged/tmp/kinsing
# If a file like the one above exists, delete the fileFundamental solution
This is the root solution for this vulnerability. Please do one of the following:
- If the whole project (including Extent) can be uploaded: 1
- If for some reason you can't upload the whole project (e.g. you want to keep the Exment version): 2
Fundamental workaround 1: Update the entire project
Please update the whole Exment project by the following method.
- Execute the following command.
composer update- Open the "composer.lock" file and search for the string "facade/ignition".
Check if "facade/ignition", which is the cause of the vulnerability, is 1.16.15 or higher.
# Description example
{
"name": "facade/ignition",
"version": "1.16.15", // Make sure this version is 1.16.15 or higher
"source": {
"type": "git",
"url": "https://github.com/facade/ignition.git",
"reference": "b6aea4a99303d9d32afd486a285162a89af8a8a3"
},
... Omitted below
},- Open the ".env" file, modify the following description, and turn off the debug mode.
# Before
APP_DEBUG=true
# After
APP_DEBUG=falseFundamental solution 2: Update package facade/ignition
Please update the package facade/ignition that is the target of this vulnerability.
- Execute the following command.
composer require facade/ignition=~1.16- Open the "composer.lock" file and search for the string "facade/ignition".
Check if "facade/ignition", which is the cause of the vulnerability, is 1.16.15 or higher.
# Example
{
"name": "facade/ignition",
"version": "1.16.15", // Make sure this version is 1.16.15 or higher
"source": {
"type": "git",
"url": "https://github.com/facade/ignition.git",
"reference": "b6aea4a99303d9d32afd486a285162a89af8a8a3"
},
... Omitted below
},- Open the ".env" file, modify the following description, and turn off the debug mode.
# Before
APP_DEBUG=true
# After
APP_DEBUG=false