Protecting Systems from Exploits Using Language-Theoretic Security