CVE-2016-4448 - Use of Externally-Controlled Format String

Severity

98%

Complexity

39%

Confidentiality

98%

Format string vulnerability in libxml2 before 2.9.4 allows attackers to have unspecified impact via format string specifiers in unknown vectors.

Format string vulnerability in libxml2 before 2.9.4 allows attackers to have unspecified impact via format string specifiers in unknown vectors.

CVSS 3.1 Base Score 9.8. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

CVSS 2.0 Base Score 9.9. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (AV:N/AC:L/Au:N/C:C/I:C/A:C).

Demo Examples

Use of Externally-Controlled Format String

CWE-134

The following program prints a string provided as an argument.


               
}
printf(string);
return (0);

The example is exploitable, because of the call to printf() in the printWrapper() function. Note: The stack buffer was added to make exploitation more simple.

Use of Externally-Controlled Format String

CWE-134

The following code copies a command line argument into a buffer using snprintf().


               
}
snprintf(buf,128,argv[1]);

This code allows an attacker to view the contents of the stack and write to the stack using a command line argument containing a sequence of formatting directives. The attacker can read from the stack by providing more formatting directives, such as %x, than the function takes as arguments to be formatted. (In this example, the function takes no arguments to be formatted.) By using the %n formatting directive, the attacker can write to the stack, causing snprintf() to write the number of bytes output thus far to the specified argument (rather than reading a value from the argument, which is the intended behavior). A sophisticated version of this attack will use four staggered writes to completely control the value of a pointer on the stack.

Use of Externally-Controlled Format String

CWE-134

Certain implementations make more advanced attacks even easier by providing format directives that control the location in memory to read from or write to. An example of these directives is shown in the following code, written for glibc:


               
printf("%d %d %1$d %1$d\n", 5, 9);

This code produces the following output: 5 9 5 5 It is also possible to use half-writes (%hn) to accurately control arbitrary DWORDS in memory, which greatly reduces the complexity needed to execute an attack that would otherwise require four staggered writes, such as the one mentioned in the first example.

Overview

First reported 8 years ago

2016-06-09 16:59:00

Last updated 5 years ago

2019-12-27 16:08:00

Affected Software

Apple Mac OS X

XMLSoft Libxml2

Red Hat Enterprise Linux Desktop 6.0

6.0

RedHat Enterprise Linux Desktop 7.0

7.0

Red Hat Enterprise Linux Server 6.0

6.0

RedHat Enterprise Linux Server 7.0

7.0

Red Hat Enterprise Linux Server AUS 7.2

7.2

Red Hat Enterprise Linux Advanced mission critical Update Support (AUS) 7.3

7.3

Red Hat Enterprise Linux Server Advanced mission critical Update Support (AUS) 7.4

7.4

Red Hat Enterprise Linux Server Advanced mission critical Update Support (AUS) 7.6

7.6

Red Hat Enterprise Linux Server EUS 7.2

7.2

Red Hat Enterprise Linux Server Extended Update Support (EUS) 7.3

7.3

Red Hat Enterprise Linux Server Extended Update Support (EUS) 7.4

7.4

Red Hat Enterprise Linux Server Extended Update Support (EUS) 7.5

7.5

Red Hat Enterprise Linux Server Extended Update Support (EUS) 7.6

7.6

Red Hat Enterprise Linux Server Telecommunications Update Service (TUS) 7.6

7.6

Red Hat Enterprise Linux Workstation 6.0

6.0

RedHat Enterprise Linux Workstation 7.0

7.0

Slackware Linux 14.0

14.0

Slackware Linux 14.1

14.1

Tenable Log Correlation Engine 4.8.0

4.8.0

Oracle Linux 7.0

7

References

APPLE-SA-2016-07-18-1

Mailing List, Release Notes

APPLE-SA-2016-07-18-2

Mailing List, Release Notes

APPLE-SA-2016-07-18-3

Mailing List, Release Notes

APPLE-SA-2016-07-18-4

Mailing List, Release Notes

APPLE-SA-2016-07-18-6

Mailing List, Release Notes

RHSA-2016:2957

Third Party Advisory

[oss-security] 20160525 3 libxml2 issues

Mailing List, Third Party Advisory

http://www.oracle.com/technetwork/topics/security/bulletinjul2016-3090568.html

Third Party Advisory

http://www.oracle.com/technetwork/topics/security/linuxbulletinjul2016-3090544.html

Third Party Advisory

http://www.oracle.com/technetwork/topics/security/ovmbulletinjul2016-3090546.html

Vendor Advisory

90856

Third Party Advisory, VDB Entry

1036348

Third Party Advisory, VDB Entry

SSA:2016-148-01

Third Party Advisory

http://xmlsoft.org/news.html

Release Notes

RHSA-2016:1292

Third Party Advisory

https://bugzilla.redhat.com/show_bug.cgi?id=1338700

Issue Tracking, Third Party Advisory

https://git.gnome.org/browse/libxml2/commit/?id=4472c3a5a5b516aaf59b89be602fbce52756c3e9

Vendor Advisory

https://git.gnome.org/browse/libxml2/commit/?id=502f6a6d08b08c04b3ddfb1cd21b2f699c1b7f5b

Vendor Advisory

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05194709

Third Party Advisory

https://kc.mcafee.com/corporate/index?page=content&id=SB10170

Third Party Advisory

https://support.apple.com/HT206899

Release Notes

https://support.apple.com/HT206901

Release Notes

https://support.apple.com/HT206902

Release Notes

https://support.apple.com/HT206903

Release Notes

https://support.apple.com/HT206904

Release Notes

https://support.apple.com/HT206905

Release Notes

https://www.tenable.com/security/tns-2016-18

Third Party Advisory

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.