deadsimple BSD Security Advisories and Announcements

FreeBSD Errata Notice FreeBSD-EN-18:02.file

Hash: SHA512

FreeBSD-EN-18:02.file                                           Errata Notice
                                                          The FreeBSD Project

Topic:          Version and security update of file(1) and libmagic(3)

Category:       contrib
Module:         file
Announced:      2018-03-07
Affects:        All supported versions of FreeBSD.
Corrected:      2018-02-05 08:20:11 UTC (stable/11, 11.1-STABLE)
                2018-03-07 06:04:25 UTC (releng/11.1, 11.1-RELEASE-p7)
                2018-02-05 08:50:34 UTC (stable/10, 10.4-STABLE)
                2018-03-07 06:04:25 UTC (releng/10.4, 10.4-RELEASE-p6)
                2018-03-07 06:04:25 UTC (releng/10.3, 10.3-RELEASE-p27)
CVE Name:       CVE-2017-1000249

For general information regarding FreeBSD Errata Notices and Security
Advisories, including descriptions of the fields above, security
branches, and the following sections, please visit

I.   Background

The file(1) utility attempts to classify file system objects based on
filesystem, magic number and language tests.

The libmagic(3) library provides most of the functionality of file(1) and
may be used by other applications.

II.  Problem Description

The file(1) utility contains a stack based buffer overflow when parsing
a specially crafted input file.

III. Impact

The issue lets an attacker overwrite a fixed 20 bytes stack buffer with
with a specially crafted .notes section in an ELF binary file.

IV.  Workaround

No workaround is available, but systems where file(1) and other applications
using libmagic(3) are never run on untrusted input are not vulnerable.

V.   Solution

Perform one of the following:

1) Upgrade your system to a supported FreeBSD stable or release / security
branch (releng) dated after the correction date.

2) To update your system via a binary patch:

Systems running a RELEASE version of FreeBSD on the i386 or amd64
platforms can be updated via the freebsd-update(8) utility:

# freebsd-update fetch
# freebsd-update install

3) To update your system via a source code patch:

The following patches have been verified to apply to the applicable
FreeBSD release branches.

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.

[FreeBSD 10.3]
# fetch
# fetch
# gpg --verify file-10.3.patch.asc

[FreeBSD 10.4]
# fetch
# fetch
# gpg --verify file-10.4.patch.asc

[FreeBSD 11.1]
# fetch
# fetch
# gpg --verify file-11.patch.asc

b) Apply the patch.  Execute the following commands as root:

# cd /usr/src
# patch < /path/to/patch

c) Recompile the operating system using buildworld and installworld as
described in <URL:>.

Restart all daemons that use the library, or reboot the system.

VI.  Correction details

The following list contains the correction revision numbers for each
affected branch.

Branch/path                                                      Revision
- -------------------------------------------------------------------------
stable/10/                                                        r328875
releng/10.3/                                                      r330569
releng/10.4/                                                      r330569
stable/11/                                                        r328874
releng/11.1/                                                      r330569
- -------------------------------------------------------------------------

To see which files were modified by a particular revision, run the
following command, replacing NNNNNN with the revision number, on a
machine with Subversion installed:

# svn diff -cNNNNNN --summarize svn://

Or visit the following URL, replacing NNNNNN with the revision number:


VII. References


The latest revision of this advisory is available at

_______________________________________________ mailing list
To unsubscribe, send any mail to ""