Skip to content

Commit cddfede

Browse files
authored
Merge pull request #617 from QKaiser/fix-pfs-path-traversal
fix path traversal in PFS extractor script
2 parents a555eb1 + 696fe34 commit cddfede

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/binwalk/plugins/unpfs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def extractor(self, fname):
104104
data = binwalk.core.common.BlockFile(fname, 'rb')
105105
data.seek(fs.get_end_of_meta_data())
106106
for entry in fs.entries():
107-
outfile_path = os.path.join(out_dir, entry.fname)
107+
outfile_path = os.path.abspath(os.path.join(out_dir, entry.fname))
108108
if not outfile_path.startswith(out_dir):
109109
binwalk.core.common.warning("Unpfs extractor detected directory traversal attempt for file: '%s'. Refusing to extract." % outfile_path)
110110
else:

0 commit comments

Comments
 (0)