Security of software is still today a critical requirement as a lot of attacks exploit vulnerabilities in code. Securing software is, however, a complex process that requires, among other activities, analyzing the software specification and implementation. Many ML-based techniques or ML-based enhancements of conventional techniques have thus been proposed. In this chapter, we cover ML techniques for static analysis and ML-based fuzzing. We also discuss natural language processing techniques for the analysis of software specifications written in natural language to support different security-related tasks.