The ELF parser (readelf.c) in file before 5.21 allows remote attackers to cause a denial of service (CPU consumption or crash) via a large number of (1) program or (2) section headers or (3) invalid capabilities.
https://www.freebsd.org/security/advisories/FreeBSD-SA-14:28.file.asc
https://github.com/file/file/commit/d7cdad007c507e6c79f51f058dd77fab70ceb9f6
https://github.com/file/file/commit/b4c01141e5367f247b84dcaf6aefbb4e741842b8
https://github.com/file/file/blob/00cef282a902a4a6709bbbbb933ee397768caa38/ChangeLog
http://www.ubuntu.com/usn/USN-2494-1
http://www.securitytracker.com/id/1031344
http://www.securityfocus.com/bid/71700
http://www.oracle.com/technetwork/topics/security/linuxbulletinoct2015-2719645.html
http://www.oracle.com/technetwork/topics/security/linuxbulletinapr2016-2952096.html
http://secunia.com/advisories/62081
http://secunia.com/advisories/61944
http://seclists.org/oss-sec/2014/q4/1056