erlef / erlef/elixir-secure-coding

Confusing code example in Section 5: Untrusted Code

未關閉
#39 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug small adjustment
主要語言
Elixir
星號
731
分支
172
PR 合併指標
30 天內沒有已合併 PR

描述

In Section 5: Untrusted Code there's this example that is suggested to be insecure:

```elixir
name = Kino.Input.text("What's your name?")
```

```elixir
textfield_value = Kino.Input.read(name)
{result, binding} = Code.eval_string("a", a: textfield_value)
"Hello, " <> result
```

We did this security training at my small team at work and none of us could figure out how to choose an input that would prove that this code is insecure. See screenshot for example. Is it possible that this example is not correct? Was it supposed to say `Code.eval_string(textfield_value)` instead? That would definitely be insecure.

![Screenshot 2022-11-29 at 15 35 21](https://user-images.githubusercontent.com/7852553/204557541-48b9be12-cfda-4713-afd8-7a434ecc9b82.png)

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。