OWASP WSTG v4.2 Explained

OWASP WSTG: Part 1 - Introduction & Testing Methodology

What the OWASP Web Security Testing Guide v4.2 is, how its 12 test categories and ~100 tests are organised, the testing principles and techniques behind it, how to set up a lab and how to report findings.

11 min read
views
visits
OWASP WSTG Part 1 - Introduction & Testing Methodology
OWASP WSTG Part 1 - Introduction & Testing Methodology

The OWASP Web Security Testing Guide (WSTG) is the most complete free reference for testing the security of web applications. Version 4.2 (December 2020) describes 12 categories and roughly 100 individual tests, from reading robots.txt during reconnaissance to attacking GraphQL introspection.

This series walks through the whole guide, one category per part. For every test you will get: what it checks, why it matters, how to run it with real commands and tools, what a finding looks like, and how to fix it. This first part covers the foundations: what the guide is, the testing principles and techniques it is built on, how the tests are identified, how to set up a practice lab and how to report what you find.

Source and licence: this series explains the OWASP Web Security Testing Guide v4.2 in my own words. The guide is © the OWASP Foundation and its contributors, published under CC BY-SA 4.0. Every test in later parts links back to its original page.


Key Takeaways

  • WSTG is a testing guide, not a standard. It tells you how to test. OWASP ASVS tells you what to require, and the OWASP Top 10 tells you which risks are most common.
  • Every test has a stable ID such as WSTG-INFO-02. Reference tests with the version, WSTG-v42-INFO-02, because numbers can change between releases.
  • Testing belongs in the whole SDLC, not only in a penetration test right before launch. The guide’s framework spans five phases, from policy review to operations.
  • No tool finds everything. Scanners are a starting point; business logic, authorization and multi-step flows need a human.
  • Only test what you are authorised to test. Get written scope and permission first, and practise on deliberately vulnerable labs.

What WSTG Is (and Isn’t)

OWASP publishes several projects that are easy to confuse. They complement each other:

Project Question it answers Typical use
OWASP Top 10 Which web risks are most common and severe? Awareness, prioritisation
OWASP ASVS What security requirements should an app meet? Requirements, acceptance criteria
OWASP WSTG How do I test whether an app is vulnerable? Penetration tests, QA, code review support
OWASP MASTG The same, for mobile apps Android / iOS testing
OWASP Cheat Sheets How do I build this securely? Developer guidance and fixes

A practical way to combine them: use ASVS to define the requirements, WSTG to test them, the Cheat Sheets to fix what fails, and the Top 10 to explain the results to management.


Principles of Testing

The guide opens with principles that matter more than any single test:

  • There is no silver bullet. A scanner or a WAF cannot make an application secure. Security comes from the whole process.
  • Think strategically, not tactically. Patch-and-penetrate (find a bug, patch it, repeat) never ends. Fix root causes in design and development.
  • The SDLC is king. Put security activities into every phase of the software development life cycle.
  • Test early and test often. A flaw found in design costs a fraction of the same flaw found in production.
  • Automate what you can, such as dependency checks and scanners in CI, and keep human testing for what tools cannot judge.
  • Understand the scope and the subject. Read the architecture, the documentation and the data flows before testing.
  • Develop the right mindset. Think like an attacker: ask “what happens if I send something unexpected?”
  • Use source code when available. Gray- and white-box testing finds more in less time than pure black-box testing.
  • Document the results. A finding nobody can reproduce or understand will not get fixed.

Testing Techniques Explained

WSTG describes four techniques. Each has strengths and blind spots, so a good programme combines them:

Technique What it is Strengths Weaknesses
Manual inspections & reviews Reviewing policies, processes, documentation and design decisions with people Cheap, early, finds process and design gaps Depends on what people tell you
Threat modelling Mapping assets, entry points, threats and controls (e.g. STRIDE) Finds design flaws before code exists Takes practice, models go out of date
Source code review Reading the code (manually and with SAST tools) Finds what is invisible from outside: backdoors, logic, crypto misuse Needs access and skill, misses deployment issues
Penetration testing Testing the running application as an attacker would Proves real exploitability, tests the deployed config Late in the SDLC, limited by time and visibility

A balanced approach: the guide recommends spending most effort early (reviews and threat modelling) and using penetration testing to confirm, not to discover everything.

Black-, gray- and white-box testing

  • Black box: the tester only has what an outside attacker has, usually a URL.
  • Gray box: the tester also has accounts for each role, documentation, or partial source code. Most professional web tests are gray box.
  • White box: full access to source code, configuration and architecture.

Passive vs active testing

WSTG splits testing into two modes:

  • Passive testing means understanding the application without attacking it: browsing every page, using an intercepting proxy, noting every request, parameter, cookie and response header. This is what Part 2 (Information Gathering) is mostly about.
  • Active testing means sending crafted input to find vulnerabilities, organised in the 11 categories that follow.

The Web Security Testing Framework (SDLC)

The guide’s framework places testing activities in five phases of the development life cycle:

flowchart TD
    P1["Phase 1: Before development<br/>Define the SDLC, review policies and standards,<br/>agree metrics"] --> P2
    P2["Phase 2: Definition & design<br/>Review security requirements,<br/>review design, threat modelling"] --> P3
    P3["Phase 3: Development<br/>Code walkthroughs,<br/>code reviews (manual + SAST)"] --> P4
    P4["Phase 4: Deployment<br/>Application penetration testing,<br/>configuration management testing"] --> P5
    P5["Phase 5: Maintenance & operations<br/>Operational reviews, periodic health checks,<br/>change verification"]
    P5 -.->|"new features & changes"| P2

Most of this series lives in Phase 4: testing a deployed application. But the same tests are useful earlier, for example as acceptance criteria during design or as regression tests in CI.

The guide also lists other methodologies worth knowing: the Penetration Testing Execution Standard (PTES), the PCI DSS penetration testing guidance, NIST SP 800-115 and the OSSTMM. WSTG focuses on the web application layer; those cover the wider engagement.


How Tests Are Identified

Every test has an ID in the form WSTG-<CATEGORY>-<NUMBER>:

1
2
3
WSTG-INFO-02      Fingerprint Web Server
WSTG-ATHN-03      Testing for Weak Lock Out Mechanism
WSTG-INPV-05      Testing for SQL Injection

Because tests are sometimes added, merged or renumbered between versions, the guide recommends including the version when you reference a test in a report or ticket:

1
WSTG-v42-INPV-05   SQL Injection, as defined in WSTG v4.2

The 12 Categories (and Where This Series Covers Them)

Part WSTG section Category ID prefix Tests
Part 2 4.1 Information Gathering INFO 10
Part 3 4.2 Configuration and Deployment Management CONF 11
Part 4 4.3 Identity Management IDNT 5
Part 5 4.4 Authentication ATHN 10
Part 6 4.5 Authorization ATHZ 4
Part 7 4.6 Session Management SESS 9
Part 8 4.7 Input Validation INPV 19
Part 9 4.8 Error Handling ERRH 2
Part 10 4.9 Weak Cryptography CRYP 4
Part 11 4.10 Business Logic BUSL 9
Part 12 4.11 Client-side CLNT 13
Part 13 4.12 API Testing APIT 1

The categories follow the order of a real engagement: understand the target first (information gathering, configuration), then who can get in (identity, authentication, authorization, sessions), then what you can make it do (input validation, errors, crypto, business logic), and finally the client side and APIs.


Setting Up a Practice Lab

Authorization first. Every technique in this series must only be used against systems you own or have written permission to test, inside an agreed scope. Unauthorised testing is illegal in most countries, including under Egyptian Law No. 175 of 2018 on Anti-Cyber and Information Technology Crimes.

A minimal lab is enough to follow every part:

1. An intercepting proxy. Everything in WSTG starts with seeing and editing raw HTTP.

  • Burp Suite (Community is free; Professional adds the scanner and Intruder speed)
  • OWASP ZAP (free, open source, scriptable)

2. A browser profile dedicated to testing, proxied through Burp/ZAP, with the proxy’s CA certificate installed.

3. Deliberately vulnerable targets, run locally with Docker:

1
2
3
4
5
6
7
8
# OWASP Juice Shop: modern single-page app + REST API, ~100 challenges
docker run -d -p 3000:3000 bkimminich/juice-shop

# DVWA: classic PHP vulnerabilities with adjustable difficulty
docker run -d -p 8080:80 vulnerables/web-dvwa

# OWASP WebGoat: guided lessons, many mapped to WSTG categories
docker run -d -p 8081:8080 -p 9090:9090 webgoat/webgoat

4. Command-line tools used throughout the series:

1
sudo apt install -y nmap curl whatweb nikto sqlmap ffuf gobuster sslscan testssl.sh

5. Online labs with structured exercises: PortSwigger Web Security Academy (free), Hack The Box Academy and TryHackMe.


Reporting Your Findings

A test is only as useful as its report. WSTG v4.2 suggests this structure:

  1. Introduction: version control, table of contents, the team, scope, limitations (what was not tested and why), timeline and a disclaimer.
  2. Executive summary: a short, non-technical overview of the business risk, the overall posture and the most important fixes.
  3. Findings: a summary table, then the details of each finding.
  4. Appendices: methodology, tool output, the full test checklist.

Each finding should be reproducible and actionable. A template that works well:

1
2
3
4
5
6
7
8
9
10
11
12
13
Title:          Stored XSS in product review comments
Reference:      WSTG-v42-INPV-02
Severity:       High (CVSS 3.1: 8.1, AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N)
Affected:       POST /api/products/{id}/reviews  (parameter: comment)
Description:    What the issue is, in one or two sentences.
Impact:         What an attacker can do with it, for this business.
Steps to reproduce:
  1. Log in as any user.
  2. Submit a review with: <img src=x onerror=alert(document.domain)>
  3. Open the product page as another user: the script executes.
Evidence:       Request/response and a screenshot.
Remediation:    Context-aware output encoding, Content Security Policy, input validation.
References:     WSTG-INPV-02, OWASP XSS Prevention Cheat Sheet.

Severity is usually rated with CVSS 3.1 or the OWASP Risk Rating Methodology (likelihood × impact). Whichever you use, apply it consistently and explain it in the report.


How to Use This Series

  • Learning: read the parts in order and reproduce each test against Juice Shop or DVWA.
  • On an engagement: use the checklist at the end of each part to track what you tested, and reference findings by their WSTG ID.
  • As a developer: jump to the Fix section of each test; it summarises the defence.

Next: Part 2 - Information Gathering, where testing starts with what the application reveals before you send a single malicious request.


A dependable toolkit and a steady practice habit matter more than any single trick. What I reach for across this series:

Core tools

Job Tools
Intercepting proxy Burp Suite, OWASP ZAP
Recon & content discovery nmap, whatweb, ffuf, gobuster, amass, subfinder, httpx
Injection & exploitation sqlmap, commix, tplmap, nuclei, PayloadsAllTheThings
TLS & crypto testssl.sh, sslscan, SSL Labs
Out-of-band (OAST) Burp Collaborator, interact.sh
API Postman, Burp InQL, Hoppscotch

Books

  • The Web Application Hacker’s Handbook (Stuttard & Pinto) — still the best single reference for the mechanics behind every WSTG test.
  • Real-World Bug Hunting (Peter Yaworski) and Bug Bounty Bootcamp (Vickie Li) — how these tests play out in real disclosed reports.
  • The Tangled Web (Michał Zalewski) — the browser security model behind client-side testing.
  • Hacking APIs (Corey Ball) — modern REST/GraphQL testing.

Hands-on labs (use these, not production, to learn)

Related standards to keep open


References

Comments

Questions, corrections or another approach? Comment with your GitHub account.

Open Research & Community Labs
صدقة جارية • Ongoing Charity

Empowering the Cybersecurity Community

All research, lab walkthroughs, and technical series on this platform remain 100% free. You can support server hosting, research environments, and lab infrastructure.

Support & Wall of Honor
اللهم اجعل هذا العمل علمًا نافعًا وصدقةً جارية، واكتب لي به الأجر والقبول، وانفع به كل من قرأه أو تعلّمه.
اللهم احفظ لي والديّ وأهلي، وبارك في أعمارهم وصحتهم، وأدم عليهم نعمة الصحة والعافية، ولا تريني فيهم بأسًا يبكيني.
Dedicated as ongoing charity and beneficial knowledge. May Allah bless my parents and family, protect them, and grant them lasting health and happiness.