Skip to content

Commit

Permalink
Fix tarfile security issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarteau committed Dec 21, 2023
1 parent 58e9e43 commit d2d126c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cadastre/cadastre_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,12 @@ def unzipFolderContent(self, path):
for z in tarFileListA:
with tarfile.open(z) as t:
try:
t.extractall(os.path.join(self.edigeoPlainDir, 'tar_%s' % i))
# See https://docs.python.org/3.8/library/tarfile.html#tarfile.TarFile.extractall
# See https://peps.python.org/pep-0706/
t.extractall(
os.path.join(self.edigeoPlainDir, 'tar_%s' % i),
filter='data',
)
except tarfile.ReadError:
# Issue GitHub #339
self.go = False
Expand Down

0 comments on commit d2d126c

Please sign in to comment.