Malware authors often take advantage of vulnerabilities in popular software. But, malware is also prone to bugs and coding errors, causing it to crash and serve as backdoors — any method by which authorized and unauthorized users can get around normal security measures and gain high-level user access — for white hat hackers.
https://www.securitymagazine.com/articles/96348-bugs-in-malware-creating-backdoors-for-security-researchers