If there's a vulnerability in Whatsapp, the injected code should only affect Whatsapp.
Otherwise, it's (also) a vulnerability in iOS.