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...

Creating an SBoM for Mix projects

Posted 2019-10-24 19:44:48.169213

Any non-trivial modern software project relies, directly or indirectly, on a large number of third party dependencies. Keeping track of updates, known vulnerabilities and license obligations can be a real challenge. Luckily there are tools that can help, both free and commercial.

In order to leverage such tools it is necessary to generate an inventory of the dependencies, including their versions and licenses, in a format the tools can understand. This is called a Software Bill-of-Materials, or SBoM, and an example of an SBoM format is CycloneDX. Tools exist for generating CycloneDX files for various ecosystems, and now there is one for Elixir too.

In this post I will show how to generate an SBoM for a Mix project, and how to use the output with OWASP Dependency-Track.

Continue reading...

Learn you some `:ssl` for much security

Posted 2019-04-09 12:43:35.136065

Here’s the slide deck for my presentation at ElixirConf EU 2019 today.

I created a gist with all the code snippets, for easy copying and pasting into an iex session. I encourage you to try things out yourself!

P.S. Apologies to Fred for abusing the title of his awesome book…

Update: the video is now available:

Bram Verburg Learn you some 'ssl' for much security! - ElixirConfEU 2019

Older posts