Openfire (ARCHIVED)

Account creation silently converts JID to lowercase.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Core
  • Labels:
    None
  • Environment:

Description

Summary: Users created with uppercase characters in the "users" part of a JID have their names silently converted to lowercase upon creation. Subsequent attempts to authenticate using a JID containing the original uppercase characters fails.

Example code uses Smack XMPP API. (It's not a Smack issue though.)

import org.jivesoftware.smack.XMPPConnection;

public class XMPPAcctTest {

public static void main(String[] args) throws Exception { XMPPConnection.DEBUG_ENABLED = true; XMPPConnection xmppc = new XMPPConnection("localhost"); String name = System.getProperty("user.name")+"-"+System.currentTimeMillis(); //name = name.toLowerCase(); // this is the workaround name = name.toUpperCase(); // this demonstrates the bug //this always works, regardless of the case. xmppc.getAccountManager().createAccount(name, "test"); //this fails if the username contains upper-case characters. xmppc.login(name, "test", "foo"); }
}

Observed behaviour (">>" means to server, "<<" means to client):

>> <stream:stream to="localhost" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams">

<< <?xml version='1.0' encoding='utf-8'?><stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="shodan" id="2af7bea6">

>> <iq id="UobeR-0" to="shodan" type="get"><query xmlns="jabber:iq:register"></query></iq>

<< <iq id="UobeR-0" from="shodan" type="result"><query xmlns="jabber:iq:register"><username></username><password></password><email></email><x xmlns="jabber:x:data" type="form"><title>XMPP Client Registration</title><instructions>Please provide the following information</instructions><field var="FORM_TYPE" type="hidden"><value>jabber:iq:register</value></field><field label="Username" var="username" type="text-single"><required></required></field><field label="Full name" var="name" type="text-single"></field><field label="Email" var="email" type="text-single"></field><field label="Password" var="password" type="text-private"><required></required></field><field label="Show name" var="x-nameVisible" type="boolean"><required></required><value>1</value></field><field label="Show email" var="x-emailVisible" type="boolean"><required></required><value>0</value></field></x></query></iq>

>> <iq id="UobeR-1" to="shodan" type="set"><query xmlns="jabber:iq:register"><username>IAN-1099838498671</username><password>test</password></query></iq>

<< <iq id="UobeR-1" from="shodan" type="result"></iq>

>> <iq id="UobeR-2" type="get"><query xmlns="jabber:iq:auth"><username>IAN-1099838498671</username></query></iq>

<< <iq id="UobeR-2" type="result"><query xmlns="jabber:iq:auth"><username>IAN-1099838498671</username><password></password><digest></digest><resource></resource></query></iq>

>> <iq id="UobeR-3" type="set"><query xmlns="jabber:iq:auth"><username>IAN-1099838498671</username><digest>ec14d17bbdd135c35f6d6052e3d457a41cfd4876</digest><resource>foo</resource></query></iq>

<< <iq id="UobeR-3" type="error"><error code="401"></error></iq>

Expected behaviour:

Either the account creation should fail with a message indicating that JIDs are only allowed to contain lowercase characters, or the account on the server should reflect the caseness of the username chosen by the client.

Activity

Hide
Matt Tucker added a comment -

This is not actually a bug. XMPP specifices that the "node" portion of a JID (username) must undergo the nameprep stringprep profile. Part of that process is performing case folding (lower-casing) on the node. Messenger doesn't perform full nameprep yet, but it does at least convert usernames to lower-case. This probably is a Smack bug if usernames aren't being lower-cased.

Show
Matt Tucker added a comment - This is not actually a bug. XMPP specifices that the "node" portion of a JID (username) must undergo the nameprep stringprep profile. Part of that process is performing case folding (lower-casing) on the node. Messenger doesn't perform full nameprep yet, but it does at least convert usernames to lower-case. This probably is a Smack bug if usernames aren't being lower-cased.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
1d
Original Estimate - 1 day
Remaining:
1d
Remaining Estimate - 1 day
Logged:
Not Specified
Time Spent - Not Specified