XMPPStringPrepSimple trims the resource part of the JID and returns it without throwing TigaseStringprepException. This causes the following issues:
processed stanza from/to can be replaced with a JID with trimmed resource part making it impossible for delivery or delivering to the resource with invalid resource part of the JID
behaviour is not RFC6122 compatible as RFC allows SPACE as a part of the JID (also at the beginning or the end)
client is not made aware of the issue (TigaseStringprepException is not thrown)
I've removed trimming from XMPPStringPrepSimple to make it more RFC6122 compatible.
Andrzej Wójcik (Tigase) commented 5 years ago
Originally, the issue was found due to the issue with the Push Notifications component - it responded to the wrong JID (with trimmed resource part) and that user was hosted on the remote service allowing non-trimmed resources.
XMPPStringPrepSimpletrims the resource part of the JID and returns it without throwingTigaseStringprepException. This causes the following issues:TigaseStringprepExceptionis not thrown)