Understanding prompt injection attacks in Web-based LLM applications and basic mitigation strategies
Shaha, Hridoy (2025)
Shaha, Hridoy
2025
All rights reserved. This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-2025052315309
https://urn.fi/URN:NBN:fi:amk-2025052315309
Tiivistelmä
Natural language processing systems are being revolutionized by large language models (LLMs), which allow them to do complex tasks requiring advanced technology, generate text that mimics human speech, and more. However, their connection to online apps has also made serious security flaws like prompt injection attacks possible. The thesis here explores the underlying mechanics of these prompt injection attacks, which it divides into two types: direct prompt injection attacks and indirect prompt injection attacks. In direct prompt attacks, criminals attach a command directly to users' inputs, and in indirect methods, they obtain outside references to embed the malicious payloads. The study shows how prompt injection can compromise a system's integrity, expose confidential data, and destroy user faith through specific case studies of hacked AI assistants. In response, this work presents an architecture for multiple mitigations through robust authentication and authorization mechanisms, high-level validation, and sanitization of input, and continuous surveillance to detect and act upon any malicious activity. In this study, it promises future indications in adaptive security measures and makes a direct analysis of the strengths and weaknesses of existing defenses to inform adaptive security measures that will change pace with new threats. In addition, this study propels development in the direction of creating applications that are faster and therefore more reliable and secure based on LLMs, thus ensuring gain from such innovative systems without compromising online security.