Prevent application security threats by working through the OWASP Top 10:2025 as a checklist: enforce server-side access control, use parameterized queries and output encoding, keep secrets out of code, patch dependencies, set secure defaults, use strong authentication with phishing-resistant MFA, log security events, and test with SAST, DAST and penetration testing. Add threat modeling in design, because the cheapest flaw to fix is the one never shipped.
Key takeaways
- Broken access control is the top OWASP risk: enforce authorization on the server, on every request, by default.
- Injection, including XSS and SQL injection, is prevented by keeping data separate from code, not by filtering alone.
- Prevention is a lifecycle: threat modeling, secure defaults, patching, logging, and regular testing, not a single tool.
Most application breaches are not novel. They reuse the same weaknesses — a missing permission check, an unpatched library, a secret in source code — against thousands of applications at once. Prevention means closing those weaknesses systematically, not chasing the latest exploit.
What are application security threats?
Application security threats are weaknesses in how software is designed, built, and run that let an attacker read, change, or steal data, or take over accounts. OWASP groups the most critical ones into its Top 10, a list drawn from real-world testing data and updated every few years.
The current edition is the OWASP Top 10:2025. In order, it lists broken access control, security misconfiguration, software supply chain failures, cryptographic failures, injection, insecure design, authentication failures, software and data integrity failures, logging and alerting failures, and mishandling of exceptional conditions.
This guide works through each one with the control that stops it. Use it as a checklist for a new application, or as a review for one already in production.
How do you prevent broken access control?
Broken access control, A01 in the OWASP Top 10:2025, is the top risk. It means users can act outside their intended permissions: reading another user's invoice, reaching an admin function, or changing a record that is not theirs.
Enforce authorization on the server, on every request, and deny by default. Never rely on the user interface hiding a button, because an attacker can call the API directly. For multi-tenant applications, every query that returns user data should include the authenticated user's ID as a constraint.
Test it deliberately: log in as an ordinary user and try to read or change another user's records by changing IDs in URLs and API calls. If the server allows it, the control is missing. Log access-control failures and alert on repeated 403 errors from one session.
How do you prevent injection attacks?
Injection, A05 in 2025, happens when untrusted data is sent to an interpreter as part of a command or query, so the data changes the command itself. SQL injection, OS command injection, LDAP injection, and cross-site scripting all belong here.
Use parameterized queries or prepared statements for every database call. The query text holds placeholders and the values travel separately, so the database never parses them as SQL. An apostrophe in a surname is then just a character, not the end of a query.
// Vulnerable: input becomes part of the query
db.query("SELECT * FROM users WHERE name = '" + name + "'");
// Fixed: input travels as data
db.query("SELECT * FROM users WHERE name = $1", [name]);
For XSS, encode output for the context where data is inserted. Our cross-site scripting example walks through reflected, stored, and DOM-based cases in code. For other interpreters, validate input against an allowlist and never pass user data to a shell.
How do you prevent security misconfiguration?
Security misconfiguration, A02 in 2025, covers default credentials, debug endpoints left in production, verbose error messages, unnecessary features, and missing security headers. It rose from fifth place in 2021, which shows how common it remains.
Start from secure defaults: remove sample applications and unused pages, disable directory listing, and turn off debug mode in production. Change every default password before a system goes live, and store credentials in a secrets manager, never in code or configuration files.
Set security headers on every response, including a strict Content Security Policy and HTTP Strict Transport Security. Check them with our free security headers checker, and automate the check so a deployment cannot silently drop them.
How do you prevent software supply chain failures?
Software supply chain failures, A03 in 2025, is a new category covering vulnerable, malicious, or compromised dependencies, builds, and distribution. Modern applications are mostly third-party code, so a flaw in a library is a flaw in your application.
Keep a software bill of materials, a list of every dependency and version you ship. Pin versions with a lockfile, update on a schedule, and enable automated dependency alerts so a known vulnerability in a library reaches you within days, not months.
Only install packages from trusted registries, verify signatures where available, and review what a new dependency pulls in. A small utility library that depends on dozens of other packages is a larger risk than it looks.
How do you prevent cryptographic failures and leaked secrets?
Cryptographic failures, A04 in 2025, include sensitive data sent over plain HTTP, weak or home-made cryptography, and passwords stored with fast hashes such as MD5 or SHA-1. The fix is boring on purpose: use vetted libraries and standard algorithms.
Enforce HTTPS everywhere, including service-to-service traffic, and set HSTS so browsers refuse plain HTTP. Store passwords with a work-factor algorithm such as Argon2id or bcrypt. Encrypt sensitive data at rest with AES-GCM through a standard library, and never roll your own cryptography.
Keep secrets out of source code entirely. API keys, tokens, and passwords belong in a secrets manager or environment configuration, with rotation and least-privilege access. Scan repositories for committed secrets, because a key pushed to a public repository is compromised the moment it lands.
How do you prevent authentication failures?
Authentication failures, A07 in 2025, cover weak passwords, missing multi-factor authentication, credential stuffing, and sessions that never expire. Attackers automate login attempts at scale, so even a small application is a target.
Require strong, unique passwords and check new ones against known breach data. Offer phishing-resistant multi-factor authentication — passkeys or security keys — and require it for administrators. Limit login attempts, lock or delay repeated failures, and expire sessions after inactivity.
Do not build authentication yourself unless you have to. A vetted identity library or provider handles password storage, session management, and recovery flows that are easy to get wrong. If you must build it, follow NIST guidance on passwords and authenticators rather than inventing rules.
What is insecure design, and how do you prevent it?
Insecure design, A06 in 2025, is a flaw in the plan rather than the code. The code works as written, but the flow is unsafe: a password reset with unlimited attempts, a checkout that trusts a price sent by the browser, or a support form that reveals whether an email address has an account.
Prevent it with threat modeling during design. For each feature, ask who the attackers are, what they want, and how the feature could be abused. Write abuse cases into the backlog alongside user stories, and set secure defaults such as rate limits, server-side price checks, and generic error messages.
This is the category where CISA's Secure by Design guidance matters most: security should be a design requirement, not a feature added after launch. The cheapest flaw to fix is the one that is never shipped.
How do integrity failures and poor logging help attackers?
Software and data integrity failures, A08, cover updates and code that are not verified before use: unsigned packages, unprotected CI pipelines, and deserialization of untrusted data. Verify signatures, protect build pipelines with least privilege, and never deserialize data from an untrusted source.
Logging and alerting failures, A09, mean attacks happen unnoticed. Log authentication failures, access-control failures, and input validation failures with enough context to investigate, but never log passwords or tokens. Alert on patterns, not just single events: a burst of failed logins or a sudden rise in 403 errors is a signal.
Mishandling of exceptional conditions, A10, is the second new 2025 category. Errors should fail closed: if a security check cannot run, deny access rather than allowing it, and show users a generic message while the detail goes to the log.
| OWASP Top 10:2025 | Main control | When to apply it |
|---|---|---|
| A01 Broken access control | Server-side authorization, deny by default | Every endpoint, every request |
| A02 Security misconfiguration | Secure defaults, headers, no debug in prod | Deployment and review |
| A03 Supply chain failures | SBOM, pinned versions, dependency alerts | Every build |
| A04 Cryptographic failures | TLS, Argon2id or bcrypt, vetted libraries | Design and code |
| A05 Injection | Parameterized queries, output encoding | Every query and page |
| A06 Insecure design | Threat modeling, abuse cases | Design |
| A07 Authentication failures | Strong passwords, phishing-resistant MFA | Login and session design |
| A08 Integrity failures | Signed updates, protected pipelines | Build and release |
| A09 Logging failures | Log security events, alert on patterns | Production, continuously |
| A10 Exception handling | Fail closed, generic user errors | Every error path |
How should you test an application?
No single test finds everything, so use three kinds. Static analysis (SAST) reads source code and catches injection, weak crypto, and hard-coded secrets before commit. Dynamic testing (DAST) attacks the running application and finds misconfiguration and runtime flaws. Software composition analysis (SCA) checks dependencies for known vulnerabilities.
Run SAST and SCA on every commit and build, DAST before major releases, and penetration testing at least once a year or after a major change. A penetration test finds the business-logic flaws scanners miss, such as a workflow that lets a user skip payment.
Keep a record of findings and fix times. A vulnerability that is found, logged, and left open for a year is not a testing problem; it is a process problem. Prioritize by exploitability and data sensitivity, not by scan severity alone.
What is the prevention checklist for a small team?
A small team does not need an enterprise program. It needs a short list, applied consistently, with automation doing the repetitive parts.
- Threat-model new features before building them, even in a 30-minute review.
- Enforce server-side authorization on every endpoint, with deny by default.
- Parameterize every query and encode every output for its context.
- Patch dependencies weekly and keep a lockfile and a bill of materials.
- Use HTTPS everywhere, strong password hashing, and phishing-resistant MFA for admins.
- Remove defaults and debug modes from production, and set security headers.
- Log security events and alert on failed logins and access-control failures.
- Test on every commit with SAST and SCA, and pen-test once a year.
- Back up and rehearse recovery, because prevention eventually fails somewhere.
For the wider picture, our small business cybersecurity checklist covers these controls alongside backups, updates, and device security.
What if prevention fails?
Prevention reduces risk; it does not remove it. Keep an incident response plan that names who decides, who talks to customers, and how to revoke sessions, rotate secrets, and restore from backup. Rehearse it at least once a year.
When an incident happens, preserve logs before they rotate, contain the affected system, and fix the root cause rather than only the symptom. A SQL injection fixed by blocking one payload, without parameterizing the query, will be exploited again with a different payload.
The bottom line
Application security threats are mostly known, listed, and preventable. The OWASP Top 10:2025 gives you the list; the work is applying its controls at design, in code, and in operations, every time.
Start with access control and injection, automate dependency and header checks, and test before you ship. You can check one layer right now with our free security headers checker.
Frequently asked questions
What are the biggest application security threats?
The OWASP Top 10:2025 lists broken access control, security misconfiguration, software supply chain failures, cryptographic failures, injection, insecure design, authentication failures, software and data integrity failures, logging and alerting failures, and mishandling of exceptional conditions.
How do you prevent SQL injection?
Use parameterized queries or prepared statements for every database call, so user input is sent as data and never parsed as SQL. Column names and other identifiers that cannot be parameterized must come from a fixed allowlist.
What is the OWASP Top 10?
It is OWASP's list of the ten most critical security risks to web applications, updated every few years from real-world data. The current edition is the OWASP Top 10:2025, the eighth since the list began in 2003.
What is threat modeling?
Threat modeling is a structured design review that asks what can go wrong with a feature before it is built. Teams list assets, attackers, and abuse cases, then choose controls such as rate limits, authorization checks, and encryption up front.
How often should applications be tested for security?
Run static analysis on every commit, scan dependencies on every build, run dynamic testing before major releases, and commission penetration testing at least once a year or after a major change. Log and alert continuously in between.
What is the difference between SAST, DAST and SCA?
SAST analyzes source code, DAST tests the running application from the outside, and SCA checks third-party dependencies for known vulnerabilities. Each finds flaws the others miss, so teams need all three.
Do small teams need application security?
Yes. Small applications are attacked by automated scanners that do not care about company size. Secure defaults, patched dependencies, strong authentication, and backups stop most of those attacks at low cost.
What should you do first if you can only fix one thing?
Fix broken access control. Check that every endpoint verifies the caller owns the record it requests, on the server, for every request. It is the top OWASP risk and the most common way attackers read other users' data.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against the OWASP Top 10:2025, NIST SP 800-218, and CISA Secure by Design guidance.
How we write and fact-check →