Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up[CVE-2019-1000007] xso: fix parser error handling #268
Conversation
horazont
requested a review
from
sebastianriese
Jan 10, 2019
horazont
added
the
bug
label
Jan 10, 2019
horazont
added this to the v0.11 milestone
Jan 10, 2019
horazont
self-assigned this
Jan 10, 2019
This comment has been minimized.
This comment has been minimized.
Backport prepared as f151f92. |
This comment has been minimized.
This comment has been minimized.
Backport released in v0.10.3. |
horazont
merged commit 29ff083
into
devel
Jan 12, 2019
This comment has been minimized.
This comment has been minimized.
This has been assigned CVE-2019-1000007. |
horazont
changed the title
xso: fix parser error handling
[CVE-2019-1000007] xso: fix parser error handling
Jan 23, 2019
horazont
deleted the
feature/fix-guard
branch
Jan 23, 2019
horazont
restored the
feature/fix-guard
branch
Jan 26, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
horazont commentedJan 10, 2019
Needs backport to 0.10!
guard() was incorrectly counting the depth when either of the following was true:
the error occured inside the first "start" event on which guard() is used: in that case, guard() would fail to swallow the corresponding "end" event.
after an error, further elements appear in the stream before the guard()-ed element is over. in that case, guard() would fail to account for the "start" events caused by those events, and thus let its depth counter go entirely out-of-sync with the XML tree
If this flaw is combined with the use of a supressing
xso_error_handler
, it is possible to make elements appear higher up in the XML stream tree than they actually are; this implies that it is possible to inject elements in the XML stream.It requires very specific circumstances for an application to be vulnerable. Example of a vulnerable XSO definition is:
If an attacker sends (formatted for readability):
to an application which has the above XSO definition loaded, it will see the "end" event of the
</iq>
on the stream level, breaking the XML stream (because it expects a "start" event instead of an "end" event).More sophisticated attacks could be used to make an element appear on the stream level instead, which would open the possibility of injecting, for example,
<message>
stanzas remotely into the stream of a vulnerable aioxmpp client, with arbitrary sender.