Kuboid
Open Luck·Kuboid.in
Security BSides2025
Open in YouTube ↗

Threat Modeling Meets Model Training: Web App Security Skills for AI

Security BSides San Francisco85 views29:055 months ago

This talk demonstrates how traditional web application security principles, such as threat modeling and input sanitization, are directly applicable to securing AI and Large Language Model (LLM) implementations. It highlights specific risks like prompt injection, data poisoning, and insecure deserialization within AI pipelines. The speaker emphasizes that AI security is not a unique domain but an extension of existing security practices, requiring rigorous guardrails and access control. The presentation provides a practical framework for applying standard security methodologies to mitigate risks in AI-driven systems.

Why Your LLM Implementation Is Just Another Web App Vulnerability

TLDR: Large Language Models are not magic boxes; they are software components that inherit the same classic vulnerabilities as any other web application. By treating AI pipelines as standard data processing chains, researchers are finding that traditional injection, access control, and deserialization flaws are just as lethal in an AI context. If you are testing these systems, stop looking for "AI-specific" bugs and start looking for the same old bugs in the new, opaque interfaces that LLMs provide.

Security researchers often treat AI as a black box, assuming that because the underlying architecture is probabilistic, the attack surface must be fundamentally different. This is a mistake. When you strip away the marketing, an LLM implementation is just a web application that takes user input, processes it through a series of APIs, and returns a response. The same vulnerabilities that have plagued web applications for decades are alive and well in the world of generative AI.

The Myth of the Unique AI Threat

Many teams are currently scrambling to build "AI-specific" security programs, but they are missing the forest for the trees. The core risks in AI pipelines are not novel; they are simply old vulnerabilities manifesting in new, more complex ways. When you look at the OWASP Top 10, you see a roadmap for attacking almost any LLM-integrated application.

Take Injection, for example. In a standard web app, you might be looking for SQLi or command injection. In an LLM, that same vulnerability is now called prompt injection. The mechanism is identical: an attacker provides untrusted input that the application fails to sanitize, allowing the attacker to manipulate the execution flow. Whether you are breaking out of a SQL query or breaking out of a system prompt, the root cause is the same failure to distinguish between data and instructions.

Where the Attack Surface Actually Lives

The real danger in modern AI deployments is the reliance on third-party libraries and opaque, pre-trained models. When you pull a model from Hugging Face, you are essentially importing a massive, unverified binary blob. If that model was trained on poisoned data, or if the serialization format used to store the model weights is vulnerable to Insecure Deserialization, you have already lost.

During a penetration test, your focus should be on the data flow. Where does the user input go? Does it hit a database before reaching the model? Is the model output rendered directly into the DOM? If you find a chat interface that reflects user input without proper encoding, you are looking at a classic Cross-Site Scripting vector, regardless of whether the text was generated by a human or an LLM.

Consider this simple scenario: a user asks a chatbot to summarize a document. If the chatbot is configured to fetch that document from a URL provided by the user, you have an SSRF vulnerability. If the chatbot then takes the content of that document and injects it into a system prompt to "guide" the summary, you have a perfect storm of prompt injection and data exfiltration.

Testing for Access Control Failures

Access control is where most AI implementations fall apart. Developers often assume that because an LLM is "smart," it will automatically understand user permissions. It will not. If you have an AI feature that can query a backend database, you must ensure that the AI is constrained by the same identity and access management (IAM) policies as any other service.

If you are testing an AI-enabled application, try to perform privilege escalation by manipulating the context. Can you force the model to act as an administrator by providing a crafted prompt? If the model has access to an API that performs state-changing operations, such as updating a user's account or initiating a payment, you should be testing whether you can trigger those operations without the appropriate authorization.

The Reality of Opaque Training Data

One of the most difficult aspects of securing AI is the lack of visibility into the training data. Even if you fine-tune a model on your own internal data, you are likely using a base model that was trained on the open internet. This means that sensitive information, PII, or even malicious payloads could be embedded in the model's weights.

There is no guaranteed way to ensure that what is put into a model will not come out. If you are working with a client that is deploying AI, your job is to help them understand that they are building on top of a foundation they do not fully control. This is why "guardrails"—the layers of filtering and validation you place around the model—are the most critical part of the architecture.

What to Do Next

Stop treating AI as a separate security silo. If you are a pentester, your existing web application security skills are your most valuable asset. Use them to map the data flow, identify the trust boundaries, and look for the same old injection and access control flaws. If you are a developer, stop trying to "fix" the model and start focusing on the infrastructure around it.

The next time you are tasked with testing an AI-driven system, don't look for the "AI bug." Look for the broken access control, the unvalidated input, and the insecure component. The AI is just the interface; the vulnerabilities are the same ones we have been fighting for years. Keep your wits about you, keep asking questions, and don't let the hype distract you from the fundamentals. The work is never finished, but the path to securing these systems is clearer than most people think.

Talk Type
talk
Difficulty
intermediate
Has Demo Has Code Tool Released


BSidesSF 2025

94 talks · 2025
Browse conference →
Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in