Cybersecurity

The 10 Most Common Security Mistakes in Software Projects

November 18, 2026 · 9 min read

The 10 Most Common Security Mistakes in Software Projects

Most security breaches do not start with a genius hacker breaking unbreakable code. They start with ordinary mistakes: a password committed to a repository, an API that forgets to check who is asking, an outdated library or a debug setting left switched on in production. These common security mistakes appear again and again in software projects of every size, and almost all of them are preventable.

This guide explains the 10 most common security mistakes in software projects, why they happen, real data on how often they occur and exactly how to avoid each one. It is written for developers, project managers and business owners who commission software and want to ask the right questions.

Why Security Mistakes Are So Common

Deadlines, small teams and pressure to ship features push security down the priority list. Many developers never receive formal security training, and modern applications depend on hundreds of third-party packages that few people review. AI coding assistants now produce code faster than teams can review it. Meanwhile, attackers move quickly: exploitation of vulnerabilities became the top way into organisations in Verizon's 2026 Data Breach Investigations Report, at 31% of breaches, as TechRepublic reported.

The 10 Most Common Security Mistakes at a Glance

#MistakeQuick Fix
1Hardcoding secrets in codeUse a secrets manager and secret scanning
2Broken access controlCheck permissions on the server for every request
3Trusting user inputValidate input and use parameterised queries
4Outdated and vulnerable dependenciesAutomate dependency updates and scanning
5Weak authenticationAdd MFA and store passwords with strong hashing
6Security misconfigurationHarden defaults and review configuration
7Missing logging and monitoringLog security events and alert on anomalies
8Poor error handlingFail safely and hide internal details
9Treating security as a final stepBuild security into every phase
10Collecting and keeping too much dataMinimise, encrypt and delete data

Mistake 1: Hardcoding Secrets in Code

API keys, database passwords and tokens end up in source code, configuration files, container images and chat messages far more often than most teams realise. GitGuardian's State of Secrets Sprawl 2026 report found 28.65 million new hardcoded secrets in public GitHub commits in 2025, a 34% increase on the previous year, according to the GitGuardian report. Many leaked secrets stay valid for years because nobody rotates them.

How to avoid it: store secrets in a secrets manager or your platform's secret store, load them as environment variables at runtime, enable secret scanning on every repository and pipeline, and rotate any secret that has ever been exposed.

Mistake 2: Broken Access Control

Broken access control means users can view or change data they should not, for example by changing an order number in a URL to see someone else's invoice. It is ranked first in the OWASP Top 10:2025. It often happens when checks exist only in the user interface, or when developers check that a user is logged in but not that they own the record.

How to avoid it: enforce authorisation on the server for every request, deny by default, check object ownership, and write automated tests that try to access other users' data. Our guide to API security best practices shows an ownership check in code.

Mistake 3: Trusting User Input

Any data from users, browsers, mobile apps or other systems can be malicious. Injecting it directly into database queries, HTML, shell commands or file paths leads to SQL injection, cross-site scripting and other injection attacks. Here is the difference between an unsafe and a safe database query:

// users.mjs: an unsafe and a safe way to look up a user (Node.js with mysql2)
import mysql from "mysql2/promise";

const db = await mysql.createConnection(process.env.DATABASE_URL);

// UNSAFE: user input is pasted into the SQL string, allowing SQL injection
export async function findUserUnsafe(email) {
  const [rows] = await db.query(`SELECT * FROM users WHERE email = '${email}'`);
  return rows;
}

// SAFE: a parameterised query keeps the data separate from the SQL
export async function findUserSafe(email) {
  const [rows] = await db.execute(
    "SELECT id, name, email FROM users WHERE email = ?",
    [email]
  );
  return rows;
}

How to avoid it: validate input on the server against strict rules, use parameterised queries or an ORM, encode output for the context where it is displayed, and never pass user input directly to system commands.

Mistake 4: Outdated and Vulnerable Dependencies

Modern apps rely on hundreds of open-source packages. A single vulnerable or compromised package can expose the whole application, which is why OWASP added Software Supply Chain Failures at number three in its 2025 list. Teams often install packages once and never update them.

How to avoid it: keep a list of dependencies, scan them automatically in your CI/CD pipeline, apply security updates quickly, remove unused packages, use lock files and prefer well-maintained libraries.

Mistake 5: Weak Authentication

Allowing weak passwords, storing them with fast or outdated hashing, skipping rate limits on login forms and not offering multi-factor authentication all make account takeover easy.

How to avoid it: hash passwords with a modern algorithm such as Argon2 or bcrypt, rate-limit and monitor login attempts, offer and encourage MFA or passkeys, and use well-tested authentication libraries or providers rather than writing your own. Our guide to two-factor authentication explains how to implement it.

Mistake 6: Security Misconfiguration

Security misconfiguration rose to second place in the OWASP Top 10:2025. Examples include default admin passwords, public cloud storage buckets, debug mode in production, open database ports, overly permissive cloud permissions and missing security headers.

How to avoid it: use secure baseline configurations, manage infrastructure as code so settings are reviewed, scan cloud accounts for misconfigurations, and remove unused features, ports and accounts. Our guide on how to protect your website from hackers covers server hardening.

Mistake 7: Missing Logging and Monitoring

Many breaches go unnoticed for months because nobody is watching. Without logs of logins, permission changes, failed access attempts and admin actions, you cannot detect an attack or investigate it afterwards.

How to avoid it: log security-relevant events without logging passwords or sensitive personal data, centralise logs, set alerts for suspicious patterns and make sure someone is responsible for responding.

Mistake 8: Poor Error Handling

Detailed error messages and stack traces can reveal database structures, file paths and library versions to attackers. Worse, some systems "fail open", granting access when an authorisation service times out. OWASP added Mishandling of Exceptional Conditions as a new category in 2025 to highlight this risk.

How to avoid it: show users generic error messages, log details privately, fail closed when security checks cannot complete, and test how your application behaves when dependencies are slow or unavailable.

Mistake 9: Treating Security as a Final Step

When security is a checkbox before launch, problems are found late, when they are expensive to fix, or not at all. Insecure design decisions, such as missing tenant isolation in a SaaS product, are hard to change after release.

How to avoid it: include security requirements from the start, run simple threat modelling during design, review code with security in mind, automate testing in the pipeline and run regular audits. Our guide on how to run an application security audit explains the process, and our software development life cycle guide shows where security fits in each phase.

Mistake 10: Collecting and Keeping Too Much Data

Every piece of personal data you store is a liability if it leaks. Teams often collect more than they need, keep it forever and copy it into test environments, analytics tools and logs.

How to avoid it: collect only what you need, encrypt sensitive data, mask or anonymise data in test environments, set retention periods and delete data you no longer need. This also helps you comply with the data privacy laws developers must know.

Bonus Mistake: Trusting AI-Generated Code Blindly

AI coding assistants are powerful, but they can suggest insecure patterns, outdated libraries or code that skips authorisation checks. GitGuardian's 2026 report also found that AI-assisted commits leaked secrets at roughly twice the baseline rate. Treat AI-generated code like code from a new junior developer: review it, test it and run it through the same security checks as everything else.

How to Build Security into Your Project

  1. Plan: define security requirements and data protection needs alongside features.
  2. Design: identify threats, sensitive data and trust boundaries.
  3. Build: follow secure coding standards and use proven libraries.
  4. Test: automate dependency, secret and code scanning in the pipeline.
  5. Release: harden configuration and verify before go-live.
  6. Operate: monitor, patch quickly and review regularly.

The OWASP Application Security Verification Standard is a useful checklist of requirements for each stage. For mobile projects, see our guide to mobile app security best practices. Security gaps are also a frequent theme in our analysis of why IT projects fail.

Frequently Asked Questions

What is the most common security mistake in software development?

Broken access control is the top risk in the OWASP Top 10:2025, closely followed by misconfiguration and supply chain issues. Hardcoded secrets are also extremely common, with tens of millions found in public code every year.

How can developers avoid security mistakes?

Learn the OWASP Top 10, use secure frameworks and libraries, automate security scanning in the CI/CD pipeline, review code with security in mind and keep dependencies updated.

Are small projects at risk from these mistakes?

Yes. Automated attacks scan every exposed application. Small projects often have fewer reviews and less monitoring, which makes simple mistakes more likely to be exploited.

Is AI-generated code secure?

Not automatically. AI assistants can produce insecure code or leak secrets. Review AI-generated code carefully and run it through the same automated security checks as any other code.

How often should we check for security issues?

Continuously, with automated scans on every code change, plus regular manual reviews and a full security audit at least once a year or before major releases.

What should I ask a development company about security?

Ask how they handle secrets, access control, dependency updates, code review, security testing, logging, backups and incident response, and whether they follow standards such as the OWASP Top 10 or ASVS.

Conclusion

The most common security mistakes in software projects are well known and largely preventable: hardcoded secrets, broken access control, unvalidated input, outdated dependencies, weak authentication, misconfiguration, missing monitoring, poor error handling, late security and excessive data collection. Building simple safeguards into everyday development removes most of the risk without slowing your team down.

Want to know whether your software has these weaknesses? Our team reviews code, infrastructure and processes and helps you fix issues before attackers find them. Request a security review.

Want this built for you?

Our team offers Website Deploy On Vercel — get a free quote.

View Services