Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2022-37159: claroline-CVEs/rce_file_upload.md at main · matthieu-hackwitharts/claroline-CVEs

Claroline 13.5.7 and prior is vulnerable to Remote code execution via arbitrary file upload.

CVE
#vulnerability#js#php#rce

Remote code execution via arbitrary file upload (version : 13.5.7)

Claroline Connect app presents a RCE vulnerability because of the possibility to upload an arbitrary php file. This vulnerability is present on many upload forms, so I’ve personnally choosed the resource icon section.

The route core/Controller/APINew/FileController.php filters the upload image type by using the getMimeType() function from Symfony :

public function uploadImage(Request $request): JsonResponse { $files = $request->files->all();

    $objects = \[\];
    foreach ($files as $file) {
        if (0 !== strpos($file\->getMimeType(), 'image')) {
            throw new InvalidDataException('Invalid image type.');
        }

        $object = $this\->crud\->create(PublicFile::class, \[\], \['file' => $file, Crud::THROW\_EXCEPTION\]);
        $objects\[\] = $this\->serializer\->serialize($object);
    }

    return new JsonResponse($objects);
}

It is possible to trick this function by adding some magic bytes like GIF8; which corresponds to the GIF image file type. The mime type image/gif should be also applied.

Then it is possible to get RCE by using the upload php shell :

Fix suggestions : Enhance file upload checks by adding real mime type verification (file content, bytes, size, etc).

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda
CVE-2023-6905
CVE-2023-6903
CVE-2023-6904
CVE-2023-3907