Psych.safe_load restricts object classes, not the data shape

ruby dev.to

Psych.safe_load restricts object classes, not the data shape Ruby applications use YAML for configuration, fixtures, job payloads, and user-import files. Psych.safe_load is the right entry point for untrusted YAML because it limits which Ruby classes may be constructed. The limitation is easy to misread. Allowing a class means the parser may build that class. It does not validate the object graph, the size of aliases, or whether the application code that receives the object can safely

Read Full Tutorial open_in_new
arrow_back Back to Tutorials