This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path | |
import zipfile | |
# tested with python 3.8.10 | |
def secure_zipfile_extractall(zip_filedesc, target_directory): | |
"""Copy all files recorded in zipfile `zip_filedesc` | |
to the directory `target_directory`, but prevent malicious filepaths | |
like `../../../etc/hosts` by using os.path.normpath | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The status file: | |
import ansible # tested with 6.7.0 | |
import ansible_runner # tested with 2.3.1 | |
[…] | |
r = ansible_runner.run( | |
private_data_dir="ansible/web", |
OlderNewer