Preprint · 2025 · Open access

LLM Security: Vulnerabilities, Attacks, Defenses, and Countermeasures

Francisco Aguilera-Martínez, Fernando Berzal

arXiv (Cornell University) · Published 2 May 2025 · DOI 10.48550/arxiv.2505.01177

Open PDFView at the publisherCite this paper

In brief

“LLM Security: Vulnerabilities, Attacks, Defenses, and Countermeasures” is a 2025 preprint by Francisco Aguilera-Martínez and Fernando Berzal, published in arXiv (Cornell University). OpenAlex counts 36 citations as of 19 November 2026. It is open access: the full text is free to read at arXiv (Cornell University).

Citations
36
Most cited in
2026 (21)
References
160
Authors
2

Abstract

As large language models (LLMs) continue to evolve, it is critical to assess the security threats and vulnerabilities that may arise both during their training phase and after models have been deployed. This survey seeks to define and categorize the various attacks targeting LLMs, distinguishing between those that occur during the training phase and those that affect already trained models. A thorough analysis of these attacks is presented, alongside an exploration of defense mechanisms designed to mitigate such threats. Defenses are classified into two primary categories: prevention-based and detection-based defenses. Furthermore, our survey summarizes possible attacks and their corresponding defense strategies. It also provides an evaluation of the effectiveness of the known defense mechanisms for the different security threats. Our survey aims to offer a structured framework for securing LLMs, while also identifying areas that require further research to improve and strengthen defenses against emerging security challenges.

Cite this paper

Formatted from the catalogue record. Check names, capitals and page numbers against the paper before you submit.

APA 7

Aguilera-Martínez, F., & Berzal, F. (2025). LLM Security: Vulnerabilities, Attacks, Defenses, and Countermeasures. arXiv (Cornell University). https://doi.org/10.48550/arxiv.2505.01177

MLA 9

Aguilera-Martínez, Francisco, and Fernando Berzal. “LLM Security: Vulnerabilities, Attacks, Defenses, and Countermeasures.” arXiv (Cornell University), 2025. https://doi.org/10.48550/arxiv.2505.01177.

Chicago

Aguilera-Martínez, Francisco and Fernando Berzal. 2025. “LLM Security: Vulnerabilities, Attacks, Defenses, and Countermeasures.” arXiv (Cornell University). https://doi.org/10.48550/arxiv.2505.01177.

Harvard

Aguilera-Martínez, F. and Berzal, F. (2025) ‘LLM Security: Vulnerabilities, Attacks, Defenses, and Countermeasures’, arXiv (Cornell University). doi:10.48550/arxiv.2505.01177.

IEEE

F. Aguilera-Martínez and F. Berzal, “LLM Security: Vulnerabilities, Attacks, Defenses, and Countermeasures,” arXiv (Cornell University), 2025, doi: 10.48550/arxiv.2505.01177.

BibTeX

@misc{aguileramartinez2025security,
  title     = {{LLM Security: Vulnerabilities, Attacks, Defenses, and Countermeasures}},
  author    = {Aguilera-Martínez, Francisco and Berzal, Fernando},
  howpublished = {arXiv (Cornell University)},
  year      = {2025},
  doi       = {10.48550/arxiv.2505.01177},
  url       = {https://doi.org/10.48550/arxiv.2505.01177}
}

Download for a reference manager: BibTeX (.bib) · RIS for Zotero, Mendeley and EndNote (.ris)

Topic and keywords

Physical Sciences › Computer Science › Artificial Intelligence › Adversarial Robustness in Machine Learning

  • large language models
  • LLM security
  • security vulnerabilities
  • defense mechanisms

Work with this paper

Most-cited papers in Computer Science

All highly cited Computer Science papers

Questions about this paper

How do I cite this paper in APA style?

Aguilera-Martínez, F., & Berzal, F. (2025). LLM Security: Vulnerabilities, Attacks, Defenses, and Countermeasures. arXiv (Cornell University). https://doi.org/10.48550/arxiv.2505.01177

How many times has this paper been cited?

36 times, according to OpenAlex on 19 November 2026. Google Scholar and Scopus count different sets of sources, so their numbers differ.

Is this paper free to read?

Yes. It is open access at arXiv (Cornell University): sign in and open the PDF from this page.

Who wrote this paper?

Francisco Aguilera-Martínez, Fernando Berzal.

What is the DOI of this paper?

10.48550/arxiv.2505.01177, permanently at https://doi.org/10.48550/arxiv.2505.01177. Sign in and open it from this page.

Bibliographic data from OpenAlex (CC0), last checked 19 November 2026. ResearchGuru does not host this paper; once you are signed in, the links open it at the publisher or the repository that does.