←back to thread

198 points kimi | 1 comments | | HN request time: 0s | source
Show context
aposm ◴[] No.43719774[source]
Oops..... we are currently trying to sell an elixir-based greenfield project internally. This doesn't affect elixir by default as other commenters pointed out, but still might make our project a bit harder to pitch to management...
replies(3): >>43720018 #>>43720413 #>>43724686 #
jerf ◴[] No.43720018[source]
If your organization is looking for "the language ecosystem that never has any security vulnerabilities", pack it in and close up shop because you're not going to find one. How many, how often, and how they are handled is far more important.

While the Erlang/Elixir ecosystem won't stop you from writing a network server that takes in a string and just blithely passes it along to a shell without analysis, overall the Erlang/Elixir ecosystem is very strong and lacks most of the footguns like an "eval" statement that get people. Though I will ding it a point for the most obvious way to run a shell command [1] taking just a string that goes to a shell rather than an array of parameters to a shell command.

It is on the higher end of secure languages to write a network server in.

replies(5): >>43720485 #>>43720496 #>>43720948 #>>43721090 #>>43723488 #
joshribakoff ◴[] No.43720496[source]
I’ve seen more horrendous code using macros in elixir even despite by brief foray than I have seen ever in decades of working in languages with eval. Like using them when normal functions would suffice.
replies(1): >>43725563 #
1. josevalim ◴[] No.43725563[source]
Using macros when a function would do is a legit anti-pattern (and documented as such [1]) but unrelated to the security aspect as they are compile-time constructs.

The reason they were added to the language was precisely so meta and dynamic programming is done at compile time, which you can introspect before you deploy, versus doing it at runtime, which is how most dynamic languages tackle this. And those languages are most likely not using eval either, but intrinsic features that allow you to define classes, attributes, methods, and so on programmatically.

I’d say eval is discouraged in most languages, although it is useful for building things like REPLs and interactive environments.

[1]: https://hexdocs.pm/elixir/macro-anti-patterns.html#unnecessa...