Laravel 8.x image upload bypass — Zero Day

Share on facebook
Share on twitter
Share on linkedin
Share on reddit
Share on email

Laravel 8.x image upload bypass

In the name of God.

Hi researchers,

In this write-up we’re gonna walk through bypassing laravel image upload , which is one the most popular web application framework written in php.

By bypassing laravel’s image validation we can achieve other attacks, first and most loved is XSS and as it is an stored xss we can write a full exploit that let us bypass CSRF and then we are free to do whatever we want with higher privilege and I give it to you in this write-up , I also researched for remediation on this attack and I give that one too.

For better explanation we’re gonna setup our lab together .

Let’s get started

First things first we should create new laravel project :

composer create-project –prefer-dist laravel/laravel blog

Next we should create routes in routes/web.php :

<?phpuse IlluminateSupportFacadesRoute;use AppHttpControllersImageUploadController;Route::get('image-upload', [ ImageUploadController::class, 'imageUpload' ])->name('image.upload');Route::post('image-upload', [ ImageUploadController::class, 'imageUploadPost' ])->name('image.upload.post');

And in next step we should create a Controller, Controllers are meant to group associated request handling logic within a single class.

app/Http/Controllers/ImageUploadController.php

<?phpnamespace AppHttpControllers;use IlluminateHttpRequest;class ImageUploadController extends Controller{/*** Display a listing of the resource.**

Read the article