Security Testing
OWASP ZAP, manual testing methodology, code review for security, and building a security mindset
Skills taught: websecurity.security-testing, websecurity.owasp-zap, websecurity.manual-testing, websecurity.secure-code-review, websecurity.threat-modelling
Security testing approaches
STATIC APPLICATION SECURITY TESTING (SAST):
Analyzes source code without running the application
Tools: ESLint security plugins, Semgrep, SonarQube, Snyk Code
Good at: detecting patterns (hardcoded secrets, SQL concat, eval usage)
Misses: runtime logic flaws, business logic vulnerabilities, auth issues
When: integrated into CI/CD — runs on every pull request
DYNAMIC APPLICATION SECURITY TESTING (DAST):
Tests the running application from the outside, like an attacker would
Tools: OWASP ZAP, Burp Suite Community/Pro
Good at: XSS, SQLi, misconfiguration, exposed headers
Misses: code-level issues, business logic, things behind auth (mostly)
When: against staging environment after deployment
INTERACTIVE APPLICATION SECURITY TESTING (IAST):
Instruments the running app to trace vulnerabilities during normal use
Tools: Contrast Security, Seeker
Good at: very accurate results — traces the actual data flow
Cost: requires agents in the app, expensive commercial tools
MANUAL PENETRATION TESTING:
Human testers actively try to break the app
Most thorough — can find business logic and chained vulnerabilities
When: before major releases, after significant architecture changes
Cost: expensive (thousands to tens of thousands of dollars)
For small teams: developers doing security code reviews + automated tooling
Manual testing methodology
AUTHENTICATION:
[ ] Try login with an unregistered email — does it reveal 'user not found'?
[ ] Try brute force: 20+ wrong passwords — does rate limiting kick in?
[ ] Does 'Forgot Password' confirm/deny email existence?
[ ] Can session tokens be decoded? (They shouldn't contain sensitive data)
[ ] Does logout actually invalidate the session server-side?
AUTHORIZATION (IDOR):
[ ] Create two accounts. Log in as User A. Access User B's resources:
GET /api/users/{user_b_id}
GET /api/invoices/{user_b_invoice_id}
GET /api/documents/{user_b_doc_id}
[ ] Can User A edit/delete User B's data?
[ ] Can a regular user access /api/admin/* endpoints?
INJECTION:
[ ] Enter ' (single quote) in every form field — does the app crash or error?
[ ] Try <script>alert(1)</script> in text inputs — is it reflected?
[ ] Try ../../../etc/passwd in file name fields
BUSINESS LOGIC:
[ ] Apply a discount code twice
[ ] Change a price parameter: POST /checkout with { price: 0.01 }
[ ] Access step 3 of a multi-step flow without completing step 2
[ ] Set a quantity to -1 (negative numbers)
HEADERS AND CONFIGURATION:
[ ] Check response headers: is X-Frame-Options set? Content-Security-Policy?
(Browser DevTools → Network tab → click any request → Response Headers)
[ ] Is X-Powered-By revealing the framework?
[ ] Is the app accessible over HTTP (no redirect to HTTPS)?
[ ] What does an error page return? (Try /api/nonexistent-endpoint)
ESLint security plugin in CI
// npm install --save-dev eslint-plugin-security eslint-plugin-no-unsanitized
// .eslintrc.js — add security rules
module.exports = {
plugins: ['security', 'no-unsanitized'],
extends: [
'plugin:security/recommended',
],
rules: {
// Flag uses of eval() — almost never needed, often exploitable
'no-eval': 'error',
// Flag innerHTML assignments — potential XSS
'no-unsanitized/method': 'error',
'no-unsanitized/property': 'error',
// Flag hardcoded secrets — catches 'password: "abc123"' patterns
'security/detect-possible-timing-attacks': 'error',
// Flag regex that could cause ReDoS (Catastrophic Backtracking)
'security/detect-unsafe-regex': 'warn',
// Flag child_process.exec with non-literal strings
'security/detect-child-process': 'error',
// Flag non-literal require() calls
'security/detect-non-literal-require': 'warn',
},
};
// Add to package.json scripts:
// "lint:security": "eslint . --ext .ts,.js --rule 'security/detect-object-injection: error'"
// In GitHub Actions:
// - name: Security lint
// run: npm run lint:security
// Semgrep (more powerful, free tier):
// npx semgrep --config=p/nodejs-security .
// Catches: SQL injection, path traversal, SSRF, ReDoS and more
// Integrates with GitHub as a PR check
Frequently Asked Questions
How do I get better at finding security vulnerabilities?
Practice on intentionally vulnerable apps: OWASP WebGoat (Java), OWASP Juice Shop (Node.js — the most modern), DVWA (PHP), and HackTheBox / TryHackMe for broader penetration testing skills. Reading bug bounty writeups on HackerOne Hacktivity and Bugcrowd shows real-world vulnerability patterns. The Portswigger Web Security Academy (free) is the best structured curriculum with hands-on labs. Security comes from developing a threat modeling mindset: for every feature you build, ask 'what could an attacker do with this input?'