The vulnerability, identified as CVE-2026-28407, exists in the malcontent library's handling of nested archives. The core issue was that if a nested archive failed to extract, the library would delete the archive file, preventing any further analysis of its contents. This could allow an attacker to bypass scanning by creating a specially crafted archive that triggers an extraction failure.
The analysis of the patch commit 356c56659ccfcad0b249a97de8cf71f151ed3ee9 pinpoints the vulnerable logic within the extractNestedArchive function in pkg/archive/archive.go. The diff clearly shows that the unconditional call to os.Remove(fullPath) was the source of the vulnerability. The fix wraps this call in a conditional block (if err == nil), ensuring that the archive is only deleted if it was successfully extracted. If extraction fails, the file is now preserved, allowing the scanner to process it as a regular file, thus mitigating the vulnerability. Therefore, archive.extractNestedArchive is the specific function that would be active during the exploitation of this vulnerability.