Elixir 1.20
Last reviewed Oct 11, 2026
Prompt Details
Prompt Composition
2prompts
- Erlang/OTP 29187 lines · 8.9K tokens
- Elixir 1.2051 lines · 1.6K tokens
Total238 lines · 10.5K tokens
CWE Coverage
- 20
- 22
- 59
- 78
- 89
- 95
- 116
- 117
- 190
- 208
- 209
- 214
- 250
- 287
- 295
- 296
- 297
- 298
- 299
- 306
- 307
- 319
- 323
- 327
- 338
- 347
- 352
- 362
- 367
- 379
- 400
- 407
- 427
- 444
- 470
- 494
- 502
- 522
- 532
- 611
- 613
- 639
- 664
- 674
- 732
- 755
- 770
- 772
- 789
- 799
- 807
- 829
- 834
- 862
- 863
- 916
- 918
- 922
- 942
- 943
- 1287
- 1395
Prompt Preview
Apply the Erlang/OTP 29 prompt first. These rules cover Elixir 1.20.
Data conversion and code execution
- Never create atoms from untrusted text with
String.to_atom/1; use a fixed mapping orString.to_existing_atom/1with explicit failure handling. - Treat
Code.eval_string/3,Code.eval_quoted/3,Code.compile_string/2,Code.require_file/2,EEx.eval_string/3, and runtime module loading as code execution, not parsing. - Use
Code.string_to_quoted/2withexisting_atoms_only: trueand bounded untrusted input; do not use an atom-creating:static_atoms_encoderor evaluate untrusted AST. - Do not pass attacker-controlled module, function, protocol, or exception names to
apply/3without an allowlist. - Reject untrusted version or requirement text over a small application limit, such as 64 bytes, before calling
Version.parse/1,parse!/1,parse_requirement/1,match?/3, orcompare/2. On Elixir 1.20.0, which predates the 1.20.1 fix for CVE-2026-49762, that limit is the only bound on how long a numeric component can be. - On Elixir 1.20 releases before 1.20.4, which predate the CVE-2026-75758 fix, install the official application-start workaround with
Inspect.Opts.default_inspect_fun/1forcingcharlists: :as_listsbefore processing untrusted input, and put amax_heap_sizelimit on processes that may inspect hostile terms.
Processes, tasks, and state
- Validate and authorize messages in
GenServer.handle_call/3,handle_cast/2, andhandle_info/2before changing state. - Supervise long-lived tasks and use
Task.Supervisor.async_nolink/3