Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#5768 closed patch (fixed)

disconnect while sending a ascii chars like this

Reported by: ceplus Owned by: deryni
Milestone: 2.6.0 Component: XMPP
Version: 2.4.1 Keywords: disconnect
Cc: akrherz


Disconnect while sending a message like this It happens with all ascii chars. Tested only with jabber plugin.

Attachments (1)

strip-invalid-entities.patch (2.0 KB) - added by darkrain42 10 years ago.
Strip non-printable characters from outgoing XMPP IMs

Download all attachments as: .zip

Change History (11)

comment:1 Changed 11 years ago by deryni

  • pending changed from 0 to 1

The rafb link is now dead. Please submit the information here (ideally with the output of the Debug Window for when you send the message).

comment:2 Changed 11 years ago by ceplus

  • pending changed from 1 to 0

it happens when i send for example '' to somebody


(19:56:47) xmlnode: Error parsing xml file: PCDATA invalid Char value 23

(19:56:47) jabber: XHTML translation/validation failed, returning: <html xmlns=''><body xmlns=''></body></html>
(19:56:47) jabber: Sending (ssl): <message type='chat' id='purple5ad5bde2' to=''><x xmlns='jabber:x:event'><composing/></x><active xmlns=''/><body>&#x17;</body></message>
(19:56:47) jabber: Sending (ssl): <message type='chat' id='purple5ad5bde3' to=''><x xmlns='jabber:x:event'/><active xmlns=''/></message>
(19:56:47) jabber: Recv (ssl)(237): <stream:error xmlns:stream=''><xml-not-well-formed xmlns='urn:ietf:params:xml:ns:xmpp-streams'/><text xmlns='urn:ietf:params:xml:ns:xmpp-streams'>reference to invalid character number</text></stream:error>
(19:56:47) jabber: Recv (ssl)(16): </stream:stream>
(19:56:47) account: Disconnecting account 0x8177110
(19:56:47) connection: Disconnecting connection 0x8629078
(19:56:47) connection: Deactivating keepalive.
(19:56:47) connection: Destroying connection 0x8629078
(19:56:48) sighandler: Caught signal 2

comment:3 Changed 11 years ago by deryni

  • Owner changed from lschiere to deryni

How are you entering that character? Why are you entering it? And given that pidgin isn't correctly preventing you from sending it the server is correct in disconnecting you. I don't believe sending that character as that entity on XMPP is allowed per the XMPP RFCs. I'm unsure what pidgin should be doing about it here though, I don't know if there is some other way of sending it or whether pidgin should just be dropping it or what. I'll need to look into that.

comment:4 Changed 10 years ago by deryni

Ticket #6879 has been marked as a duplicate of this ticket.

comment:5 Changed 10 years ago by deryni

Ticket #9003 has been marked as a duplicate of this ticket.

comment:6 Changed 10 years ago by darkrain42

  • Component changed from unclassified to XMPP
  • Milestone set to Patches Needing Review
  • Type changed from defect to patch

The attached patch strips non-printable unichar characters from outgoing IMs (if it's the right solution, it needs to be stuffed into send_chat, too). My personal preference is to strip out the invalid data, as the cases where I imagine this happening involve accidental inclusion of non-printable characters due to pasting, but I don't know if that's the Right Thing to do.

comment:7 Changed 10 years ago by akrherz

Thanks darkrain42. yes, in our particular case, somebody pasted some text from Acrobat into Pidgin and got &#1;x1; sent up to the server.

Changed 10 years ago by darkrain42

Strip non-printable characters from outgoing XMPP IMs

comment:8 Changed 10 years ago by aaaaaaaaaa

I think it should be done in function purple_markup_html_to_xhtml() - it's supposed to output XHTML, XHTML is XML and is not allowed to contain XML-illegal chars.

BTW: problem also affects Adium:

comment:9 Changed 10 years ago by darkrain42@…

  • Milestone changed from Patches Needing Review to 2.6.0
  • Resolution set to fixed
  • Status changed from new to closed

(In e1bd4479e6211023f43781c3f4864d56fc9bb1b3):
Add purple_utf8_strip_unprintables and use it on outgoing XMPP messages.

We will no longer send messages which contain entities considered invalid in XML 1.0 (i.e. &#x1; and other ASCII control characters). Closes #5768.

comment:10 Changed 10 years ago by darkrain42

Ticket #9398 has been marked as a duplicate of this ticket.

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!