/

CVE-2026-84975

Severity:

HIGH RISK

(7.4)

TLS Certificate Validation Bypass (CWE-295) in PJSIP

CVE-2026-84975

Awaiting Analysis

Vulnerability type

Category:

Improper Certificate Validation

CWE:

CWE-295, CWE-297

Impact:

Server Impersonation and Credential Exposure

Severity:

HIGH RISK

(7.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A certificate hostname-validation flaw in PJSIP's OpenSSL and GnuTLS TLS backends can accept a trusted certificate whose DNS SubjectAltName contains an embedded NUL byte. When server verification is enabled, an attacker who can intercept traffic and obtain such a certificate may impersonate the SIP server and capture REGISTER credentials.

Affected context

The issue occurs in PJSIP 2.17 and earlier when the OpenSSL or GnuTLS backend is used for TLS or SIPS transport and server verification is enabled through --tls-verify-server. It depends on certificate hostname matching involving a DNS SubjectAltName containing an embedded NUL byte; the mbedTLS backend is not affected because it preserves the certificate-provided string length.

Exploit preconditions

  • Attack surface: PJSIP TLS/SIPS connections using the OpenSSL or GnuTLS backend
  • Required access: Ability to intercept or redirect the client-to-server connection, plus possession of a specially formed certificate issued by a trusted certificate authority
  • Trigger point: Server certificate validation during TLS session establishment
  • Why exploitation is possible: String-based hostname processing recalculates length and truncates at an embedded NUL, allowing a certificate suffix to be ignored during comparison

Why this happens

The vulnerability results from treating explicitly length-delimited certificate data as a conventional NUL-terminated string. In the affected backends, DNS SubjectAltName values are copied with string functions that stop at an embedded NUL, so hostname validation may compare only a trusted-looking prefix rather than the complete value. This maps primarily to CWE-295: Improper Certificate Validation and is also related to CWE-297: Improper Validation of Certificate with Host Mismatch.

Potential impact

  • An attacker could impersonate a trusted SIP server.
  • SIP clients may establish sessions with an unauthorized endpoint.
  • REGISTER credentials could be disclosed to the impersonating server.
  • Signaling confidentiality and call-control integrity could be weakened.
  • An attacker could potentially redirect or manipulate SIP traffic.

General mitigation guidance

Mitigation generally focuses on preserving certificate-provided lengths throughout parsing and hostname comparison, and on rejecting malformed or ambiguous DNS SubjectAltName values.

Common defensive patterns include:

  • Using certificate-validation routines that perform length-aware comparisons.
  • Rejecting embedded NUL characters and other malformed hostname representations.
  • Ensuring hostname verification remains enabled for TLS/SIPS connections.
  • Favoring a backend with correct length-preserving certificate handling where operationally appropriate.
  • Limiting SIP account privileges and credential scope to reduce the impact of server impersonation.
  • Protecting signaling paths with network controls that reduce interception and redirection opportunities.

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis of certificate parsing and hostname-comparison code for NUL-terminated string APIs used with length-delimited fields.
  • Code review checks covering SAN parsing, canonicalization, embedded NUL handling, and hostname matching.
  • Negative test certificates containing embedded NUL bytes, mismatched suffixes, and alternate SAN encodings.
  • Dependency and configuration inventories identifying TLS/SIPS deployments that use the affected backends with server verification enabled.
  • Policy enforcement requiring complete, length-aware certificate validation and rejecting malformed identity fields.
  • Neutral automated security-review tools that flag unsafe string handling in certificate-validation paths.

Sources

SourceLink
github.comgithub.com/pjsip/pjproject/commit/43d3bd77bb6833eab4c493503b8d564a754ddfdd
github.comgithub.com/pjsip/pjproject/security/advisories/GHSA-382p-87mh-r3q8

Frequently asked

questions

Exploitation can affect a remote SIP client, but it generally requires traffic interception or redirection and a specially crafted certificate trusted by the client.

No. The attacker primarily needs a position that allows interception or redirection of the TLS/SIPS connection, along with a certificate issued by a trusted authority for the relevant certificate identity.

Use length-aware certificate and hostname validation, reject embedded NUL characters in identity fields, and ensure server verification is enabled.

Use parser APIs that preserve explicit lengths, include malformed-certificate cases in testing, review string handling in security-sensitive code, and enforce TLS certificate-validation policies across SIP deployments.

Find out what's already
exploitable in your codebase.