Apple has patched a bug found by a Microsoft security researcher that can enable attackers to bypass application execution restrictions.