[OSSA 2013-023] Potential unsafe XML usage (CVE-2013-4179, CVE-2013-4202)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
High
|
Thierry Carrez | ||
Grizzly |
Fix Released
|
High
|
Thierry Carrez | ||
OpenStack Compute (nova) |
Fix Released
|
High
|
Michael Still | ||
Grizzly |
Fix Released
|
High
|
Thierry Carrez | ||
OpenStack Security Advisory |
Fix Released
|
Medium
|
Thierry Carrez | ||
neutron |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Grant Murphy (<email address hidden>) conducted an audit of OpenStack and reported the following potential XML related vulnerabilities. These may well not be exploitable, we need to doublecheck them.
=======
Issue #1 (CWE-776) - Widespread and inconsistent usage of XML libraries that are vulnerable to various XML resource exhaustion attack vectors. This was mostly addressed in bug 1100282 however I can still find instances of minidom.parseString used directly in contributors code:
nova/nova/
1640: dom = minidom.
1657: dom = minidom.
nova/nova/
1501: rrd = minidom.
1542: doc = minidom.
nova/nova/
542: root = minidom.
nova/nova/
76: dom = minidom.
cinder/
85: dom = minidom.
104: dom = minidom.
cinder/
65: dom = minidom.
83: dom = minidom.
Furthermore there are inconsistencies in the fix between components. For example in Quantum they use a ProtectedXMLParser in quantum/
class ProtectedXMLPar
def __init__(self, *args, **kwargs):
def start_doctype_
raise ValueError(
def doctype(self, name, pubid, system):
raise ValueError(
Although etree.XMLParser does not automatically expand external entities by default it is vulnerable to billion laughs and quadratic blowup according to the diffusedxml documentation. (I'm not sure this is still accurate though).
For consistency alone I would recommend shifting these libraries across the board:
- https:/
- https:/
=======
Issue #2 (CWE-112)- Missing schema validation. There are several instances where XML data is processed from an external source that is not validated against an XML schema. This is a best practice that should be considered.
=======
Issue #3 (Probably not a bug)- HTTP parameters used directly in XML output. The output appears to use sax.xhtml_escape so in theory is safe. Could use a whitelist reject unexpected input.
The case I'm specifically talking about is the BucketHandler class in nova/nova/
prefix = self.request.
marker = self.request.
And uses these values directly in render_xml (results sent to end user).
This one is probably harmless but thought I'd mention it anyway.
Related branches
Changed in ossa: | |
status: | New → Incomplete |
Changed in ossa: | |
importance: | Undecided → Medium |
Changed in neutron: | |
status: | Incomplete → Invalid |
Changed in cinder: | |
assignee: | nobody → John Griffith (john-griffith) |
importance: | Undecided → High |
Changed in ossa: | |
status: | Triaged → In Progress |
summary: |
- Potential unsafe XML usage + Potential unsafe XML usage (CVE-2013-4179) |
information type: | Private Security → Public Security |
summary: |
- Potential unsafe XML usage (CVE-2013-4179, CVE-2013-4202) + [OSSA 2013-023] Potential unsafe XML usage (CVE-2013-4179, + CVE-2013-4202) |
Changed in ossa: | |
status: | Fix Committed → Fix Released |
Changed in cinder: | |
milestone: | none → havana-3 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | none → havana-3 |
status: | Fix Committed → Fix Released |
Changed in cinder: | |
milestone: | havana-3 → 2013.2 |
Changed in nova: | |
milestone: | havana-3 → 2013.2 |
Analysis in Nova:
nova/nova/ virt/libvirt/ driver. py
What's getting parsed is XML from libvirt, not user-provided XML requests. So that's safe.
nova/nova/ virt/xenapi/ vm_utils. py
What's getting parsed is XML from XenServer, not user-provided XML requests, so that's safe.
nova/nova/ api/openstack/ compute/ contrib/ security_ groups. py safe_minidom_ parse_string (which is safe), there is one call in _extend_servers that still uses minidom. parseString( req.body) and therefore looks vulnerable.
While most calls use xmlutil.
nova/nova/ api/openstack/ compute/ contrib/ security_ group_default_ rules.py
Uses pure minidom in its XML deserializer, so probably vulnerable.