Any mechanism that could lead to a breach of the security of a system in the presence of a threat. Vulnerabilities may arise unintentionally due to inadequacy of design or incomplete debugging. Alternatively the vulnerability may arise through malicious intent, e.g. the insertion of a Trojan horse.