# CVE-2026-57188: Asterisk stack buffer overflow in XMPP namespace prefix handling

Source: https://junglewise.ai/threats/cve-2026-57188-asterisk-is-an-open-source-private-branch-exchange-and-telephony  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-27. Updated: 2026-10-27  
License: CC BY 4.0 with a link back

CVE-2026-57188 · Severity: info · Published 2026-10-27

Asterisk is an open-source PBX and telephony toolkit used to manage phone systems. An authenticated attacker with an XMPP account can send a specially crafted packet to trigger a stack buffer overflow in the res_xmpp module, potentially leading to code execution or system crash. The vulnerability requires XMPP to be configured and the attacker must have valid credentials on the same or a federated XMPP server.

Technologies: [Asterisk](https://junglewise.ai/threats/technologies/asterisk), [Asterisk Certified Asterisk](https://junglewise.ai/threats/technologies/certified-asterisk). Vendors: [Asterisk](https://junglewise.ai/threats/vendors/asterisk).

## Quick answers

**Is CVE-2026-57188 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-57188 being exploited in the wild.

**How severe is CVE-2026-57188?** Informational severity, published 27 October 2026.

**Which products and versions are affected?** Asterisk before 20.20.1, 21.12.3, 22.10.1, 23.4.1; Asterisk Certified Asterisk before 20.7-cert11, 22.8-cert3.

**Is there a fix for CVE-2026-57188?** Yes: fixed in Asterisk 20.20.1, 21.12.3, 22.10.1, 23.4.1; Certified Asterisk 20.7-cert11, 22.8-cert3. Until then: Ensure the res_xmpp module is not loaded if XMPP connectivity is not required, or restrict XMPP connections to trusted peer servers only through firewall rules and XMPP server access controls. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-57188 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-57188?** Check whether you run Asterisk or Asterisk Certified Asterisk at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- Fixed in Asterisk 20.20.1, 21.12.3, 22.10.1, 23.4.1; Certified Asterisk 20.7-cert11, 22.8-cert3

Ensure the res_xmpp module is not loaded if XMPP connectivity is not required, or restrict XMPP connections to trusted peer servers only through firewall rules and XMPP server access controls.

## Technical details

A stack buffer overflow exists in the xmpp_action_hook() function within res_xmpp when processing XMPP namespace prefixes. The snprintf size parameter is computed from an attacker-controlled namespace prefix length without proper bounds checking against the 256-byte stack buffer. When a remote XMPP peer sends a stanza with a child element whose namespace prefix exceeds 249 characters, snprintf writes past the buffer boundary. The fix uses sizeof(attr) to properly limit the snprintf output and precision modifiers to truncate the prefix correctly.

## Affected products

- Asterisk Asterisk before 20.20.1, 21.12.3, 22.10.1, 23.4.1
- Asterisk Certified Asterisk before 20.7-cert11, 22.8-cert3

## Timeline

- 2026-10-27: disclosed
- 2026-10-27: patched

## References

- [https://github.com/asterisk/asterisk/commit/12072a559f592736a44dd9fbe1594e84714edfb4](https://github.com/asterisk/asterisk/commit/12072a559f592736a44dd9fbe1594e84714edfb4)
- [https://github.com/asterisk/asterisk/commit/1328dbb503da4aa11a480a9c28e170f17e5f4e84](https://github.com/asterisk/asterisk/commit/1328dbb503da4aa11a480a9c28e170f17e5f4e84)

## Related threats

- [Asterisk privilege escalation in ast_loggrabber via /tmp](https://junglewise.ai/threats/cve-2026-57203-asterisk-is-an-open-source-private-branch-exchange-and-telephony)
- [Asterisk OOH323 Q.931 parser denial of service](https://junglewise.ai/threats/cve-2026-57186-asterisk-is-an-open-source-private-branch-exchange-and-telephony)
- [Asterisk authorization bypass in ARI REST-over-WebSocket](https://junglewise.ai/threats/cve-2026-57200-asterisk-is-an-open-source-private-branch-exchange-and-telephony)
- [Asterisk NULL pointer dereference in Manager Interface HTTP digest authentication](https://junglewise.ai/threats/cve-2026-57195-asterisk-is-an-open-source-private-branch-exchange-and-telephony)
- [Asterisk privilege escalation in REST Interface](https://junglewise.ai/threats/cve-2026-57202-asterisk-is-an-open-source-private-branch-exchange-and-telephony)
