Vulnerability response Cross-site scripting
overview
Information release date
2024/10/10
Target version
- (PHP8.2) exceedone/exment v6.1.4 or lower, and exceedone/laravel-admin v4.1.1
- (PHP8.0) exceedone/exment v5.0.11 or lower, and exceedone/laravel-admin v3.0.3
How it was discovered
It was discovered through a report.
Conditions
The script will be executed when the script is entered at a specific URL or screen.
※The specific conditions under which this issue occurs will not be disclosed in order to prevent abuse of this vulnerability as much as possible.
Threat posed by vulnerabilities
- The vulnerability exploits the functionality of not re-authenticating the victim's session, and can also be used for phishing by creating a visually defaced page.
Solution
Please take one of the following actions:
- (Recommended) If you can upload the entire project (including Exments): Solution 1
- If for some reason you can't upload the entire project (e.g. you want to keep the Exment version), try the solution 2.
※ Considering the impact of this issue, we are also updating Exment v5, the PHP 8 version.
Solution 1: If you can upload the entire project (including Exment)
Please update Exment and laravel-admin by clicking here.
※exceedone/exment will be updated to v6.1.5 or higher, and exceedone/laravel-admin will be updated to v4.1.2 or higher.
※If for some reason you are still using PHP8, exceedone/exment will be updated to v5.0.12 or higher, and exceedone/laravel-admin will be updated to 3.0.3 or higher.
Solution 2: If you are unable to update for some reason
If you are unable to update for any reason, please modify the following file.
// vendor/exceedone/exment/resources/lang/en/exment.php
///// Around line 237
//Add the following
'filename_not_allow' => 'A prohibited character is used in :attribute. Please change the file name and try again.',// vendor/exceedone/exment/resources/lang/ja/exment.php
///// Around line 237
//Add the following
'filename_not_allow' => 'The :attribute contains prohibited characters. Please change the file name and try again.',// vendor/exceedone/exment/src/ColumnItems/CustomColumns/File.php
///// Around line 327
//Add the following
$validates[] = new Validator\FileNameRule();// Add a new file
// vendor/exceedone/exment/src/Validator/FileNameRule.php
<?php
namespace Exceedone\Exment\Validator;
use Illuminate\Contracts\Validation\Rule;
/**
* FileNameRule.
*/
class FileNameRule implements Rule
{
public function __construct() {}
/**
* Check Validation
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
if ($value instanceof \Illuminate\Http\UploadedFile) {
$filename = $value->getClientOriginalName();
} else {
$filename = pathinfo($value, PATHINFO_BASENAME);
}
return !preg_match('/[\/\\\:\*\?\"<>\|]/', $filename);
}
/**
* get validation error message
*
* @return string
*/
public function message()
{
return exmtrans('validation.filename_not_allow');
}
}