xml_body returns backtrace on XMLSyntaxError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Medium
|
David Höppner |
Bug Description
If password contain special character, for example '&', it will raise an exception when request authentication with xml body while authentication successfull with json body.
$curl -X POST -H Content-
The lxml lib raise an exception.
File "/opt/stack/
dom = etree.fromstrin
File "lxml.etree.pyx", line 2754, in lxml.etree.
File "parser.pxi", line 1578, in lxml.etree.
File "parser.pxi", line 1457, in lxml.etree.
File "parser.pxi", line 965, in lxml.etree.
File "parser.pxi", line 569, in lxml.etree.
File "parser.pxi", line 650, in lxml.etree.
File "parser.pxi", line 590, in lxml.etree.
XMLSyntaxError: EntityRef: expecting ';', line 1, column 115
$curl -X POST -H Content-
Authentication successfull.
Changed in keystone: | |
assignee: | nobody → David Höppner (0xffea) |
Changed in keystone: | |
status: | Fix Committed → Fix Released |
Changed in keystone: | |
milestone: | grizzly-rc1 → 2013.1 |
is that a literal ampersand? i tried the xml using an escaped ampersand ('[&]amp[;]') and it worked fine.
according to w3 specs, you must escape ampersand character for it to be valid xml (http:// www.w3. org/TR/ xml/#syntax):
The ampersand character (&) and the left angle bracket (<) must not appear in their literal form, except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped using either numeric character references or the strings " & " and " < " respectively. The right angle bracket (>) may be represented using the string " > ", and must, for compatibility, be escaped using either " > " or a character reference when it appears in the string " ]]> " in content, when that string is not marking the end of a CDATA section.