惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
V
Visual Studio Blog
Martin Fowler
Martin Fowler
The GitHub Blog
The GitHub Blog
T
The Blog of Author Tim Ferriss
博客园 - 三生石上(FineUI控件)
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
A
About on SuperTechFans
J
Java Code Geeks
博客园_首页
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
F
Full Disclosure
P
Proofpoint News Feed
The Register - Security
The Register - Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
aimingoo的专栏
aimingoo的专栏
有赞技术团队
有赞技术团队
P
Privacy International News Feed
美团技术团队
W
WeLiveSecurity
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
Schneier on Security
Schneier on Security
Schneier on Security
Engineering at Meta
Engineering at Meta
Cyberwarzone
Cyberwarzone
Microsoft Security Blog
Microsoft Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
G
GRAHAM CLULEY
H
Heimdal Security Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Attack and Defense Labs
Attack and Defense Labs
博客园 - 司徒正美
P
Privacy & Cybersecurity Law Blog
D
DataBreaches.Net
F
Fortinet All Blogs
博客园 - 【当耐特】
雷峰网
雷峰网
腾讯CDC
Hacker News - Newest:
Hacker News - Newest: "LLM"
Webroot Blog
Webroot Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
MongoDB | Blog
MongoDB | Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
OWASP Top 10 for LLMs: A Practitioner’s Implementation Guide
Improving · 2026-05-11 · via DEV Community

Large Language Models (LLMs) are becoming a core part of modern applications — from copilots and chatbots to AI agents connected to tools and internal systems. As adoption grows, so do the security risks.

The OWASP Top 10 for LLM Applications (2025) highlights the most common security issues teams must address when building AI-powered systems. These risks go beyond traditional application security because LLMs interact with prompts, external data, tools, and autonomous workflows.

In this post, we'll cover a practical overview of each risk and how teams can detect, prevent, and test for them.


LLM01:2025 — Prompt Injection

Prompt injection is when an attacker slips malicious instructions into user input or content the model reads, tricking it into doing something it shouldn't.

  • Direct injection: A user directly tells the model to ignore its rules.
  • Indirect injection: The model reads an external document or web page that secretly contains instructions and follows them without realizing it.

Example: An LLM connected to internal tools retrieves a document containing hidden instructions telling it to export database credentials. The model follows the instruction and triggers a data leak.

How to Detect It

  • Watch for phrases like "ignore previous instructions" or "pretend you are" in user input
  • Compare inputs against known malicious prompt patterns
  • Alert on unusual tool calls — especially ones fetching or exporting data unexpectedly
  • Log all inputs and outputs so you can trace what happened after an incident

How to Prevent It

  • Make sure system-level rules can't be overridden by user messages
  • Sanitize and validate any external content before passing it to the model
  • Use clear separators between instructions and data in your prompts
  • Apply least-privilege access — the model should only be able to call what it needs
  • Add output filters to block unsafe responses before they reach users

How to Test It

Run red-team tests that simulate both direct and indirect injection attempts. Use automated prompt fuzzing to probe edge cases. After any prompt changes, run regression tests to confirm your safety rules still hold.


LLM02:2025 — Sensitive Information Disclosure

This happens when an LLM leaks personal data, API keys, credentials, or internal documents in its responses. It can occur through direct questions, indirect prompt injection, or a retrieval system that doesn't properly restrict access to sensitive documents.

Example: An internal HR assistant retrieves employee salary records during a broad query and includes them in its response — even though the user asking had no right to see them.

How to Detect It

  • Scan model outputs for PII (names, emails, ID numbers) and secrets (API keys, passwords)
  • Monitor what documents the retrieval system is fetching and whether they match the user's access level
  • Flag responses with unusual patterns like long random strings, which could be tokens or keys

How to Prevent It

  • Redact sensitive data before it gets indexed or fed into the model
  • Only retrieve documents the current user is actually allowed to see
  • Add an output filter that blocks responses containing classified data
  • Keep sensitive data stores separate from general knowledge sources

How to Test It

Try prompting the system to extract personal records or credentials through indirect queries. Verify that restricted data can't be retrieved through similarity-based tricks. Check that access controls on your retrieval system are actually working end-to-end.


LLM03:2025 — Supply Chain Vulnerabilities

LLM applications depend on many third-party components — base models, plugins, vector databases, MCP servers, and embedding providers. Any one of these can be a weak link. A malicious or compromised dependency can manipulate outputs, steal data, or take unexpected actions.

Example: An application uses a third-party MCP server for document processing. A malicious update modifies the server's tool responses to inject hidden instructions, causing the app to expose sensitive data.

How to Detect It

  • Keep a full inventory of every model, plugin, connector, and tool your application uses
  • Generate and maintain a Software Bill of Materials (SBOM) so you know what's inside
  • Watch for unexpected changes in model or tool behavior after updates
  • Correlate version upgrades with any new security anomalies

How to Prevent It

  • Vet vendors before integrating their tools — check their security practices and update history
  • Verify model weights and tool packages using checksums and cryptographic signing
  • Give third-party tools the minimum permissions they need, nothing more
  • Isolate external services in controlled network segments where possible

How to Test It

Regularly scan dependencies for known vulnerabilities. Test that third-party tools behave exactly as documented with no hidden inputs and no unexpected outputs. Before upgrading a dependency in production, simulate the upgrade in a test environment first.


LLM04:2025 — Data and Model Poisoning

Data poisoning happens when malicious data is introduced into training datasets or the retrieval corpus. In fine-tuning, poisoned samples can embed hidden behaviors that activate on specific triggers. In RAG systems, an attacker can insert crafted documents into the vector store so the model retrieves and trusts corrupted context.

Example: A RAG system indexes public documentation. An attacker adds a document with hidden instructions that changes how the model responds whenever a specific keyword is used.

How to Detect It

  • Track where every piece of data comes from before it enters your pipeline
  • Look for documents that appear in retrieval results far more often than you'd expect
  • Monitor for sudden shifts in model behavior after a dataset update
  • Check embeddings for outliers that don't fit the rest of your corpus

How to Prevent It

  • Control who can write to your vector store — don't allow open ingestion
  • Require human review for any high-impact data before it's added
  • Version your datasets so you can roll back if something goes wrong
  • Don't automatically ingest content from untrusted external sources

How to Test It

Use canary data — known triggers — to check whether the model has been altered. Compare model behavior before and after dataset updates. Periodically audit your retrieval corpus for documents that don't belong.


LLM05:2025 — Improper Output Handling

Output risk occurs when LLM responses are used directly — rendered as HTML, inserted into SQL queries, or passed to shell commands — without any validation. Because model output is probabilistic, it can contain unexpected characters or code-like content. Treating it as trusted input is the mistake.

How to Detect It

  • Scan model outputs for suspicious patterns: script tags, SQL special characters, shell operators
  • Watch downstream systems for unexpected queries or commands
  • Enable Content Security Policy (CSP) violation reporting to catch injected scripts

How to Prevent It

  • Always encode output before rendering it — treat it the same way you'd treat user-submitted content
  • Never pass model output directly to a shell command, SQL query, or code evaluator
  • Use parameterized queries instead of string concatenation
  • Validate outputs against a strict schema — for example, require JSON with defined fields

How to Test It

Deliberately include injection payloads in model responses during testing and verify they are neutralized before rendering. Review all code paths where LLM output flows into execution layers or sensitive APIs.


LLM06:2025 — Excessive Agency

When an LLM agent is given too much autonomy — access to APIs, databases, or infrastructure without proper guardrails — it can chain together actions that were never intended. This can cause real damage: deleted records, unexpected transactions, or service disruptions, often triggered by an ambiguous instruction or injected prompt.

How to Detect It

  • Log every action the agent takes, including its reasoning steps
  • Alert when an agent exceeds a set number of actions in a sequence
  • Track cross-system changes that could indicate the agent acted beyond its scope

How to Prevent It

  • Require human approval before the agent takes any high-risk or irreversible action
  • Limit how many steps an agent can chain together
  • Give agents time-limited credentials with the minimum permissions needed
  • Keep planning and execution separate — don't let the model decide and act in one step

How to Test It

Test agents against adversarial and ambiguous prompts to identify how they behave under pressure. Verify that kill switches actually stop an agent mid-task. Run stress tests to observe what happens when objectives conflict.


LLM07:2025 — System Prompt Leakage

The system prompt often contains safety rules, tool schemas, internal logic, and operational details that were never meant to be visible. If an attacker can get the model to reveal this content, they learn exactly how to bypass your controls.

Example: A user repeatedly asks the model to repeat its hidden instructions. After several attempts, the model partially reveals the safety rules embedded in its system message.

How to Detect It

  • Watch for responses that look like internal instructions or policy text
  • Flag repeated meta-questions like "what are your instructions" or "ignore your rules"
  • Use automated red-teaming tools to simulate extraction attempts

How to Prevent It

  • Don't store credentials, API endpoints, or secrets inside the system prompt
  • Use output filters that block responses referencing hidden instructions
  • Keep policy logic separate from natural language instructions
  • Structure prompts so system rules cannot be disclosed in response to user requests

How to Test It

Run structured extraction prompts specifically designed to coerce the model into revealing system content. After every prompt update, re-test to confirm that nothing new has leaked. Rotate system prompts if exposure is confirmed.


LLM08:2025 — Vector and Embedding Weaknesses

RAG systems rely on vector similarity to retrieve relevant documents. Attackers can craft documents with embeddings specifically designed to dominate retrieval results, hijacking the context the model receives. Poorly secured vector stores can also expose source content through embedding inversion — where attackers attempt to reconstruct original content from stored embeddings.

Example: A malicious document inserted into a public knowledge base is embedded to closely match frequent queries, causing it to be consistently retrieved and influence the model's output.

How to Detect It

  • Monitor for documents appearing far more often than expected across unrelated queries
  • Check for sudden shifts in the distribution of your embedding space
  • Audit who can write to your vector store and when changes were made

How to Prevent It

  • Restrict write access to the vector store — require authentication for all ingestion
  • Combine semantic similarity with keyword or rule-based filtering as a second check
  • Encrypt embeddings at rest and isolate vector infrastructure
  • Periodically re-index and validate your corpus to catch tampered documents

How to Test It

Simulate retrieval hijacking by inserting adversarial documents and checking whether they surface in results. Compare retrieval output from a clean corpus against your live one. Audit ingestion logs to see when and what was added.


LLM09:2025 — Misinformation

LLMs can confidently generate content that is factually wrong — fabricated statistics, non-existent citations, and outdated information. In applications used for decision-making, legal work, or reporting, this can cause serious real-world harm.

How to Detect It

  • Cross-check claims against trusted knowledge sources or retrieval results
  • Flag responses that make factual claims without citations in high-stakes domains
  • Monitor for contradictions across multi-turn conversations

How to Prevent It

  • Ground responses in retrieved, verifiable sources rather than relying on the model's memory
  • Require citations for any regulated or high-stakes use case
  • Add confidence indicators so users know when the model is less certain
  • Require human review before allowing the model to publish in high-impact contexts — do not permit autonomous publishing

How to Test It

Run benchmark evaluations using fact-sensitive datasets. Test with adversarial prompts designed to produce hallucinated references and measure how often they appear. Put corrections in place and notify affected parties if fabricated content has already been published.


LLM10:2025 — Unbounded Consumption

Without limits, LLM interactions can spiral into excessive token usage, recursive agent loops, or rapid API call chains. The result is infrastructure strain, massive cost overruns, or denial of service — sometimes triggered accidentally, sometimes by a malicious user probing for weaknesses.

How to Detect It

  • Track token usage per session and per user against expected baselines
  • Alert on recursive tool calls or unusually deep action chains
  • Use cost anomaly detection on your API and compute bills

How to Prevent It

  • Set hard token limits and cap response lengths
  • Apply rate limiting per user, per tenant, or per session
  • Limit how deep an agent can chain actions
  • Require confirmation before the model starts a high-cost operation

How to Test It

Simulate recursive prompts and measure whether your safeguards kick in. Test rate limiting and quota enforcement under high concurrency. After any incident, audit usage logs to understand the financial and operational impact.


Conclusion

LLM security is an engineering discipline, not an afterthought. The OWASP Top 10 for LLM Applications highlights that securing AI systems requires more than traditional application security practices. Teams must also address risks related to prompts, training data, external dependencies, and autonomous agents.

Building secure LLM systems requires layered protections, careful data management, strong observability, and continuous testing. The table below summarizes the key controls across all ten risk categories as a quick-reference checklist for teams designing, deploying, or operating LLM-enabled systems.

Risk Detect Prevent Respond
Prompt Injection Log inputs, pattern match Sanitize inputs, least-privilege Trace and remediate
Sensitive Disclosure Scan outputs for PII/secrets Redact data, enforce access controls Block and audit
Supply Chain SBOM, behavior monitoring Vet vendors, verify checksums Rollback, isolate
Data Poisoning Track data provenance, monitor embeddings Control ingestion, version datasets Roll back corpus
Improper Output Handling Scan for injection patterns Encode outputs, parameterized queries Review execution paths
Excessive Agency Log agent actions, action limits Human approval, least-privilege creds Kill switch, audit
System Prompt Leakage Watch for meta-questions No secrets in prompts, output filters Rotate prompts
Vector/Embedding Weaknesses Monitor retrieval patterns Restrict write access, encrypt embeddings Re-index, audit logs
Misinformation Cross-check claims, flag unsourced content Ground in retrieval, require citations Notify, correct
Unbounded Consumption Track token usage, cost anomalies Rate limits, hard token caps Audit usage, throttle

Understanding these risks is the first step. For edge cases and complex deployments, consider working with security experts who specialise in AI systems.

If you found this post useful or have real-world experiences to share, feel free to connect on LinkedIn.