#1855 sasl2: Prosody fails if id is missing

Reporter Martin
Owner Nobody
Created
Updated
Stars ★★ (2)
Tags
  • Type-Defect
  • Priority-Medium
  • Status-NeedInfo
  • Component-Docs
  1. Martin on

    If no ID is present in the SASL2 authenticate message prosody throws a traceback: ``` Apr 07 09:28:48 c2s5582d62cc160 error Traceback[c2s]: ...-modules/mod_client_management/mod_client_management.lua:122: attempt to index a nil value (local 'legacy_info') stack traceback: ...-modules/mod_client_management/mod_client_management.lua:122: in field '?' /usr/share/lua/5.4/prosody/util/events.lua:81: in function </usr/share/lua/5.4/prosody/util/events.lua:77> (...tail calls...) /usr/share/lua/5.4/prosody/core/sessionmanager.lua:284: in function 'prosody.core.sessionmanager.bind_resource' ...sody/prosody-modules/mod_sasl2_bind2/mod_sasl2_bind2.lua:38: in upvalue 'do_bind' ...sody/prosody-modules/mod_sasl2_bind2/mod_sasl2_bind2.lua:77: in field '?' /usr/share/lua/5.4/prosody/util/events.lua:81: in function </usr/share/lua/5.4/prosody/util/events.lua:77> (...tail calls...) /usr/share/lua/5.4/prosody/util/events.lua:81: in function </usr/share/lua/5.4/prosody/util/events.lua:77> (...tail calls...) /usr/share/lua/5.4/prosody/core/stanza_router.lua:143: in upvalue 'core_process_stanza' /usr/lib/prosody/modules/mod_c2s.lua:343: in upvalue 'func' /usr/share/lua/5.4/prosody/util/async.lua:149: in function </usr/share/lua/5.4/prosody/util/async.lua:147> ``` Prosody should not throw a traceback as the ID is not required by XEP-0388.

  2. Zash on

    Thanks for the report. Please remember to include version info. Could you check if https://hg.prosody.im/prosody-modules/rev/13094c707414 at least made the traceback go away? Not sure if it is the right way to solve it tho.

    Changes
    • tags Status-NeedInfo Component-Docs
  3. Martin on

    Sorry, I forgot to include the version info: ``` Prosody trunk nightly build 1886 (2024-03-28, f9171624fd03) # Prosody directories Data directory: /var/lib/prosody Config directory: /etc/prosody Source directory: /usr/lib/prosody Plugin directories: /var/lib/prosody/custom_plugins /usr/lib/prosody/modules /var/lib/prosody/prosody-modules /usr/lib/prosody/modules/ # Operating system Linux 6.1.0-18-amd64 # Lua environment Lua version: Lua 5.4 Lua module search paths: /usr/local/share/lua/5.4/prosody/?.lua /usr/local/share/lua/5.4/?.lua /usr/local/share/lua/5.4/prosody/?/init.lua /usr/local/share/lua/5.4/?/init.lua /usr/local/lib/lua/5.4/prosody/?.lua /usr/local/lib/lua/5.4/?.lua /usr/local/lib/lua/5.4/prosody/?/init.lua /usr/local/lib/lua/5.4/?/init.lua /usr/share/lua/5.4/prosody/?.lua /usr/share/lua/5.4/?.lua /usr/share/lua/5.4/prosody/?/init.lua /usr/share/lua/5.4/?/init.lua ./prosody/?.lua ./?.lua ./prosody/?/init.lua ./?/init.lua /var/lib/prosody/custom_plugins/share/lua/5.4/?.lua /var/lib/prosody/custom_plugins/share/lua/5.4/?/init.lua Lua C module search paths: /usr/local/lib/lua/5.4/prosody/?.so /usr/local/lib/lua/5.4/?.so /usr/lib/x86_64-linux-gnu/lua/5.4/prosody/?.so /usr/lib/x86_64-linux-gnu/lua/5.4/?.so /usr/lib/lua/5.4/prosody/?.so /usr/lib/lua/5.4/?.so /usr/local/lib/lua/5.4/loadall.so ./prosody/?.so ./?.so LuaRocks: Not installed # Network Backend: epoll # Lua module versions LuaDBI: 0.7 LuaExpat: 1.5.1 LuaFileSystem: 1.8.0 LuaSec: 1.2.0 LuaSocket: 3.0.0 luaunbound: 1.0.0 readline: 3.1 # library versions libcrypto: OpenSSL 3.0.11 19 Sep 2023 libexpat: expat_2.5.0 libunbound: 1.17.1 ``` Indeed the commit fixes the traceback and also let the client authenticate without the id. :) I already had the prosody-modules up-to-date but only reloaded sasl2 modules before trying again.

New comment

Not published. Used for spam prevention and optional update notifications.