← All posts
security auditwebsite securityDIY auditvibe codingvulnerability scanningOWASP ZAPindie developer

DIY Website Security Audit: A Step-by-Step Guide

O

OverMCP Team

TL;DR: How to Do a Security Audit of Your Own Website

A DIY website security audit is a systematic review of your site's code, configuration, and dependencies to identify vulnerabilities. You can do it yourself using free tools like OWASP ZAP, manual code inspection, and dependency checkers. This guide walks you through the exact steps to find and fix the most common security flaws in modern web apps, especially those built with AI coding tools.

What is a DIY Website Security Audit?

A DIY website security audit is the process of checking your own website for security issues without hiring a professional penetration tester. For indie developers and solopreneurs who ship fast with AI coding tools like Cursor, Bolt.new, or Lovable, a DIY audit is essential because these tools often produce code with hidden vulnerabilities like exposed API keys, unsafe SQL queries, or missing authentication checks.

By performing a DIY website security audit, you can catch these problems before they become data breaches. The audit typically involves:

  • Scanning for known vulnerabilities in dependencies
  • Checking for exposed secrets in client-side code
  • Testing for common web vulnerabilities (XSS, SQLi, CSRF)
  • Reviewing authentication and authorization logic
  • Ensuring HTTPS and secure headers are properly configured
  • Step 1: Run an Automated Vulnerability Scanner

    The quickest way to start your DIY website security audit is to run an automated scanner. These tools crawl your site and test for common vulnerabilities.

    Using OWASP ZAP (Free)

  • Download and install OWASP ZAP
  • Open ZAP and click "Automated Scan"
  • Enter your website URL and click "Attack"
  • Wait for the scan to complete (may take several minutes)
  • ZAP will generate a report with alerts categorized by risk level (High, Medium, Low). Focus on High and Medium alerts first.

    Using OverMCP for AI-Code Specific Checks

    If your app was built with AI tools, consider using a specialized scanner like OverMCP (overmcp.com) that detects vulnerabilities common in vibe-coded apps, such as hardcoded secrets, insecure database queries, and missing rate limiting.

    Step 2: Check for Exposed Secrets in Client-Side Code

    One of the most common issues in AI-built apps is accidentally exposing API keys, database URLs, or authentication tokens in the frontend JavaScript.

    Manual Check

  • Open your browser's developer tools (F12)
  • Go to the "Sources" or "Debugger" tab
  • Search for common patterns: api_key, secret, password, token, stripe, sk_live, etc.
  • Review all JavaScript files loaded by your site
  • Using a Tool

    You can use a tool like Secret Scanner or a simple grep command:

    grep -r "sk_live_" .
    grep -r "api_key" .
    grep -r "password" .

    Fix

    Move all secrets to environment variables on your server or use a secrets manager. Never hardcode secrets in client-side code.

    Step 3: Test for Cross-Site Scripting (XSS)

    XSS vulnerabilities allow attackers to inject malicious scripts into your web pages. To test:

  • Find input fields (search boxes, comment forms, contact forms)
  • Enter a simple test payload: <script>alert('XSS')</script>
  • Submit the form and see if an alert box appears
  • If it does, your site is vulnerable to XSS
  • Fix

    Sanitize all user inputs using libraries like DOMPurify (for HTML) or use framework-specific escaping (e.g., React's {} automatically escapes).

    Step 4: Check for SQL Injection

    SQL injection can allow attackers to read or modify your database. Test by:

  • Find a URL parameter or form input that queries a database (e.g., ?id=1)
  • Add a single quote: ?id=1'
  • If you get a database error message, you may be vulnerable
  • Advanced test: ?id=1' OR '1'='1 — if the page loads differently, likely vulnerable
  • Fix

    Use parameterized queries (prepared statements) exclusively. Never concatenate user input directly into SQL strings.

    Example (Node.js with PostgreSQL):

    // Vulnerable
    const query = `SELECT * FROM users WHERE id = '${req.params.id}'`;
    
    // Safe
    const query = 'SELECT * FROM users WHERE id = $1';
    const result = await db.query(query, [req.params.id]);

    Step 5: Review Authentication and Authorization

    Weak Password Policies

    Check if your site enforces strong passwords. A common issue in AI-coded apps is allowing passwords like "password123" without any complexity requirements.

    Session Management

  • Are session tokens randomly generated and stored securely (HTTP-only, Secure, SameSite cookies)?
  • Do sessions expire after a reasonable time?
  • Is there rate limiting on login attempts to prevent brute force?
  • Missing Authorization Checks

    Test if users can access resources they shouldn't by:

  • Log in as User A
  • Copy the URL of a restricted page (e.g., /admin/users/5)
  • Log out and try to access that URL directly
  • If you can access it without authentication, there's a flaw
  • Step 6: Check HTTPS and Security Headers

    HTTPS

    Your site must use HTTPS. Use SSL Labs to check your certificate configuration.

    Security Headers

    Check your HTTP response headers using tools like securityheaders.com. Key headers:

  • Content-Security-Policy: Controls which resources can be loaded
  • X-Content-Type-Options: Prevents MIME type sniffing
  • X-Frame-Options: Prevents clickjacking
  • Strict-Transport-Security: Enforces HTTPS
  • Step 7: Review Third-Party Dependencies

    AI coding tools often pull in many npm packages without careful review. Use npm audit or yarn audit to check for known vulnerabilities:

    npm audit

    Update vulnerable packages:

    npm update

    Step 8: Check for CSRF Vulnerabilities

    Cross-Site Request Forgery (CSRF) attacks trick users into performing actions they didn't intend. Test by:

  • Find a state-changing action (e.g., delete account, change email)
  • Check if the request includes a CSRF token
  • If not, your site is vulnerable
  • Fix

    Use anti-CSRF tokens for all state-changing requests. Most frameworks have built-in support (e.g., Rails, Django, Laravel).

    Step 9: Review Logging and Error Handling

    Ensure your app doesn't leak sensitive information in error messages. Test by:

  • Trigger a 500 error (e.g., by sending invalid data)
  • Check if the response includes stack traces or database credentials
  • If so, configure a generic error page and log errors server-side
  • Step 10: Automate Regular Audits

    A DIY website security audit isn't a one-time task. Set up automated scans:

  • Use GitHub Actions to run npm audit on every push
  • Schedule weekly scans with OWASP ZAP's headless mode
  • Use OverMCP for continuous monitoring of AI-coded apps
  • FAQ

    How often should I perform a DIY website security audit?

    At minimum, run an audit after every major deployment or whenever you add new features. For ongoing safety, automate dependency scanning and use a continuous monitoring tool.

    What is the most common vulnerability found in DIY audits?

    The most common is exposed secrets (API keys, passwords) in client-side code, especially in apps built with AI coding tools. Next is missing security headers and outdated dependencies.

    Can I trust automated scanners alone for a security audit?

    No, automated scanners miss logic flaws and business logic vulnerabilities. Always combine automated scanning with manual testing of authentication, authorization, and input validation.

    Is your app secure?

    Free scan in 30 seconds. No signup needed.

    Scan My App Free