]> git.p6c8.net - jirafeau/jirafeau.git/commit
Check for commas in MIME type before generating preview
authorPatrick Canterino <patrick@patrick-canterino.de>
Mon, 16 Jun 2025 09:58:15 +0000 (11:58 +0200)
committerPatrick Canterino <patrick@patrick-canterino.de>
Mon, 16 Jun 2025 09:58:15 +0000 (11:58 +0200)
commit79464ec6276e8eb0e0b0ad597db02b85080d2b63
tree3a8bbcf1e8951be2b1b85b14b2991bd3b704a2e6
parenteae7f48e501c8709a049d291069bc37150ecc1a1
Check for commas in MIME type before generating preview

It was possible to bypass the preview check by sending a manipulated HTTP request with a MIME type like "image/png,text/html".
When parsing the Content-Type of a HTTP response, browsers see multiple MIME types, and the last one, text/html, takes precedence, allowing to execute potentially harmful JavaScript code.

This check was originally implemented to address CVE-2022-30110 then CVE-2024-12326.

Reported by:
- Yann CAM (ycam) (https://yann.cam/)
- Killian CHEVRIER (palmier) (https://killianchevrier.fr/)
lib/functions.php

patrick-canterino.de