Projects tigase _server server-core Issues #1290
UserNotFoundException for registration with username containing blankspace at the beggining (#1290)
wojciech.kapcia@tigase.net opened 3 years ago
[2021-09-17 18:42:14:393] [FINEST  ] [jabber:iq:register-proc-0 ] JabberIqRegister.process()    : Processing packet: from=c2s@ip-172-31-38-91.us-west-2.compute.internal/172.23.0.2_5223_172.31.42.200_49036, to=sess-man@ip-172-31-38-91.us-west-2.compute.internal, serverAuthorisedStanzaFrom=Optional.empty, DATA=<iq type="set" id="0D96EA80-4A26-467A-8DCC-CF0D8A7CE1BE" to="sure.im" xmlns="jabber:client"><query xmlns="jabber:iq:register"><x type="submit" xmlns="jabber:x:data"><title>Account Registration</title><instructions>Choose a user name and password for use with this service.

Please also provide your e-mail address (must be valid!) to which we will send confirmation link.</instructions><field type="hidden" var="FORM_TYPE"><value>jabber:iq:register</value></field><field type="text-single" label="Username" var="username"><required/><value> xxxxxxxx0306</value></field><field type="text-private" label="Password" var="password"><required/><value>…</value></field><field type="text-single" label="Email (MUST BE VALID!)" var="email"><required/><value>…@….com</value></field></x></query></iq>, SIZE=817, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=LOCAL, TYPE=set, STABLE_ID=e3fb00b8-7a50-4eb4-953a-220e85e142e0
[2021-09-17 18:42:14:393] [FINEST  ] [jabber:iq:register-proc-0 ] SessionManager.processPacket(): Packet processed by: [jabber:iq:register]
[2021-09-17 18:42:14:465] [FINEST  ] [jabber:iq:register-proc-0 ] EmailConfirmationSender.sendToken(): Sending token, jid: ' …@sure.im', timestamp: 9/17/21, 6:42 PM, to mail: …@….com 
[2021-09-17 18:42:14:467] [WARNING ] [jabber:iq:register-proc-0 ] EmailConfirmationSender.sendToken(): Cannot store token in database
tigase.db.UserNotFoundException: User does not exist: ' xxxxxx0306@sure.im'
	at tigase.db.jdbc.JDBCRepository.getUserUID(JDBCRepository.java:1195)
	at tigase.db.jdbc.JDBCRepository.setData(JDBCRepository.java:650)
	at tigase.db.jdbc.JDBCRepository.setData(JDBCRepository.java:700)
	at jdk.internal.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at tigase.stats.StatisticsInvocationHandler.invoke(StatisticsInvocationHandler.java:75)
	at com.sun.proxy.$Proxy36.setData(Unknown Source)
	at tigase.db.UserRepositoryMDImpl.setData(UserRepositoryMDImpl.java:353)
	at tigase.extras.emailconfirm.EmailConfirmationSender.sendToken(EmailConfirmationSender.java:130)
	at tigase.extras.emailconfirm.EmailConfirmationSender.sendAccountValidation(EmailConfirmationSender.java:97)
	at tigase.xmpp.impl.JabberIqRegister.createAccount(JabberIqRegister.java:460)
	at tigase.xmpp.impl.JabberIqRegister.doRegisterNewAccount(JabberIqRegister.java:702)
	at tigase.xmpp.impl.JabberIqRegister.process(JabberIqRegister.java:338)
	at tigase.server.xmppsession.SessionManager$ProcessorWorkerThread.process(SessionManager.java:2685)
	at tigase.util.processing.WorkerThread.run(WorkerThread.java:67)
wojciech.kapcia@tigase.net commented 3 years ago

Acording to RFCs localpart/domainname can't have whitespace but we had .trim() calls on both of them in SimpleStringPrep. I removed them and used BareJID.bareJIDInstance() in JabberIqRegister to catch invalid input.

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