Malcontent could be made to create symlinks outside the intended extraction directory when scanning a specially crafted tar or deb archive. The handleSymlink function received arguments in the wrong order, causing the symlink target to be used as the symlink location. Additionally, symlink targets were not validated to ensure they resolved within the extraction directory.
Fixes:
Acknowledgements
Thank you to Oleh Konko from 1seal for discovering and reporting this issue.
Malcontent could be made to create symlinks outside the intended extraction directory when scanning a specially crafted tar or deb archive. The
handleSymlinkfunction received arguments in the wrong order, causing the symlink target to be used as the symlink location. Additionally, symlink targets were not validated to ensure they resolved within the extraction directory.Fixes:
Acknowledgements
Thank you to Oleh Konko from 1seal for discovering and reporting this issue.