Security Fundamentals & OWASP

OWASP Top 10 2025: A01-A05

5 min read

The OWASP Top 10 2025 reflects the current threat landscape with significant changes including a new focus on supply chain security. Let's examine the top 5 vulnerabilities you'll be tested on.

A01:2025 - Broken Access Control

Rank: #1 (most critical)

The most prevalent vulnerability in web applications. Occurs when users can act outside their intended permissions.

Common Patterns

PatternDescriptionExample
IDORInsecure Direct Object Reference/api/user/123 accessible without authorization
Privilege EscalationUser gains admin functionsChanging role in hidden form field
Path TraversalAccessing restricted files../../etc/passwd
Missing Function Level Access ControlAdmin endpoints exposed/admin/deleteUser no auth check

Interview Code Review

# Vulnerable code - Find the issues
@app.route('/api/documents/<doc_id>')
def get_document(doc_id):
    document = Document.query.get(doc_id)  # Issue 1: No AuthZ check
    return jsonify(document.to_dict())

# Secure version
@app.route('/api/documents/<doc_id>')
@login_required
def get_document(doc_id):
    document = Document.query.get_or_404(doc_id)
    if document.owner_id != current_user.id:  # AuthZ check
        abort(403)
    return jsonify(document.to_dict())

A02:2025 - Security Misconfiguration

Rank: #2 (moved up from #5 in 2021)

Misconfigurations are now more prevalent than ever due to cloud complexity.

Common Misconfigurations

  • Default credentials left unchanged
  • Unnecessary features enabled
  • Error messages revealing stack traces
  • Missing security headers
  • S3 buckets set to public
  • Overly permissive CORS policies

Interview Scenario

Question: "Review this response. What security headers are missing?"

HTTP/1.1 200 OK
Content-Type: text/html
Server: Apache/2.4.41

<html>...

Answer: Missing critical headers:

  • Strict-Transport-Security (HSTS)
  • X-Content-Type-Options: nosniff
  • X-Frame-Options: DENY
  • Content-Security-Policy
  • Referrer-Policy (recommended; X-XSS-Protection is deprecated and disabled in modern browsers)

A03:2025 - Software Supply Chain Failures

Rank: #3 (NEW - expanded from Vulnerable Components)

A major 2025 addition reflecting attacks like SolarWinds and Log4Shell.

Attack Vectors

VectorDescriptionExample
Dependency ConfusionInternal package names hijackedMalicious npm package with internal name
TyposquattingSimilar package nameslodash vs 1odash
Compromised MaintainersLegitimate package updated maliciouslyEvent-stream incident
Build Pipeline AttacksCI/CD system compromisedCodecov breach

Defenses

# Example: Lock dependencies and verify integrity
# package-lock.json (npm) or requirements.txt with hashes
dependencies:
  lodash:
    version: "4.17.21"
    integrity: "sha512-v2kDE..."  # Verify hash

Tools: Snyk, Dependabot, OWASP Dependency-Check, npm audit

A04:2025 - Cryptographic Failures

Rank: #4 (was #2 in 2021)

Failures in cryptography that lead to sensitive data exposure.

Common Failures

FailureImpactFix
Weak algorithmsMD5, SHA1 for passwordsUse bcrypt, Argon2
Hardcoded secretsKeys in source codeUse secrets manager
Missing encryptionData transmitted in cleartextTLS 1.3 everywhere
Improper key managementKeys stored with dataHSM, separate key storage

Interview Question

Q: "How would you securely store user passwords?"

Strong Answer:

import bcrypt

def hash_password(password: str) -> bytes:
    # Generate salt and hash in one step
    # bcrypt automatically handles salt storage
    salt = bcrypt.gensalt(rounds=12)  # Cost factor 12
    return bcrypt.hashpw(password.encode(), salt)

def verify_password(password: str, hashed: bytes) -> bool:
    return bcrypt.checkpw(password.encode(), hashed)

Key Points:

  • Never use MD5/SHA1 for passwords
  • Use adaptive algorithms (bcrypt, Argon2, scrypt)
  • Cost factor should take ~100ms to compute

A05:2025 - Injection

Rank: #5 (was #3 in 2021)

Untrusted data sent to an interpreter as part of a command or query.

Injection Types

TypeTargetExample
SQL InjectionDatabase' OR '1'='1
Command InjectionOS shell; rm -rf /
LDAP InjectionDirectory services`)(uid=))(
XSSBrowser<script>alert(1)</script>

Defense: Parameterized Queries

# VULNERABLE - String concatenation
query = f"SELECT * FROM users WHERE id = {user_id}"

# SECURE - Parameterized query
cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))

Interview Reality: You WILL be asked to identify injection vulnerabilities in code. Practice recognizing patterns where user input flows into dangerous sinks.

Next, we'll cover A06-A10 and the OWASP LLM Top 10 for AI security roles. :::

Quick check: how does this lesson land for you?

Quiz

Module 2: Security Fundamentals & OWASP

Take Quiz
FREE WEEKLY NEWSLETTER

Stay on the Nerd Track

One email per week — courses, deep dives, tools, and AI experiments.

No spam. Unsubscribe anytime.