Bug 1392939 (CVE-2016-9379, CVE-2016-9380, xsa198)

Summary: CVE-2016-9379 CVE-2016-9380 xsa198 xen: delimiter injection vulnerabilities in pygrub (XSA-198)
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: security-response-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-07 10:14:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1397383    
Bug Blocks: 1392955    
Attachments:
Description Flags
All Xen versions (at least Xen 4.4 and later) patch none

Description Adam Mariš 2016-11-08 13:57:11 UTC
ISSUE DESCRIPTION
=================

pygrub, the boot loader emulator, fails to quote (or sanity check) its
results when reporting them to its caller.

pygrub supports a number of output formats.  When the S-expression
output format is requested, putting string quotes and S-expressions in
the bootloader configuration file can produce incorrect output.

When the nul-delimited output format is requested, nul bytes in the
bootloader configuration file can produce an ambiguous or confusing
output file, which is interpreted by libxl in a vulnerable way.

The existing bootloader config interpreters all read input in a
line-based way from their bootloaders, and none of them support any
kind of escaping.  So the newline-delimited output format is safe.

The attacker can use this to cause the toolstack to treat any file
accessible to the toolstack as if it were the guest's initial ramdisk
file.  The file contents are provided to the guest kernel; also,
normally, these files are deleted by the toolstack as the guest starts
to boot; alternatively they may be deleted later.

IMPACT
======

A malicious guest administrator can obtain the contents of sensitive
host files (an information leak).

Additionally, a malicious guest administrator can cause files on the
host to be removed, causing a denial of service.  In some unusual host
configurations, ability to remove certain files may be useable for
privilege escalation.


VULNERABLE SYSTEMS
==================

Xen versions 2.0 and later are vulnerable.

The vulnerability is only exposed to guests configured by the host
administrator to boot using pygrub.  In the xl and xm domain
configuration file, this is typically achieved with
bootloader="pygrub"
On x86 this would typically apply only to PV domains.

All systems using xl, libxl, or libvirt are vulnerable to pygrub-using
guests.

Systems using other (third-party) toolstacks may or may not be
vulnerable, depending on whether pygrub is configured, and what pygrub
output format they use.  Please consult your toolstack provider.


MITIGATION
==========

Configuring guests not to use pygrub will avoid the vulnerability.

For x86 PV guests currently using pygrub, booting the guest as HVM
is often a practical option to avoid pygrub.


External References:

http://xenbits.xen.org/xsa/advisory-198.html

Acknowledgements:

Name: the Xen project
Upstream: Daniel Richman (the Cambridge University Student-Run Computing Facility), Gábor Szarka (the Cambridge University Student-Run Computing Facility)

Comment 1 Adam Mariš 2016-11-08 14:45:25 UTC
Created attachment 1218546 [details]
All Xen versions (at least Xen 4.4 and later) patch

Comment 2 Martin Prpič 2016-11-22 12:25:09 UTC
Created xen tracking bugs for this issue:

Affects: fedora-all [bug 1397383]