Sobelow.DOS.DecodeAtoms (Sobelow v0.17.0)

View Source

Atom exhaustion through decoders

Jason and Poison can create new atoms with keys: :atoms. YamlElixir's string readers can create atoms with atoms: true. Decoding untrusted input with these options can exhaust the VM's atom table because atoms are not garbage collected.

Prefer string keys, or keys: :atoms! in JSON decoders when only existing atoms are needed. Leave YamlElixir's atom conversion disabled for untrusted input. This check inspects literal options and dynamic decoder input; options built in variables or helper functions are not resolved.

DecodeAtoms checks can be ignored with:

$ mix sobelow -i DOS.DecodeAtoms

Summary

Functions

details()

id()

parse_def(fun)

rule()

run(fun, meta_file)