8000 Invalid username (JID) will crash oauth process · Issue #4355 · processone/ejabberd · GitHub
[go: up one dir, main page]

Skip to content

Invalid username (JID) will crash oauth process #4355

@Xavier59

Description

@Xavier59

Bug description

An invalid username will crash the ejabberd_oauth process.
See:

StringJID = proplists:get_value(<<"username">>, Q, <<"">>),
#jid{user = Username, server = Server} = jid:decode(StringJID),

Errors thrown by jid:decode(StringJID) will crash the process as they are not caught.

https://github.com/processone/xmpp/blob/eec76d8d13ae3a774f373af16e139727bbd0be02/src/jid.erl#L135-L144

You can reproduce the issue by supplying a username that will trigger a tr0 case and set ret = 0 which return an error atom.

https://github.com/processone/xmpp/blob/master/c_src/jid.c

A malicious actor could keep submitting requests with an invalid username to cause DOS and prevent other users to log in.

Expected Behaviour

The process should not crash. The error should be handled in ejabberd_oauth

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0