Projects tigase _server server-core Issues #1272
NPE in VCard handling (#1272)
wojciech.kapcia@tigase.net opened 3 years ago
[2021-08-13 21:30:03:476] [SEVERE  ] [ vcard-xep-0292-proc-0 ] WorkerThread.run()               : tigase.server.xmppsession.SessionManager$ProcessorWorkerThread,(vcard-xep-0292-proc-0) Exception during packet processing: Packet=from=ws2s@ip-172-31-2-168.us-west-2.compute.internal/192.168.192.3_5290_172.31.11.35_36674, to=sess-man@ip-172-31-2-168.us-west-2.compute.internal, DATA=<iq to="sevan.@tigase.org" type="set" from="sevan.@tigase.org/2048393987-tigase-114" id="Go4dPWbnQHKQIFVPNXlSNb3x" xmlns="jabber:client"><vcard xmlns="urn:ietf:params:xml:ns:vcard-4.0"><n><given>Sevan</given>…... , SIZE=1333, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=set, STABLE_ID=b7d08580-ef88-4478-af90-92b4bfce2292, connection=XMPPResourceConnection=[user_jid=sevan.@tigase.org/2048393987-tigase-114, packets=144, connectioId=ws2s@ip-172-31-2-168.us-west-2.compute.internal/192.168.192.3_5290_172.31.11.35_36674, domain=tigase.org, authState=AUTHORIZED, isAnon=false, isTmp=false, parentSession hash=1990860170, parentSession liveTime=28962]
java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "this.text" is null
	at java.base/java.util.regex.Matcher.getTextLength(Unknown Source)
	at java.base/java.util.regex.Matcher.reset(Unknown Source)
	at java.base/java.util.regex.Matcher.<init>(Unknown Source)
	at java.base/java.util.regex.Pattern.matcher(Unknown Source)
	at tigase.xmpp.impl.VCardXMPPProcessorAbstract.lambda$static$32(VCardXMPPProcessorAbstract.java:442)
	at tigase.xml.Element.forEachChild(Element.java:403)
	at tigase.xmpp.impl.VCardXMPPProcessorAbstract.lambda$static$33(VCardXMPPProcessorAbstract.java:303)
	at tigase.xmpp.impl.VCardXMPPProcessorAbstract.setVCard(VCardXMPPProcessorAbstract.java:588)
	at tigase.xmpp.impl.VCard4.processFromUserToServerPacket(VCard4.java:117)
	at tigase.xmpp.XMPPProcessorAbstract.processFromUserPacket(XMPPProcessorAbstract.java:191)
	at tigase.xmpp.XMPPProcessorAbstract.process(XMPPProcessorAbstract.java:112)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2656)
	at tigase.util.processing.WorkerThread.run(WorkerThread.java:67)
wojciech.kapcia@tigase.net commented 3 years ago

Full entry, unfortunately payload is stripped:

[2021-08-13 21:30:03:476] [SEVERE  ] [ vcard-xep-0292-proc-0 ] WorkerThread.run()               : tigase.server.xmppsession.SessionManager$ProcessorWorkerThread,(vcard-xep-0292-proc-0) Exception during packet processing: Packet=from=ws2s@ip-172-31-2-168.us-west-2.compute.internal/192.168.192.3_5290_172.31.11.35_36674, to=sess-man@ip-172-31-2-168.us-west-2.compute.internal, DATA=<iq to="sevan.evans@tigase.org" type="set" from="sevan.evans@tigase.org/2048393987-tigase-114" id="Go4dPWbnQHKQIFVPNXlSNb3x" xmlns="jabber:client"><vcard xmlns="urn:ietf:params:xml:ns:vcard-4.0"><n><given>Sevan</given><surname>Evans</surname><additional/></n><adr><street>2412 partridge ln </street><ext>apt 32</ext><locality>ca</locality><region>palm desert</region><country>us</country></adr><adr><street>2412 partridge ln </street><ext>apt 32</ext><locality>ca</locality><region>palm desert</region><country>us</country></adr><email><text>sevan.evans@tigase.net</text></email><email><text>sevan.evans@tigase.net</text></email><email><text>sevan.evans@tigase.net</text></email><email><text>sevan.evans@tigase.net</text></email><email><text>sevan.evans@tigase.net</text></email><email><text>sevan.evans@tigase.net</text></email><email><text>sevan.evans@tigase.net</text></email><email><text>sevan.evans@tigase.net</text></email><fn><text>Sevan Evans</text></fn><org><text>Tigase Inc</text></org><org><text/></org><org><text ... , SIZE=1333, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=set, STABLE_ID=b7d08580-ef88-4478-af90-92b4bfce2292, connection=XMPPResourceConnection=[user_jid=sevan.evans@tigase.org/2048393987-tigase-114, packets=144, connectioId=ws2s@ip-172-31-2-168.us-west-2.compute.internal/192.168.192.3_5290_172.31.11.35_36674, domain=tigase.org, authState=AUTHORIZED, isAnon=false, isTmp=false, parentSession hash=1990860170, parentSession liveTime=28962]
java.lang.NullPointerException: Cannot invoke "java.lang.CharSequence.length()" because "this.text" is null
	at java.base/java.util.regex.Matcher.getTextLength(Unknown Source)
	at java.base/java.util.regex.Matcher.reset(Unknown Source)
	at java.base/java.util.regex.Matcher.<init>(Unknown Source)
	at java.base/java.util.regex.Pattern.matcher(Unknown Source)
	at tigase.xmpp.impl.VCardXMPPProcessorAbstract.lambda$static$32(VCardXMPPProcessorAbstract.java:442)
	at tigase.xml.Element.forEachChild(Element.java:403)
	at tigase.xmpp.impl.VCardXMPPProcessorAbstract.lambda$static$33(VCardXMPPProcessorAbstract.java:303)
	at tigase.xmpp.impl.VCardXMPPProcessorAbstract.setVCard(VCardXMPPProcessorAbstract.java:588)
	at tigase.xmpp.impl.VCard4.processFromUserToServerPacket(VCard4.java:117)
	at tigase.xmpp.XMPPProcessorAbstract.processFromUserPacket(XMPPProcessorAbstract.java:191)
	at tigase.xmpp.XMPPProcessorAbstract.process(XMPPProcessorAbstract.java:112)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2656)
	at tigase.util.processing.WorkerThread.run(WorkerThread.java:67)
Andrzej Wójcik (Tigase) commented 3 years ago

@wojtek Do we know which client published this VCard? If it is one of ours it should be fixed to publish VCard4 which is not violating VCard4 XML schema from the RFC.

Especially, that this is the only "user"/"client" which is causing all those issues and I'm patching converter with fixes for situations that should not happen and NPE in those cases are valid as input was not in expected format.

wojciech.kapcia@tigase.net commented 3 years ago

I think we shouldn't be patching obvious violations of the standard - simply catching those and returning error to client should be enough. Currently, it seems, there's just NPE, which ends processing…

@sevan.evans - which library do you use? as all those requests come from your tests.

Sevan Evans commented 3 years ago

@wojtek Are you talking in regards to which library do I use to publish the VCard? In that case, I'm using the Halcyon library.

wojciech.kapcia@tigase.net commented 3 years ago

Thank you @sevan.evans

@bmalkow , as per @andrzej.wojcik comment below:

Do we know which client published this VCard? If it is one of ours it should be fixed to publish VCard4 which is not violating VCard4 XML schema from the RFC.

Could you comment on the the normative aspect of VCard4 implementation in Halcyon?

wojciech.kapcia@tigase.net commented 3 years ago

Issue was addressed.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
Version
tigase-server-8.2.0
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#1272
Please wait...
Page is in error, reload to recover