Insecurity and Python pickles
Insecurity and Python pickles
Posted Mar 12, 2024 19:38 UTC (Tue) by atnot (guest, #124910)In reply to: Insecurity and Python pickles by pwfxq
Parent article: Insecurity and Python pickles
Pickle is used a lot by machine learning folks because it's an easy way to checkpoint long-running jobs. I've used it for that myself. You *could* hook up custom json serialization or something, but it's a pretty huge pain to do in python. And remember most of these people are researchers first and programmers second. And yes, sure, the pickles might be insecure, but they're you're pulling down megabytes of python code you don't understand to actually run the model anyway, so does it really matter?
And so, lacking better alternatives, the usage expands into new use cases until suddenly the theoretical issue becomes a practical one.
See also: PyYaml, which had all of these convenient functions for writing python inline in your local configuration files. Until people started using it for data interchange. Or the naive file format parsers of a nice convenient tool to resize your images. That then accidentally became the standard library people hooked up to their php sites.