A first security and privacy audit doesn't need a penetration testing team. For a small site you own, an afternoon with curl, your browser's developer tools, and a checklist will find the most common problems: weak transport settings, careless cookies, sign-in gaps, unnecessary third-party scripts, personal data you didn't know you had, and outdated dependencies. This lesson gives you the order to work in, the commands to run, and a way to decide what to fix first.
Before you start: permission and scope
Audit only systems you own or have written permission to test. Even gentle checks, such as trying a few passwords on a login form or scanning for open ports, can be illegal against systems you don't control, and can trip intrusion alarms or lock real accounts. Everything in this lesson is passive or low-impact and meant for your own site, a local copy, or a staging environment.
You should have finished the earlier Basic lessons, especially How HTTPS, TLS, Cookies, and Browser Security Work and Passwords, Passkeys, and Multi-Factor Authentication Explained. Write down the scope before you begin: which domains, which environments, and which accounts you'll use.
Step 1: transport security
Start with how the site is reached:
# One permanent redirect from HTTP to HTTPS
curl -sI http://your-site.test/ | grep -iE '^(HTTP|location)'
# The HTTPS response: status and HSTS
curl -sI https://your-site.test/ | grep -iE '^(HTTP|strict-transport-security)'Check that:
- every HTTP URL redirects permanently (
301or308) to HTTPS in one hop; - HTTPS responses include
Strict-Transport-Securitywith a meaningfulmax-age; - the certificate is valid, covers every hostname you use, and renews automatically;
- old protocols (TLS 1.0 and 1.1) are disabled. Free online TLS testers, such as the Qualys SSL Labs server test, report this for public sites.
Step 2: security headers
Response headers tell the browser what it may do with your page. Look at the main page and one signed-in page:
curl -sI https://your-site.test/ | grep -iE '^(content-security-policy|x-content-type-options|referrer-policy|permissions-policy|x-frame-options)'A reasonable baseline:
Content-Security-Policy: limits which scripts can run. Even a basic policy withframe-ancestors 'none'or'self'andobject-src 'none'is a start; lesson 8 builds a strong one.X-Content-Type-Options: nosniff: stops browsers from guessing file types.Referrer-Policy: strict-origin-when-cross-origin(the modern browser default) or stricter, so full URLs aren't leaked to other sites.- Clickjacking protection with CSP
frame-ancestors(or the olderX-Frame-Options: DENY), unless your pages are meant to be embedded.
Missing headers are rarely critical on their own, but they're cheap to fix and limit the damage of other bugs. Lesson 12 covers the full set.
Step 3: cookies
Sign in, open developer tools, and inspect every cookie (Application panel in Chromium browsers, Storage panel in Firefox). For the session cookie, confirm Secure, HttpOnly, and SameSite=Lax or Strict. Then ask of every other cookie: who set it, what is it for, and does it need to exist? Third-party cookies from analytics or advertising scripts are both a privacy question and, in many jurisdictions, a consent question.
Step 4: sign-in and accounts
Using a test account you control:
- Password rules: does a long passphrase work? Is a common password such as
password1234567refused? - Error messages: do the login, sign-up, and "forgot password" forms give the same response whether or not an email is registered?
- Rate limiting: after a handful of failed attempts on your own test account, does the site slow down or temporarily block further attempts? Keep this to a few tries; don't run password-guessing tools.
- Password reset: does the emailed link expire, and does it stop working after one use?
- MFA: is it available, and is it required for administrators?
- Sign-out: after signing out, does pressing Back or replaying the old cookie still show signed-in pages? It shouldn't.
Step 5: access control spot check
Create two test accounts, A and B. As A, open something that belongs to A, such as an order or a profile page, and note the URL or API request. Then, signed in as B, request the same URL. If B can see A's data, you've found the most common serious web vulnerability, broken access control. Lesson 9 explains how to fix it properly.
Step 6: third-party scripts and data flows
Open the Network panel, reload the page, and filter by third-party domains. List every external script, font, pixel, and API call. For each one, note what it does, what data it receives (often the page URL, IP address, and cookies), and whether you still need it. Every third-party script runs with the same power as your own code: if its provider is compromised, so is your page.
Step 7: personal data
Using the data inventory from lesson 4, Understanding Personal Data, Privacy, and Data Minimization, check:
- every form field has a purpose, and optional fields are marked;
- the privacy notice matches what the site actually collects and shares;
- logs don't contain passwords, tokens, or full card numbers (search a sample log for
password,token, and@); - old data is deleted on a schedule, not kept forever;
- you can answer a user who asks what you hold about them, and delete it.
Step 8: dependencies and updates
Outdated components are one of the easiest problems to find and fix:
# In a Node.js project
npm audit --omit=dev
# or, with pnpm
pnpm audit --prodAlso check the platform underneath: the operating system, the web server, the database, and any CMS and its plugins. Make sure security updates are applied on a schedule, and that you'd hear about a critical one.
Step 9: exposed files and errors
Look for things that should never be public:
# These should all return 404 (or 403), never the file
for path in /.env /.git/config /backup.zip /phpinfo.php /server-status; do
printf '%s %s\n' "$(curl -s -o /dev/null -w '%{http_code}' "https://your-site.test$path")" "$path"
doneThen trigger a harmless error, such as requesting a page that doesn't exist or submitting a form with an empty required field. The response should be a plain error page, not a stack trace, framework version, or database message.
Step 10: prioritize
A list of 40 findings with equal weight helps nobody. For each finding, estimate impact (what an attacker gains, or what harm a privacy failure causes) and likelihood (how easy and how likely it is to be found and used):
- Critical: one user can read or change another's data, admin accounts without MFA, secrets or backups publicly downloadable, sign-in without rate limiting.
- High: missing HTTPS redirect or HSTS, session cookies without
HttpOnlyorSecure, known-vulnerable dependencies with public exploits, stack traces in production. - Medium: missing security headers, account enumeration through error messages, personal data kept without a retention period.
- Low: unnecessary third-party scripts with little data access, cosmetic header issues.
Fix critical findings first, then batch the rest by component. Re-run the same checks after fixing; an audit you can repeat is worth more than one perfect report.
The beginner audit checklist
- HTTP redirects to HTTPS in one permanent hop, and HSTS is set.
- The certificate is valid, covers all hostnames, and renews automatically.
- Basic security headers are present: CSP,
nosniff,Referrer-Policy, and framing protection. - Session cookies are
Secure,HttpOnly, andSameSite. - Sign-in accepts long passphrases, refuses common passwords, limits attempts, and gives uniform errors.
- Administrators use MFA.
- User B can't see user A's data.
- Every third-party script is known and needed.
- Every personal data field has a purpose and a retention period.
- Dependencies have no known high-severity vulnerabilities, and updates are scheduled.
- No secrets, backups, or stack traces are publicly reachable.
Common mistakes and troubleshooting
- Testing without permission. Even harmless-looking checks can break laws and contracts. Get it in writing, or test your own copy.
- Starting with a scanner. Automated scanners find surface issues and miss logic flaws like broken access control. Do the manual checks too.
- Testing only signed-out pages. Most serious bugs are behind the login.
- Fixing one page at a time. If a header is missing everywhere, fix it once in the server or framework configuration.
- Treating the audit as done. New code and new dependencies arrive every week. Schedule the next one.
If a check gives a confusing result, such as headers that appear in the browser but not in curl, check whether a CDN or proxy adds or strips them, and test the same URL, method, and signed-in state.
Practical exercise: audit your own site
Run steps 1 to 9 on a site you own or a local copy of one. Record each finding in a table with columns for the step, what you found, the evidence (command output or screenshot), impact, likelihood, priority, and the fix. Then write three sentences: the most serious finding, the quickest win, and what you'll check again next month.
Key takeaways
- Audit only what you own or are authorized to test, and write down the scope.
- Work in order: transport, headers, cookies, sign-in, access control, third parties, personal data, dependencies, exposed files.
- Manual checks with two accounts catch the bugs scanners miss.
- Prioritize by impact and likelihood, fix shared configuration once, and repeat the audit.
References
- OWASP Web Security Testing Guide (opens in a new tab)
- OWASP Secure Headers Project (opens in a new tab)
- MDN: HTTP Observatory (opens in a new tab)
- Qualys SSL Labs: SSL Server Test (opens in a new tab)
- npm Docs: npm audit (opens in a new tab)
- OWASP Top 10:2025 (opens in a new tab)
What's next
You've finished the Basic level. The Intermediate level begins with OWASP Top 10 Explained: The Security Risks Every Developer Should Know, a guided tour of the risk categories behind most of the findings you just looked for.

