#1187 <iq> child count restriction does not apply to components

Reporter Eelco Cramer
Owner Nobody
Created
Updated
Stars ★ (1)
Tags
  • Status-Accepted
  • Type-Defect
  • Priority-Medium
  1. Eelco Cramer on

    What steps will reproduce the problem? 1. Connect with a client 2. Send the following message: <iq type="get" from="alice@example.com/stage" to="pubsub.example.com" id="items1"> <pubsub xmlns="http://jabber.org/protocol/pubsub"> <items node="bob@example.com"/> </pubsub> </iq> What is the expected output? A list of pubsub items recorded at node "bob@example.com" What do you see instead? mod_component error Traceback[component]: /usr/lib/prosody/modules/mod_iq.lua:69: attempt to index local 'child' (a nil value) stack traceback: /usr/lib/prosody/modules/mod_iq.lua:69: in function '?' /usr/lib/prosody/util/events.lua:78: in function </usr/lib/prosody/util/events.lua:74> (tail call): ? /usr/lib/prosody/core/stanza_router.lua:190: in function 'core_post_stanza' /usr/lib/prosody/core/stanza_router.lua:137: in function </usr/lib/prosody/core/stanza_router.lua:63> (tail call): ? [C]: in function 'xpcall' /usr/lib/prosody/modules/mod_component.lua:240: in function 'cb_handlestanza' /usr/lib/prosody/util/xmppstream.lua:184: in function </usr/lib/prosody/util/xmppstream.lua:164> [C]: in function 'parse' /usr/lib/prosody/util/xmppstream.lua:271: in function 'feed' /usr/lib/prosody/modules/mod_component.lua:309: in function 'data' /usr/lib/prosody/modules/mod_component.lua:321: in function </usr/lib/prosody/modules/mod_component.lua:319> (tail call): ? /usr/lib/prosody/net/server_select.lua:879: in function </usr/lib/prosody/net/server_select.lua:861> [C]: in function 'xpcall' /usr/bin/prosody:400: in function 'loop' /usr/bin/prosody:431: in main chunk [C]: ? What version of the product are you using? On what operating system? docker image: unclev/prosody-docker-extended tags: latest, stable and 0.10 all have this issue. Please provide any additional information below.

  2. Eelco on

    The example above is not correct. The issue only seems to happen when send from a component without a user part in the jid: <iq type="get" from="component.example.com" to="pubsub.example.com" id="items1"> <pubsub xmlns="http://jabber.org/protocol/pubsub"> <items node="bob@example.com"/> </pubsub> </iq> If I add a local part to the component JID, the error is gone.

  3. Eelco on

    Ok, I'm an ignorant fool. Sorry about that. It seems that due to a change in my code the <iq/> message did not have a <pubsub/> child. That said I would still expect prosody to return an <iq type="error"/> response instead of logging an error stack.

  4. Zash on

    Thanks for the report, sorry about the slow processing. So the problem here seems to be that components can send invalid stanzas. I'm not sure why the code that verifies that <iq> stanzas have the correct number of child nodes only does so for c2s sessions.

    Changes
    • title Getting pubsub items results in: attempt to index local 'child' <iq> child count restriction does not apply to components
    • tags Status-Accepted

New comment

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