Modify

#1139 new defect

Jabber: account gets disconnected upon reception of invalid unicode character

Reported by: tohwiq@… Owned by: wilmer
Priority: minor Milestone:
Component: Jabber Version: 3.2.1
Keywords: Cc: tohwiq@…
IRC client+version: Client-independent Operating System: Linux
OS version/distro: Raspbian 7

Description

If someone in a Jabber chatroom has fun sending invalid unicode characters (U+FDD0..U+FDEF), the account gets disconnected with the following error: "jabber - Error: XML stream error"
As the message will be received again when joining the chatroom, it makes it impossible to join it back before enough messages have been sent by other participants of the chatroom.
This is really annoying, as it allows anyone to kick a bitlbee user out of a chatroom.

I'm not sure if it can only happen in chatroom or even only in Jabber.

Attachments (0)

Change History (2)

comment:1 Changed at 2014-03-09T14:02:23Z by wilmer

Yikes, sounds like a fun issue in the GLib XML parser, and/or your Jabber server being too permissive (shouldn't pass through invalid Unicode either!).

I don't think the GLib XML parser has any way to just pass this data through (and possibly iconv would choke on it later anyway), so BitlBee would have to do manual filtering. :-(

comment:2 Changed at 2014-12-07T05:46:51Z by dx

Priority: normalminor

Bitlbee wouldn't let me send invalid utf-8 because it failed the charset check. My prosody test server aborted the connection with "Stream error: not-well-formed" when sending it invalid utf-8.

I just modified the input in jabber_read_callback instead (break after the read, change one byte of the message body to \xff), and the error is right after it, in the xt_feed call which calls g_markup_parse_context_parse, which has docs that say:

The data need not be valid UTF-8; an error will be signaled if it's invalid. The data need not be an entire document; you can feed a document into the parser incrementally, via multiple calls to this function. Typically, as you receive data from a network connection or file, you feed each received chunk of data into this function, aborting the process if an error occurs. Once an error is reported, no further data may be fed to the GMarkupParseContext; all errors are fatal

So according to glib's docs, everything is okay...

Modify Ticket

Action
as new The owner will remain wilmer.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.