WhatsApp and Telegram use a coding that ensures that only the sender and recipient of the messages can see its content, in simple words called encryption that differ from regular e-mails for example, and that could be the reason why the two Apps could not detect the malware content.