Description
Buffer overflow in tryelf() in readelf.c of the file command allows attackers to execute arbitrary code as the user running file, possibly via a large entity size value in an ELF header (elfhdr.e_shentsize).
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | file | 3.40-1.1 | — |
| Debian 13 | file | 3.40-1.1 | — |
| Debian 12 | file | 3.40-1.1 | — |
| Debian 3.0 | file | 3.37-3.1.woody.1 | DSA-260 |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Exploit-DB 2
- File 3.x - Local Stack Overflow Code Execution (1) EDB-22324 · local · Mar 4, 2003 · verified
- File 3.x - Local Stack Overflow Code Execution (2) EDB-22325 · local · Mar 4, 2003 · verified
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 1
- DSA-260 file - buffer overflow Debian Security (DSA / DLA) · Mar 9, 2026
References
- http://www.idefense.com/advisory/03.04.03.txt
- file-afctr-read-bo(11469) vdb-entry
- RHSA-2003:087 vendor-advisory
- SuSE-SA:2003:017 vendor-advisory
- 7008 vdb-entry
- 20030304 iDEFENSE Security Advisory 03.04.03: Locally Exploitable Buffer Overflow in file(1) mailing-list
- IMNX-2003-7+-012-01 vendor-advisory
- RHSA-2003:086 vendor-advisory
- DSA-260 vendor-advisory
- VU#611865 third-party-advisory
- MDKSA-2003:030 vendor-advisory