[File] [SECURITY] Heap Buffer Over-read in softmagic.c FILE_OPINDIRECT Handling (file-5.17)

Christos Zoulas christos at zoulas.com
Fri Apr 17 11:04:42 EDT 2026


There are checks already, but I added an extra one.

Best,

christos

> On Apr 1, 2026, at 10:58 AM, Kerwin <kerwinxia66001 at gmail.com> wrote:
> 
> Hi maintainers,
> 
> I am reporting a heap buffer over-read vulnerability in libmagic (file-5.17) where the FILE_OPINDIRECT code path in `mget()` (softmagic.c:1189-1222) dereferences a computed pointer before any bounds check against `nbytes`, allowing an out-of-bounds heap read when a crafted magic database is loaded.
> 
> Please find the detailed vulnerability report and proof-of-concept files attached.
> 
> Best regards
> 
> <POC.tar>-- 
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> <sanitizer.log>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.astron.com/pipermail/file/attachments/20260417/c6adc3ba/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <http://mailman.astron.com/pipermail/file/attachments/20260417/c6adc3ba/attachment.asc>


More information about the File mailing list