EEF-CVE-2026-125275: A device certificate whose CA isn't registered can keep a TLS handshake running forever
Summary
Loop with Unreachable Exit Condition ('Infinite Loop') vulnerability in device certificate verification in nerves-hub nerveshubweb allows an unauthenticated remote attacker to cause a denial of service via a TLS client certificate whose CA is not registered. When a client certificate chains to a root in the device endpoint's trust store but no CA in the chain is registered in NervesHub, NervesHub.SSL.decide/2 refuses it with the reason :unknownca. Erlang/OTP ssl reads that reason as a missing trust anchor, looks for an alternative root, finds the same root and validates again without end. The handshake process queries the database on each pass and keeps running after the client disconnects, until the node restarts.
The device endpoint trusts the public roots from CAStore unless DEVICESSLCACERTFILE is set, so a client certificate from a public CA whose chain allows client authentication is sufficient. A chain that ends at a root outside the trust store is refused once.
This issue affects nerveshub: from 1.0.0 before 2.5.4.
Details
1. Refusal reason. The device endpoint gives ssl the verify function NervesHub.DeviceLink.PeerVerification.verifyfun/3, which asks NervesHub.SSL.decide/2. For a :validpeer event on a certificate that is not on file, decide/2 tries to register the certificate. checkknownca/1 in lib/nerveshub/ssl.ex looks for the signer among the registered CAs and returns :unknownca when it finds none. doverify/2 passes that to ssl as {:fail, :unknownca}.
2. Retry in ssl. unknownca is also the reason Erlang/OTP uses for a path with no trust anchor. In sslhandshake:pathvalidate/11, a {badcert, unknownca} result makes ssl look for a cross-signed alternative root and validate again. Unlike the rootcertexpired branch, this branch does not add the root it tried to the list of roots to skip.
3. Loop. When the chain ends at a self-signed root in the trust store, ssl finds the same root, calls the verify function again, and receives unknownca again. The recursion is a tail call, so the process does not grow or crash. It does not return to its mailbox, so it sees neither the handshake timeout nor the closed socket. Each pass runs the database queries of the registration checks.
Proof of concept
1. Make a self-signed root and a client certificate signed by it, directly or through an intermediate that the client sends. Do not register either CA in NervesHub. 2. Run a device endpoint whose trust store holds that root, by adding it to the DEVICESSLCACERTFILE bundle. Against the default trust store, a client certificate from a public CA replaces steps 1 and 2. 3. Open one TLS connection to the device endpoint with that certificate, then disconnect. 4. The handshake process on the server keeps running. The nerveshub.ssl.fail telemetry event with reason unknownca and the database queries repeat until the node restarts.
Impact
An unauthenticated client can leave a handshake process on a device node running and querying the database after it disconnects. Each further connection adds another such process, and they stop only when the node restarts. Devices and users of the instance lose service while the nodes and the database are saturated.
Workarounds
Set DEVICESSLCACERTFILE to a bundle that holds no public root and no root that signs device certificates, for example a file with one self-signed certificate made for this purpose. A certificate from an unregistered CA is then refused once and the handshake ends. Devices whose certificate or CA is registered in NervesHub continue to connect.
Restarting a node ends the handshakes that are already stuck on it.
Configurations
The certificate chain must end at a root in the device endpoint's trust store. With DEVICESSLCACERTFILE unset, which is the default from 2.0.0, the trust store holds the public roots from CAStore. With DEVICESSLCACERTFILE set to a bundle that holds a root which signs device certificates, any certificate from that root whose CA is not registered is sufficient, including the certificate of a deleted device.
The retry in Erlang/OTP ssl was confirmed on Erlang/OTP 28.3, 29.0 and 29.1. Earlier releases were not checked.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.5.4 - Configuration
Set DEVICE_SSL_CACERTFILE to a bundle containing no public root and no root that signs device certificates; the material gives a purpose-made self-signed certificate as an example.
NervesHub device endpoint DEVICE_SSL_CACERTFILE = A bundle containing no public root and no root that signs device certificates - Operational
Restart affected nodes to end TLS handshakes that are already stuck.
Event History
Frequently Asked Questions
Which deployments are affected?
Affected versions are nerves_hub 1.0.0 through versions before 2.5.4. The vulnerable path is the device TLS endpoint.
What does an attacker need to trigger the denial of service?
An unauthenticated remote attacker needs to reach the device endpoint and present a TLS client certificate chaining to a root trusted by that endpoint, while no CA in the chain is registered in NervesHub. With the default trust configuration, a client certificate from a public CA that permits client authentication can be sufficient.
Does ending the client connection stop the attack?
No. The TLS handshake process continues after the client disconnects and repeatedly queries the database. It continues until the node is restarted.
How can I identify an active exploit attempt?
Look for TLS handshake processes that remain active after clients disconnect, together with repeated database queries associated with certificate verification. The condition persists until a node restart.
Can the default trust configuration increase exposure?
Yes. Unless DEVICE_SSL_CACERTFILE is configured, the device endpoint trusts public roots from CAStore. A certificate chain ending at a root outside the configured trust store is refused once rather than entering the repeated validation behavior.