Certificate verification vulnerability in Erlang/OTP 23.2

Posted 2021-01-15 12:06:59.472819

The ssl application version 10.2, part of Erlang/OTP 23.2 and 23.2.1, has a regression in the certificate verification logic. This could result in MitM attacks on clients, as well as unauthorized access to servers that rely on client certificates.

The vulnerability is tracked as CVE-2020-35733. A fix is available as part of ssl-10.2.1, in Erlang/OTP 23.2.2. I will post further details in a follow-up post once everyone has had a chance to upgrade.

The purpose of this post is to help you understand how the issue may affect you. The short version: if you are using an affected version of Erlang/OTP, on development machines, build servers and/or deployment targets, you should probably upgrade as soon as possible.


1. Is my application affected?

Certificate verification is primarily used by clients to detect attempts to intercept network traffic or impersonate servers. If your application includes any network clients that use TLS, it is almost certainly affected. Please refer to question 2 for details.

Some servers rely on client certificates to authenticate clients, and they too can be affected. Please refer to question 3 for more information.

2. Are the clients in my application affected?

If the application is running Erlang/OTP 23.2 and it connects to servers using TLS, the answer is almost certainly yes. Some clients do not enable certificate verification, but then such clients would have been susceptible to MitM attacks all along, regardless of Erlang/OTP version.

Some examples of affected clients include:

Clients that build on the SSH protocol, such as SFTP, are not affected.

3. Is my (web) server at risk?

TLS servers, such as web servers, generally do not perform certificate verification, unless explicitly configured to request a certificate from clients (“mutual TLS”). Therefore in practice most servers are not affected.

Servers that delegate the TLS termination to a reverse proxy (e.g. Nginx) or load balancer (e.g. HAProxy) are not affected, even if they do require client certificates.

However, if your server…

…then malicious users may be able to produce fake client certificates that will be accepted by the server. If that is the case, deploy the fix as soon as possible.

4. Is my development/build environment affected?

Possibly. Fetching packages from Hex should be safe, because the Hex client verifies the signature on downloaded packages. But API interactions with the Hex server could be intercepted, which would leak your API credentials. An attacker could then publish malicious modifications to your packages, leading to code execution vulnerabilities for the users of those packages. Do not publish Hex packages until after you have upgraded.

If you are using a tool such as kerl or asdf, uninstall Erlang/OTP 23.2 and 23.2.1, and install 23.2.2 as soon as possible.

Off BEAM: Secure Coding for the BEAM

Posted 2020-05-04 07:26:41.557621

At CodeBEAM SF 2020 I presented the EEF’s Secure Coding and Deployment Hardening Guidelines. The talk was recorded and was recently published on YouTube, but unfortunately the first 10 minutes are missing.

Update: the full talk is now available, thanks to Code Sync and their video production crew! Here’s the new video; I left the old post with the ‘missing introduction’ below the fold for posterity…

Slide deck

Continue reading...

Why Mix no longer installs from HTTP(S) URLs

Posted 2020-01-01 20:02:12.309037

As of Elixir 1.9.3 the use of HTTP or HTTPS URLs in various Mix commands is deprecated, and in 1.10 this functionality will be disabled altogether. This affects the archive.install, escript.install and local.rebar Mix commands.

In this post I will explain why the use of URLs was a security risk, what are the alternatives, and why those alternatives (including Hex) are safe.


The issue here is that neither Erlang/OTP nor Elixir ships with a CA trust store, and picking up the CA trust store from the operating system is quite hard to do in a reliable, cross-platform way. Without a trust store it is not possible to verify the server’s certificate, which means there is no protection against man-in-the-middle (MitM) attacks. In case of plain HTTP URLs this must have been pretty obvious to users, but when using HTTPS people might be forgiven for thinking they’d be safe from such attacks.

The affected Mix tasks were used to fetch code for local execution or for inclusion into a software product that might be used in production. A MitM attack would allow the attacker to inject malicious code, stealing data or taking over the developer’s machine, build server or even production systems.

Continue reading...

Older posts