Non-CA certificate accepted as intermediate issuer in public_key path validation
Improper Following of a Certificate's Chain of Trust vulnerability in Erlang OTP public_key (pubkey_cert module) allows a non-CA certificate to be accepted as an intermediate issuer, enabling certificate chain forgery. In lib/public_key/src/pubkey_cert.erl, pubkey_cert:validate_extensions/7 contains two flaws that together allow a certificate with basicConstraints cA:false and no keyUsage extension to be used as an intermediate issuer in a chain passed to public_key:pkix_path_validation/3: the cA:false clause recurses into the remaining extensions without rejecting the certificate when it is in issuer position, and the keyUsage check only fires when the extension is present, so a certificate lacking keyUsage entirely bypasses the keyCertSign enforcement. Any party holding an end-entity certificate with basicConstraints cA:false and no keyUsage extension, issued by any CA in the victim's trust store, can use that certificate's private key to sign forged leaf certificates for arbitrary identities. public_key:pkix_path_validation/3 accepts the resulting chain, and by extension every TLS or mTLS endpoint built on the OTP ssl application that relies on the default verifier is affected, including server identity verification on the client side and client certificate verification on mTLS servers. This issue affects OTP from OTP 17.0 before OTP 27.3.4.19, OTP 28.5.0.8, and OTP 29.1.2, corresponding to public_key from 0.22 before 1.17.1.7, 1.20.3.6, and 1.21.8. Whether OTP before OTP
CVE-2026-42789
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: cve:CVE-2026-42789
OTP
Source reference: /containers/cna/affected/0/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
OTP
Source reference: /containers/cna/affected/1/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
OTP
Source reference: /containers/cna/affected/2/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"cpes": [
"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"
],
"vendor": "Erlang",
"modules": [
"pubkey_cert"
],
"product": "OTP",
"versions": [
{
"status": "affected",
"changes": [
{
"at": "27.3.4.19",
"status": "unaffected"
},
{
"at": "28.5.0.8",
"status": "unaffected"
},
{
"at": "29.1.2",
"status": "unaffected"
}
],
"version": "17.0",
"lessThan": "*",
"versionType": "otp"
}
],
"packageURL": "pkg:software-id/erlang.org/otp",
"packageName": "otp",
"programFiles": [
"lib/public_key/src/pubkey_cert.erl"
],
"defaultStatus": "unknown",
"programRoutines": [
{
"name": "pubkey_cert:validate_extensions/7"
}
]
},
{
"cpes": [
"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"
],
"repo": "https://github.com/erlang/otp",
"vendor": "Erlang",
"modules": [
"pubkey_cert"
],
"product": "OTP",
"versions": [
{
"status": "affected",
"changes": [
{
"at": "1.17.1.7",
"status": "unaffected"
},
{
"at": "1.20.3.6",
"status": "unaffected"
},
{
"at": "1.21.8",
"status": "unaffected"
}
],
"version": "0.22",
"lessThan": "*",
"versionType": "otp"
}
],
"packageURL": "pkg:otp/public_key?repository_url=https:%2F%2Fgithub.com%2Ferlang%2Fotp&vcs_url=git%2Bhttps:%2F%2Fgithub.com%2Ferlang%2Fotp.git",
"packageName": "public_key",
"programFiles": [
"src/pubkey_cert.erl"
],
"defaultStatus": "unknown",
"programRoutines": [
{
"name": "pubkey_cert:validate_extensions/7"
}
]
},
{
"cpes": [
"cpe:2.3:a:erlang:erlang\\/otp:*:*:*:*:*:*:*:*"
],
"repo": "https://github.com/erlang/otp",
"vendor": "Erlang",
"modules": [
"pubkey_cert"
],
"product": "OTP",
"versions": [
{
"status": "affected",
"changes": [
{
"at": "0a05b7ca33fb0b3f0a6cb9ae34252bb3a74032b8",
"status": "unaffected"
},
{
"at": "75ca4c0dc2bbdb286ac3c3fe89cb4b4d2b4dc333",
"status": "unaffected"
},
{
"at": "82af606b5437c4de1276dbcc8855a47e88231226",
"status": "unaffected"
}
],
"version": "84adefa331c4159d432d22840663c38f155cd4c1",
"lessThan": "*",
"versionType": "git"
},
{
"status": "unaffected",
"version": "0a05b7ca33fb0b3f0a6cb9ae34252bb3a74032b8",
"lessThan": "*",
"versionType": "git"
},
{
"status": "unaffected",
"version": "75ca4c0dc2bbdb286ac3c3fe89cb4b4d2b4dc333",
"lessThan": "*",
"versionType": "git"
},
{
"status": "unaffected",
"version": "82af606b5437c4de1276dbcc8855a47e88231226",
"lessThan": "*",
"versionType": "git"
}
],
"packageURL": "pkg:github/erlang/otp",
"packageName": "erlang/otp",
"programFiles": [
"lib/public_key/src/pubkey_cert.erl"
],
"collectionURL": "https://github.com",
"defaultStatus": "unknown",
"programRoutines": [
{
"name": "pubkey_cert:validate_extensions/7"
}
]
}
]- Related CVEs
- CVE-2026-42789
Source reference:
/cveMetadata/cveId
Publisher severity
high
Source reference: /containers/cna/metrics
- Event
- #22797 · Revision 1
- Added to Heist Feed
- Publisher date