The security advisory explicitly points out a path traversal vulnerability in the ArchiveReader.extractContents() function in apple/containerization. Analysis of the provided fixing commit, 3e93416b9a6d7b4c25fff7e9dea22a9ca687ee52, confirms this. The commit shows a complete replacement of the extractContents(to:) function within the file Sources/ContainerizationArchive/ArchiveReader.swift (which was renamed from Reader.swift).
The original, vulnerable implementation directly concatenated the path from the archive entry to the destination directory (let target = directory.appending(path: p)) without any sanitization or validation. This allows an attacker to craft an archive with file paths containing ../ sequences to escape the intended extraction directory.
The patch introduces a secure implementation that uses file descriptors and a new helper file, Sources/ContainerizationOS/FileDescriptor+SecurePath.swift, to perform secure path operations. The new code explicitly validates paths to ensure they do not contain traversal components (..) and do not follow symbolic links that could lead outside the extraction root. The vulnerable function is therefore the original ArchiveReader.extractContents(to:) which was removed by this patch.