pickle
thin wrapper functions and information for pickle data
This section describes the thin wrapper api functions for processing pickle data. The underlying functionality primarily deals with pickled byte objects.
The thin api functions used for the maci library that enable some pickle functionality, use and wrap the native pickle library shipped with the python standard library for its underlying functionality.
For more information on the pickle library and official security concerns with pickling, visit: https://docs.python.org/3/library/pickle.html
Security awareness
It is important to evaluate handling pickled data carefully as it can be very insecure in dealing with pickle data. Please refer to the official python documentation above.
To store pickled data to a file using a technique that provides the opportunity to evaluate the pickled data as a byte value before processing it, see pickledumpbytes. This offers an alternative to storing pickled data to a file instead of using a straight pickle file, which is executable by nature, and enables more control over checking the integrity (using your own means) of the data being processed.
Extra information:
As closely mentioned on the main doc homepage, the maci language itself (not pickle functions) maintains a different more secure approach with techniques to ensure loading python data is not susceptible to code execution like what you would expect when you load a py or pickle file (as by design, and not to detract from their native power) to just access variables or attributes and their values. Python's documentation also states that pickle is insecure for that reason as well, but there are methods to make pickle secure for that purpose. It is more widely accepted to use common data serialization formats designed for storing values if you want to just load your values or data back whether you use maci or not, but maci does just that as well using python's native types to make your life easier with secure mechanics.
Last updated