Notes
OWASP Top 10
OWASP, the Open Worldwide Application Security Project, publishes the Top 10 web risks. In tester's words: broken access control, seeing or changing data that is not yours, is number one. Cryptographic failures, like passwords stored plainly. Injection, such as SQL or script injection. Security misconfiguration. Vulnerable third party components. Authentication failures. And missing logging, so attacks go unnoticed.
- A01 broken access control: seeing others' data
- A02 crypto failures: plain passwords, no HTTPS
- A03 injection: SQL, script
- A05 misconfiguration: headers, debug pages, defaults
- A06 vulnerable components
- A07 auth failures: guessing
- A09 no logging of attacks
Access control
The most valuable security test is simple: log in as one user and ask for another user's data. Order two belongs to Alice. With no token, ShopRung answers four oh one. As Bob, it answers 404, which also hides that the order exists. Then we turned on ShopRung's order leak bug, and Bob received Alice's whole order. This is called IDOR, or broken object level authorization. Test it on every endpoint with an id.
as Alice 200 her order
no token 401
as Bob 404 "No order
with id 2"
order-leak bug ON:
as Bob 200 Alice's
order, items and total Authentication
Next, authentication. We sent ten wrong passwords for Alice: ten four oh ones, and then the correct password still worked. There is no lockout or rate limit, so an attacker could guess forever; that is a real finding. On the good side, an unknown email and a wrong password give the same status and the same message, so attackers cannot discover which emails have accounts. Also test token expiry, logout, and password reset links.
10 wrong passwords for Alice: 401 x 10 then the right password: 200 → no lockout, no rate limit: passwords can be guessed unknown email vs wrong password: same 401, same message → good: no user enumeration
Injection
Injection testing means sending what an attacker would send. A classic SQL probe in ShopRung's search returned zero products, not every product, because ShopRung uses parameterised queries. A name containing an HTML image tag with an error handler must appear as text, never run. Also try odd ids, huge bodies, wrong types, and extra fields like role admin, to catch mass assignment. Only ever do this on systems you are allowed to test.
search: ' OR 1=1--
→ 200, 0 products (safe:
parameterised queries)
name: <img src=x onerror=..>
→ must show as text, never run
ids: -1, 0, 99999999, abc
huge bodies, wrong types,
extra fields ("role":"admin")
only on systems you may test Headers
Response headers tell the browser how to protect users. ShopRung's home page sends a content type and cache control, but no content security policy, no X content type options, and no frame protection against clickjacking. On HTTPS sites, also check strict transport security. These are exactly what automated scanners flag first. They are low effort to fix and cheap to check in every pipeline.
HTTP/1.1 200 OK
Content-Type: text/html; ...
Cache-Control: no-store
missing, and scanners flag:
Content-Security-Policy
X-Content-Type-Options
frame-ancestors / X-Frame-
Options (clickjacking)
Strict-Transport-Security
(on HTTPS) Scanners
Automated tools come in kinds. Static analysis, or SAST, reads source code for risky patterns, using tools like Semgrep or CodeQL. Software composition analysis checks dependencies for known vulnerabilities: npm audit, Dependabot, OWASP dependency check. Secret scanning finds keys committed to Git. Dynamic analysis, or DAST, attacks the running application, with OWASP ZAP or Burp Suite. Every finding needs triage: real, false positive, or accepted risk.
- SAST: reads source code (Semgrep, CodeQL, SonarQube)
- SCA: known-vulnerable dependencies (npm audit, Dependabot, OWASP Dep-Check)
- secret scanning: keys in Git
- DAST: attacks the running app (OWASP ZAP, Burp Suite)
- each finding needs triage
OWASP ZAP
OWASP ZAP is a free scanner. Its baseline scan crawls the site and runs passive checks only, looking at responses for issues like missing headers and cookie flags, without attacking, so it is safe for shared environments. It runs in CI from the ZAP Docker image and writes an HTML report. A full scan sends active attacks, so run it only against your own test environment. A lab later in this track runs ZAP against ShopRung.
docker run --rm -v $(pwd):/zap/wrk \ ghcr.io/zaproxy/zaproxy:stable \ zap-baseline.py \ -t https://staging.example.com \ -r zap-report.html baseline = spider + PASSIVE checks only: safe for shared environments full scan = ACTIVE attacks: only on your own test env
Stay safe and legal
Rules. Get written permission and a clear scope before any security testing; testing systems you are not allowed to test can be illegal. Stay away from production unless agreed. Never use real customer data. Report security bugs privately, not in public tickets. Rate severity by impact and how easy the attack is. Then retest the fix and add an automated test, like Bob asking for Alice's order, so it never comes back.
- written permission and scope
- never production unless agreed
- never real customer data
- report privately to the team, not in public tickets
- severity: impact x ease
- retest the fix, add a test so it never comes back
Common mistakes
Mistakes. Testing with only one user, so access control bugs never appear. Trusting the interface: a hidden button does not protect the API behind it. Pasting raw scanner output as bugs without triage. Running active scans on shared or production systems. And treating security as a yearly event instead of checks in every pipeline.
- only testing with one user
- trusting the UI: hidden buttons ≠ protected APIs
- scanner output pasted as bugs without triage
- active scans on shared or production systems
- security only once a year
Say it like this
In the interview: access control first, with two users on every endpoint that takes an id, expecting four oh three or 404. Authentication: lockout or rate limits, token expiry, no user enumeration. Injection probes and security headers. In CI, static analysis, dependency and secret scans, and a ZAP baseline scan on staging. All within an agreed scope, with findings triaged and every fix covered by a regression test.
- "Access control first: two users, every id-based endpoint, expect
- 403/404. Auth: lockout, token
- expiry, no enumeration.
- Injection probes, headers.
- In CI: SAST, dependency and secret scans, ZAP baseline on staging. All within an agreed
- scope, findings triaged, fixes
- covered by regression tests."