Unverified Commit cddfede7 by devttys0 Committed by GitHub

Merge pull request #617 from QKaiser/fix-pfs-path-traversal

fix path traversal in PFS extractor script
parents a555eb1f 696fe34e
......@@ -104,7 +104,7 @@ class PFSExtractor(binwalk.core.plugin.Plugin):
data = binwalk.core.common.BlockFile(fname, 'rb')
data.seek(fs.get_end_of_meta_data())
for entry in fs.entries():
outfile_path = os.path.join(out_dir, entry.fname)
outfile_path = os.path.abspath(os.path.join(out_dir, entry.fname))
if not outfile_path.startswith(out_dir):
binwalk.core.common.warning("Unpfs extractor detected directory traversal attempt for file: '%s'. Refusing to extract." % outfile_path)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment