FreeSWITCH contains a flaw where the `sofia presence handle sip i message()` function incorrectly processes the `To` field of an inbound SIP MESSAGE. The function splits the username at the `+` character and uses the left-hand part as a chat protocol selector. By selecting the `api` protocol, an attacker can reach the `switch api execute()` function, which allows the execution of FreeSWITCH API commands, including those that shell out to the operating system via `popen()`, with the privileges of the daemon. This issue has been exploited in the wild and can lead to arbitrary command execution, configuration and credential disclosure, and arbitrary call control. Inbound chat is enabled by default in stock internal and external SIP profiles. Authentication may be bypassed in some configurations if stock directory users without passwords are present and `allow-empty-password` is not set to `false`.