According to RFC 3920 (Page 51) an 'id' attribute is required for IQ stanzas. Openfire does simply assume it's there, without testing. This causes a NullPointerException for IQ packets of type 'result' or 'error':
java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.remove(ConcurrentHashMap.java:922)
at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:284)
at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:101)
at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:68)
at org.jivesoftware.openfire.net.StanzaHandler.processIQ(StanzaHandler.java:311)
at org.jivesoftware.openfire.net.ClientStanzaHandler.processIQ(ClientStanzaHandler.java:79)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:276)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:175)
at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:133)
When catching the NullPointerException the ConnectionHandler does close the client connection to the sender of the packet.
Because IQ packets of type 'get' or 'set' can still pass the server and because most clients seem to response to such bad packets by simply "copying" the not existing 'id' attribute, this bug can be used to kick other users. A simple jabber:iq:version request without 'id' attribute is sufficient.
Serveral clients have bugs that produce IQ packets without 'id' attribute. Such as Miranda 0.7.10, Trillian 3.1.7.0 and CenterIM 4.22.5. Old versions of Miranda (confirmed for 0.5.1) produce even this jabber:iq:version bug as described above. So when they come online they can kick all users in their roster, and the affected users can not even login again.
I wrote a plugin that seems to disable this bug. It's attached here. However, this only a temporary solution.
A better solution would maybe this untested patch:
if (IQ.Type.result == packet.getType() || IQ.Type.error == packet.getType()) {
if (packet.getID() != null) { IQResultListener iqResultListener = resultListeners.remove(packet.getID());
if (iqResultListener != null) {
resultTimeout.remove(packet.getID());
if (iqResultListener != null) {
try {
iqResultListener.receivedAnswer(packet);
}
catch (Exception e) {
Log.error("Error processing answer of remote entity", e);
}
return;
}
}
}
}
According to RFC 3920 (Page 51) an 'id' attribute is required for IQ stanzas. Openfire does simply assume it's there, without testing. This causes a NullPointerException for IQ packets of type 'result' or 'error':
When catching the NullPointerException the ConnectionHandler does close the client connection to the sender of the packet.
Because IQ packets of type 'get' or 'set' can still pass the server and because most clients seem to response to such bad packets by simply "copying" the not existing 'id' attribute, this bug can be used to kick other users. A simple jabber:iq:version request without 'id' attribute is sufficient.
Serveral clients have bugs that produce IQ packets without 'id' attribute. Such as Miranda 0.7.10, Trillian 3.1.7.0 and CenterIM 4.22.5. Old versions of Miranda (confirmed for 0.5.1) produce even this jabber:iq:version bug as described above. So when they come online they can kick all users in their roster, and the affected users can not even login again.
I wrote a plugin that seems to disable this bug. It's attached here. However, this only a temporary solution.
A better solution would maybe this untested patch: