CVE Vulnerabilities

CVE-2016-4472

Improper Restriction of Operations within the Bounds of a Memory Buffer

Published: Jun 30, 2016 | Modified: Nov 07, 2023
CVSS 3.x
8.1
HIGH
Source:
NVD
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.x
6.8 MEDIUM
AV:N/AC:M/Au:N/C:P/I:P/A:P
RedHat/V2
5.1 MODERATE
AV:N/AC:H/Au:N/C:P/I:P/A:P
RedHat/V3
Ubuntu
MEDIUM

The overflow protection in Expat is removed by compilers with certain optimization settings, which allows remote attackers to cause a denial of service (crash) or possibly execute arbitrary code via crafted XML data. NOTE: this vulnerability exists because of an incomplete fix for CVE-2015-1283 and CVE-2015-2716.

Weakness

The product performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer.

Affected Software

Name Vendor Start Version End Version
Libexpat Libexpat_project * 2.1.1 (including)
Audacity Ubuntu kinetic *
Audacity Ubuntu lunar *
Audacity Ubuntu mantic *
Ayttm Ubuntu esm-apps/xenial *
Ayttm Ubuntu precise *
Ayttm Ubuntu trusty *
Ayttm Ubuntu wily *
Ayttm Ubuntu xenial *
Ayttm Ubuntu yakkety *
Cableswig Ubuntu esm-apps/xenial *
Cableswig Ubuntu precise *
Cableswig Ubuntu trusty *
Cableswig Ubuntu wily *
Cableswig Ubuntu xenial *
Cadaver Ubuntu artful *
Cadaver Ubuntu bionic *
Cadaver Ubuntu cosmic *
Cadaver Ubuntu devel *
Cadaver Ubuntu disco *
Cadaver Ubuntu eoan *
Cadaver Ubuntu esm-apps/bionic *
Cadaver Ubuntu esm-apps/focal *
Cadaver Ubuntu esm-apps/jammy *
Cadaver Ubuntu esm-apps/noble *
Cadaver Ubuntu esm-apps/xenial *
Cadaver Ubuntu focal *
Cadaver Ubuntu groovy *
Cadaver Ubuntu hirsute *
Cadaver Ubuntu impish *
Cadaver Ubuntu jammy *
Cadaver Ubuntu kinetic *
Cadaver Ubuntu lunar *
Cadaver Ubuntu mantic *
Cadaver Ubuntu noble *
Cadaver Ubuntu oracular *
Cadaver Ubuntu precise *
Cadaver Ubuntu trusty *
Cadaver Ubuntu wily *
Cadaver Ubuntu xenial *
Cadaver Ubuntu yakkety *
Cadaver Ubuntu zesty *
Coin3 Ubuntu artful *
Coin3 Ubuntu bionic *
Coin3 Ubuntu cosmic *
Coin3 Ubuntu devel *
Coin3 Ubuntu disco *
Coin3 Ubuntu eoan *
Coin3 Ubuntu esm-apps/bionic *
Coin3 Ubuntu esm-apps/focal *
Coin3 Ubuntu esm-apps/jammy *
Coin3 Ubuntu esm-apps/noble *
Coin3 Ubuntu esm-apps/xenial *
Coin3 Ubuntu esm-infra-legacy/trusty *
Coin3 Ubuntu focal *
Coin3 Ubuntu groovy *
Coin3 Ubuntu hirsute *
Coin3 Ubuntu impish *
Coin3 Ubuntu jammy *
Coin3 Ubuntu kinetic *
Coin3 Ubuntu lunar *
Coin3 Ubuntu mantic *
Coin3 Ubuntu noble *
Coin3 Ubuntu oracular *
Coin3 Ubuntu precise *
Coin3 Ubuntu trusty *
Coin3 Ubuntu trusty/esm *
Coin3 Ubuntu wily *
Coin3 Ubuntu xenial *
Coin3 Ubuntu yakkety *
Coin3 Ubuntu zesty *
Expat Ubuntu vivid/stable-phone-overlay *
Expat Ubuntu vivid/ubuntu-core *
Insighttoolkit Ubuntu esm-apps/xenial *
Insighttoolkit Ubuntu precise *
Insighttoolkit Ubuntu trusty *
Insighttoolkit Ubuntu wily *
Insighttoolkit Ubuntu xenial *
Kompozer Ubuntu precise *
Libparagui1.1 Ubuntu precise *
Libxmltok Ubuntu bionic *
Libxmltok Ubuntu devel *
Libxmltok Ubuntu esm-apps/bionic *
Libxmltok Ubuntu esm-apps/focal *
Libxmltok Ubuntu esm-apps/jammy *
Libxmltok Ubuntu esm-apps/noble *
Libxmltok Ubuntu esm-apps/xenial *
Libxmltok Ubuntu focal *
Libxmltok Ubuntu hirsute *
Libxmltok Ubuntu impish *
Libxmltok Ubuntu jammy *
Libxmltok Ubuntu kinetic *
Libxmltok Ubuntu lunar *
Libxmltok Ubuntu mantic *
Libxmltok Ubuntu noble *
Libxmltok Ubuntu oracular *
Libxmltok Ubuntu trusty *
Libxmltok Ubuntu xenial *
Matanza Ubuntu artful *
Matanza Ubuntu bionic *
Matanza Ubuntu cosmic *
Matanza Ubuntu devel *
Matanza Ubuntu disco *
Matanza Ubuntu eoan *
Matanza Ubuntu esm-apps/bionic *
Matanza Ubuntu esm-apps/focal *
Matanza Ubuntu esm-apps/jammy *
Matanza Ubuntu esm-apps/noble *
Matanza Ubuntu esm-apps/xenial *
Matanza Ubuntu focal *
Matanza Ubuntu groovy *
Matanza Ubuntu hirsute *
Matanza Ubuntu impish *
Matanza Ubuntu jammy *
Matanza Ubuntu kinetic *
Matanza Ubuntu lunar *
Matanza Ubuntu mantic *
Matanza Ubuntu noble *
Matanza Ubuntu oracular *
Matanza Ubuntu precise *
Matanza Ubuntu trusty *
Matanza Ubuntu wily *
Matanza Ubuntu xenial *
Matanza Ubuntu yakkety *
Matanza Ubuntu zesty *
Simgear Ubuntu precise *
Sitecopy Ubuntu artful *
Sitecopy Ubuntu precise *
Sitecopy Ubuntu trusty *
Sitecopy Ubuntu wily *
Sitecopy Ubuntu yakkety *
Sitecopy Ubuntu zesty *
Swish-e Ubuntu artful *
Swish-e Ubuntu bionic *
Swish-e Ubuntu cosmic *
Swish-e Ubuntu devel *
Swish-e Ubuntu disco *
Swish-e Ubuntu eoan *
Swish-e Ubuntu esm-apps/bionic *
Swish-e Ubuntu esm-apps/focal *
Swish-e Ubuntu esm-apps/jammy *
Swish-e Ubuntu esm-apps/noble *
Swish-e Ubuntu esm-apps/xenial *
Swish-e Ubuntu focal *
Swish-e Ubuntu groovy *
Swish-e Ubuntu hirsute *
Swish-e Ubuntu impish *
Swish-e Ubuntu jammy *
Swish-e Ubuntu kinetic *
Swish-e Ubuntu lunar *
Swish-e Ubuntu mantic *
Swish-e Ubuntu noble *
Swish-e Ubuntu oracular *
Swish-e Ubuntu precise *
Swish-e Ubuntu trusty *
Swish-e Ubuntu wily *
Swish-e Ubuntu xenial *
Swish-e Ubuntu yakkety *
Swish-e Ubuntu zesty *
Tdom Ubuntu artful *
Tdom Ubuntu precise *
Tdom Ubuntu trusty *
Tdom Ubuntu wily *
Tdom Ubuntu yakkety *
Tdom Ubuntu zesty *
Tla Ubuntu artful *
Tla Ubuntu precise *
Tla Ubuntu wily *
Tla Ubuntu yakkety *
Tla Ubuntu zesty *
Vnc4 Ubuntu artful *
Vnc4 Ubuntu bionic *
Vnc4 Ubuntu cosmic *
Vnc4 Ubuntu disco *
Vnc4 Ubuntu eoan *
Vnc4 Ubuntu esm-apps/bionic *
Vnc4 Ubuntu esm-apps/xenial *
Vnc4 Ubuntu esm-infra-legacy/trusty *
Vnc4 Ubuntu precise *
Vnc4 Ubuntu trusty *
Vnc4 Ubuntu trusty/esm *
Vnc4 Ubuntu upstream *
Vnc4 Ubuntu wily *
Vnc4 Ubuntu xenial *
Vnc4 Ubuntu yakkety *
Vnc4 Ubuntu zesty *
Vtk Ubuntu precise *
Vtk Ubuntu wily *
Wbxml2 Ubuntu artful *
Wbxml2 Ubuntu precise *
Wbxml2 Ubuntu trusty *
Wbxml2 Ubuntu wily *
Wbxml2 Ubuntu yakkety *
Wbxml2 Ubuntu zesty *
Wxwidgets2.6 Ubuntu precise *
Wxwidgets2.8 Ubuntu precise *
Wxwidgets2.8 Ubuntu wily *
Xmlrpc-c Ubuntu artful *
Xmlrpc-c Ubuntu bionic *
Xmlrpc-c Ubuntu cosmic *
Xmlrpc-c Ubuntu devel *
Xmlrpc-c Ubuntu disco *
Xmlrpc-c Ubuntu eoan *
Xmlrpc-c Ubuntu esm-apps/bionic *
Xmlrpc-c Ubuntu esm-apps/focal *
Xmlrpc-c Ubuntu esm-apps/jammy *
Xmlrpc-c Ubuntu esm-apps/noble *
Xmlrpc-c Ubuntu esm-apps/xenial *
Xmlrpc-c Ubuntu esm-infra-legacy/trusty *
Xmlrpc-c Ubuntu focal *
Xmlrpc-c Ubuntu groovy *
Xmlrpc-c Ubuntu hirsute *
Xmlrpc-c Ubuntu impish *
Xmlrpc-c Ubuntu jammy *
Xmlrpc-c Ubuntu kinetic *
Xmlrpc-c Ubuntu lunar *
Xmlrpc-c Ubuntu mantic *
Xmlrpc-c Ubuntu noble *
Xmlrpc-c Ubuntu oracular *
Xmlrpc-c Ubuntu precise *
Xmlrpc-c Ubuntu trusty *
Xmlrpc-c Ubuntu trusty/esm *
Xmlrpc-c Ubuntu wily *
Xmlrpc-c Ubuntu xenial *
Xmlrpc-c Ubuntu yakkety *
Xmlrpc-c Ubuntu zesty *
Xotcl Ubuntu precise *

Extended Description

Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data. As a result, an attacker may be able to execute arbitrary code, alter the intended control flow, read sensitive information, or cause the system to crash.

Potential Mitigations

  • Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.

  • For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages, such as Ada and C#, typically provide overflow protection, but the protection can be disabled by the programmer.

  • Be wary that a language’s interface to native code may still be subject to overflows, even if the language itself is theoretically safe.

  • Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.

  • Examples include the Safe C String Library (SafeStr) by Messier and Viega [REF-57], and the Strsafe.h library from Microsoft [REF-56]. These libraries provide safer versions of overflow-prone string-handling functions.

  • Use automatic buffer overflow detection mechanisms that are offered by certain compilers or compiler extensions. Examples include: the Microsoft Visual Studio /GS flag, Fedora/Red Hat FORTIFY_SOURCE GCC flag, StackGuard, and ProPolice, which provide various mechanisms including canary-based detection and range/index checking.

  • D3-SFCV (Stack Frame Canary Validation) from D3FEND [REF-1334] discusses canary-based detection in detail.

  • Consider adhering to the following rules when allocating and managing an application’s memory:

  • Run or compile the software using features or extensions that randomly arrange the positions of a program’s executable and libraries in memory. Because this makes the addresses unpredictable, it can prevent an attacker from reliably jumping to exploitable code.

  • Examples include Address Space Layout Randomization (ASLR) [REF-58] [REF-60] and Position-Independent Executables (PIE) [REF-64]. Imported modules may be similarly realigned if their default memory addresses conflict with other modules, in a process known as “rebasing” (for Windows) and “prelinking” (for Linux) [REF-1332] using randomly generated addresses. ASLR for libraries cannot be used in conjunction with prelink since it would require relocating the libraries at run-time, defeating the whole purpose of prelinking.

  • For more information on these techniques see D3-SAOR (Segment Address Offset Randomization) from D3FEND [REF-1335].

  • Use a CPU and operating system that offers Data Execution Protection (using hardware NX or XD bits) or the equivalent techniques that simulate this feature in software, such as PaX [REF-60] [REF-61]. These techniques ensure that any instruction executed is exclusively at a memory address that is part of the code segment.

  • For more information on these techniques see D3-PSEP (Process Segment Execution Prevention) from D3FEND [REF-1336].

References