Summary
Fix the zip-slip / path-traversal vulnerability reported in #1339.
Archive.extract_archive() in packages/main/src/RPA/Archive.py calls zipfile.ZipFile.extractall() and tarfile.TarFile.extractall() on archive members without validating that resolved member paths stay within the target extraction directory. A crafted archive entry (e.g. ../../evil.py) can write files outside the intended path.
Location
packages/main/src/RPA/Archive.py, extract_archive() (currently lines ~374-386).
Fix approach
- Before extracting, resolve each member's destination path against the target directory and reject/skip entries that would escape it (classic Zip Slip guard), for both the
zipfile and tarfile branches.
- For
tarfile, additionally pass filter="data" (Python 3.12+ safe extraction filter) where available.
- Add a regression test using a crafted archive with a
../ path traversal entry, asserting extraction is rejected/contained.
Related
Sub-issue of #1339.
Summary
Fix the zip-slip / path-traversal vulnerability reported in #1339.
Archive.extract_archive()inpackages/main/src/RPA/Archive.pycallszipfile.ZipFile.extractall()andtarfile.TarFile.extractall()on archive members without validating that resolved member paths stay within the target extraction directory. A crafted archive entry (e.g.../../evil.py) can write files outside the intendedpath.Location
packages/main/src/RPA/Archive.py,extract_archive()(currently lines ~374-386).Fix approach
zipfileandtarfilebranches.tarfile, additionally passfilter="data"(Python 3.12+ safe extraction filter) where available.../path traversal entry, asserting extraction is rejected/contained.Related
Sub-issue of #1339.