Need help with laravel-image-sanitize?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

laravel-at
130 Stars 7 Forks MIT License 74 Commits 0 Opened issues

Description

Prevent malicious code execution through uploaded image files

Services available

!
?

Need anything else?

Contributors list

Laravel Image Sanitize logo

It prevents malicious code execution!

Latest Version on Packagist GitHub Tests Action Status Quality Score Total Downloads

This is a small but handy package to prevent malicious code execution coming into your application through uploaded images. It was created after being inspired by @appelsiini's talk on How to Hack your Laravel Application

Installation

You can install the package via composer:

composer require laravel-at/laravel-image-sanitize

Usage

Register the

ImageSanitizeMiddleware
in your
App\Http\Kernel
class ``` php protected $routeMiddleware = [ // ... 'image-sanitize' => \LaravelAt\ImageSanitize\ImageSanitizeMiddleware::class, ];
Then, just use it in your Controller's constructor
``` php
public function __construct()
{
    $this->middleware('image-sanitize');
}

Or use it in your

routes/web.php
file
php
Route::post('/files', '[email protected]')
    ->name('file.upload')
    ->middleware(['image-sanitize']);

If you want to learn more about

middlewares
, please check out the official Laravel documentation

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.