]> git.ipfire.org Git - thirdparty/asterisk.git/commit
tcptls: Don't inhibit escalations for outbound client connections. master
authorJeremy Lainé <jeremy.laine@m4x.org>
Thu, 23 Jul 2026 11:14:48 +0000 (13:14 +0200)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Mon, 27 Jul 2026 12:01:00 +0000 (12:01 +0000)
commit7c60726df1cd500dade6db233fabf9fbcc76cd50
treea6849d9e5d532aecdf5afbcb5e521fd4a1278fde
parent734fb592bde5df72bddac615f60516e6b6033883
tcptls: Don't inhibit escalations for outbound client connections.

handle_tcptls_connection() marks the current thread as inhibiting
privilege escalations and as an external user interface so that
dialplan functions considered 'dangerous' (STAT, SHELL, ...) cannot be
executed on behalf of an external protocol.

This is correct for inbound (server) connections, each of which runs on
its own dedicated worker thread. However, the outbound (client) path
calls handle_tcptls_connection() synchronously on the caller's own
thread. When that caller is a channel/PBX thread, the thread-local
flags are set and never cleared, permanently tainting the dialplan
thread.

Examples:

- Calling Dial() for an outbound WebSocket and resuming dialplan
  execution with the "g" flag.
- Running ExternalIVR() then continuing dialplan executing.

Outbound connections are initiated by Asterisk itself and are not
external user interfaces, so the flags should not be set for them. Gate
the flag-setting on tcptls_session->client so it applies only to inbound
connections.

Resolves: #2038
main/tcptls.c