View Issue Details

IDProjectCategoryView StatusLast Update
0000594fileGeneralpublic2024-12-26 19:14
ReporterAnge Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.46 
Fixed in VersionHEAD 
Summary0000594: The SQLite3 magic detection is too broad
DescriptionFile doesn't check the final 0x00 of the magic SQLite3 signature.
Steps To Reproduce- the attached file gives with SQLite3 "Error: File is not a database"
- scan the file.
- get 'fake.db: SQLite 3.x database, last written using SQLite version 3045003, file counter 1, database pages 2, cookie 0x1, schema 4, UTF-8, version-valid-for 1'
Additional InformationThe official format specifies that the magic ends with an null byte: "SQLite format 3\000" cf https://www.sqlite.org/fileformat.html

The test file starts with "SQLite format 3\x20" (0x20 instead of 0x00).

The following patch will fix that:
0 string SQLite\ format\ 3\0

in https://github.com/file/file/blob/0e273e409dc20fd566bb073db89efc86630f8516/magic/Magdir/sql#L109
TagsNo tags attached.

Activities

Ange

2024-12-19 16:07

reporter  

fake.db (8,192 bytes)

christos

2024-12-26 19:14

manager   ~0004144

Fixed, thanks!

Issue History

Date Modified Username Field Change
2024-12-19 16:07 Ange New Issue
2024-12-19 16:07 Ange File Added: fake.db
2024-12-26 19:14 christos Assigned To => christos
2024-12-26 19:14 christos Status new => assigned
2024-12-26 19:14 christos Status assigned => resolved
2024-12-26 19:14 christos Resolution open => fixed
2024-12-26 19:14 christos Fixed in Version => HEAD
2024-12-26 19:14 christos Note Added: 0004144