Reported by @a1loy , it is possible to specify a tar header that matches the random destination path as a prefix, but additionally has more elements as a suffix. In these cases we will still write out to a stereoscope temp directory that is cleaned up (thus this is not a security concern), but could allow for unintentional writes within that temp directory. This addresses the bug by explicitly performing a prefix check with a path separator.
Reported by @a1loy , it is possible to specify a tar header that matches the random destination path as a prefix, but additionally has more elements as a suffix. In these cases we will still write out to a stereoscope temp directory that is cleaned up (thus this is not a security concern), but could allow for unintentional writes within that temp directory. This addresses the bug by explicitly performing a prefix check with a path separator.