Home    |    View Topics    |    Search    |    Contact Us    |   



Category:   OS (UNIX)  >   FreeBSD Kernel Vendors:   FreeBSD
FreeBSD bsdiff Heap Overflow in Processing Patch Files Lets Remote Users Execute Arbitrary Code
SecurityTracker Alert ID:  1036438
SecurityTracker URL:
CVE Reference:   CVE-2014-9862   (Links to External Site)
Date:  Jul 25 2016
Impact:   Execution of arbitrary code via network, User access via network
Fix Available:  Yes  Vendor Confirmed:  Yes  
Version(s): 9.3, 10.1, 10.2, 10.3
Description:   A vulnerability was reported in FreeBSD bsdiff. A remote user can cause arbitrary code to be executed on the target user's system.

A remote user can create a specially crafted patch file that, when loaded by the target user via bspatch, will trigger a heap overflow and execute arbitrary code on the target system. The code will run with the privileges of the target user.

The Chromium Project and Lu Tung-Pin separately reported this vulnerability.

Impact:   A remote user can create a patch file that, when loaded by the target user, will execute arbitrary code on the target user's system.
Solution:   FreeBSD has issued a fix.

The FreeBSD advisory is available at:

Vendor URL: (Links to External Site)
Cause:   Boundary error

Message History:   None.

 Source Message Contents

Subject:  FreeBSD Security Advisory FreeBSD-SA-16:25.bspatch

Hash: SHA512

FreeBSD-SA-16:25.bspatch                                    Security Advisory
                                                          The FreeBSD Project

Topic:          Heap vulnerability in bspatch

Category:       core
Module:         bsdiff
Announced:      2016-07-25
Affects:        All supported versions of FreeBSD.
Corrected:      2016-07-25 14:52:12 UTC (stable/11, 11.0-BETA2-p1)
                2016-07-25 14:52:12 UTC (stable/11, 11.0-BETA1-p1)
                2016-07-25 14:53:04 UTC (stable/10, 10.3-STABLE)
                2016-07-25 15:04:17 UTC (releng/10.3, 10.3-RELEASE-p6)
                2016-07-25 15:04:17 UTC (releng/10.2, 10.2-RELEASE-p20)
                2016-07-25 15:04:17 UTC (releng/10.1, 10.1-RELEASE-p37)
                2016-07-25 14:53:04 UTC (stable/9, 9.3-STABLE)
                2016-07-25 15:04:17 UTC (releng/9.3, 9.3-RELEASE-p45)
CVE Name:       CVE-2014-9862

For general information regarding FreeBSD Security Advisories,
including descriptions of the fields above, security branches, and the
following sections, please visit <URL:>.

I.   Background

The bspatch utility generates newfile from oldfile and patchfile where
patchfile is a binary patch built by bsdiff(1).

II.  Problem Description

The implementation of bspatch does not check for a negative value on numbers
of bytes read from the diff and extra streams, allowing an attacker who
can control the patch file to write at arbitrary locations in the heap.

This issue was first discovered by The Chromium Project and reported
independently by Lu Tung-Pin to the FreeBSD project.

III. Impact

An attacker who can control the patch file can cause a crash or run arbitrary
code under the credentials of the user who runs bspatch, in many cases, root.

IV.  Workaround

No workaround is available.

V.   Solution

Perform one of the following:

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

No reboot is needed.

2) To update your vulnerable 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

No reboot is needed.

3) To update your vulnerable 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.

# fetch
# fetch
# gpg --verify bspatch.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:>.

VI.  Correction details

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

Branch/path                                                      Revision
- -------------------------------------------------------------------------
stable/9/                                                         r303301
releng/9.3/                                                       r303304
stable/10/                                                        r303301
releng/10.1/                                                      r303304
releng/10.2/                                                      r303304
releng/10.3/                                                      r303304
stable/11/                                                        r303300
- -------------------------------------------------------------------------

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
Version: GnuPG v2.1.13 (FreeBSD)

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

Go to the Top of This SecurityTracker Archive Page

Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2022, LLC