In brief
A web application penetration test is a controlled attack on the application within an agreed scope and time window. It starts with a scope and rules of engagement document. The engineer then maps the application and tests login, sessions, authorization between roles, input handling and process logic, and finally delivers a report with evidence, risk ratings and recommendations. A retest follows once your team has fixed the issues. The reference methodology is the OWASP Web Security Testing Guide.
Before the test starts: the scope document
Most misunderstandings in security testing come from a vague scope. Before the start, both sides sign a short document that answers these questions:
- What is in scope: application URLs, subdomains, the API the front end calls, the admin panel.
- What is out of scope: third-party systems, the payment provider's gateway, email, the hosting infrastructure.
- Environment: test, staging or production. In production, tests that could interrupt the service or leave data behind are usually excluded.
- Accounts: two accounts for each role (customer, advisor, administrator), because authorization is tested between users of the same role and between roles.
- Time window and emergency contact: who picks up the phone if the test breaks something.
- Prohibited actions: for example sending email to real customers or denial of service tests.
- Tester IP addresses, so your monitoring team can tell the test from an attack.
It is also worth agreeing on depth. OWASP ASVS, the application security verification standard (currently version 5.0), defines three verification levels. An application holding financial or medical data needs a deeper test than a site with a contact form.
How the test runs: areas the engineer checks
| Area | What the engineer checks | Example flaw |
|---|---|---|
| Reconnaissance | application map, hidden paths, component versions, config files | an exposed folder with a database dump or a `.git` directory |
| Authentication | login, MFA, password reset, lockout after failed attempts | a password reset link that never expires and can be reused |
| Sessions | cookies, logout, token lifetime | the session still works after logout |
| Authorization | access to other users' objects and other roles' functions | changing the policy number in the URL shows another customer's policy |
| Input handling | SQL and command injection, XSS, file upload | an HTML file uploaded as "proof of ID" runs a script |
| Process logic | step order, limits, amounts, race conditions | skipping the verification step by calling the final step directly |
| Configuration | security headers, CORS, TLS, error messages | a stack trace with table names in an error message |
The order is deliberate. Broken access control is number one in the OWASP Top 10:2025, so roles and objects get the most time. A scanner does not know that customer A must not see customer B's application form. The engineer checks it with two accounts, swapping identifiers in every request.
High-risk processes are tested separately and most thoroughly: changing the payout bank account, changing contact details, account recovery, approving an application. A logic flaw there has a direct financial impact. The list of such processes is best prepared at the start, in a short threat modeling session.
What the report should contain
The report is what the test produces and the only thing left after days of work. A good report has two parts.
A management summary: scope, test dates, the main risks described in terms of impact ("a customer can see another customer's documents"), an overall assessment and recommendations.
A technical part, where every finding has:
- a title and location (URL, parameter, role),
- a description and the business impact,
- steps to reproduce with requests and responses,
- a risk rating, usually CVSS, with a justification,
- a fix recommendation at the code or configuration level,
- a reference to the OWASP category or ASVS requirement.
The report also lists the areas tested with no findings. That way an auditor sees what was tested, not only what was found.
After the report: fixes, retest, automation
Your team receives the report, sets priorities and fixes. A typical order: authorization flaws and injection first, then sessions and configuration, version disclosure last. Every fix should get a regression test so the flaw does not come back in the next release.
The retest checks the fixes using the same steps as in the report. The result is an updated list with the status of each finding: closed, partly closed, open. This is the document that usually goes to the corporate customer or the auditor.
Some checks from the test are worth moving into the pipeline: a DAST scanner against the test environment, dependency analysis and two-account authorization tests in the automated suite. The principles are covered in The OWASP Top 10 in a development team's work.
How to prepare the application and the team
- A test environment with synthetic data, not a copy of production.
- Accounts for every role and a short guide to the main processes.
- API documentation, if the front end uses its own API.
- Someone from the team available during the test to unlock an account or answer a question.
- A heads-up for monitoring and the hosting provider that the test is running.
How preparation affects the number of days and the price is covered in How much does a penetration test cost. At B2Bnetwork we run security testing of web applications based on OWASP WSTG, with a report for management and the team and a retest, as in the case study on testing an insurer's customer portal.
Questions and answers
Can a penetration test be run in production?
Yes, with limits. In production you exclude tests that could interrupt the service, change real customers' data or send them messages. Deeper tests of logic and injection are better run in a test environment with the same application version, while production is used to check configuration and anything the test environment does not have.
What is the difference between black box and gray box testing?
In black box testing the engineer has no accounts or documentation and sees the application as a stranger would. In gray box testing they get accounts for each role and an API description, so they reach authorization and process logic faster. Gray box usually produces more findings in the same time and is the most common choice for applications with a login.
How much time does the team have for fixes before the retest?
Usually a few weeks, depending on the number and severity of findings. Critical issues are worth fixing right away rather than waiting for the full report: a good vendor reports them during the test. Agree the retest date in the contract so it does not lapse.
Is the test report enough for an audit?
It is usually one piece of evidence. An auditor also checks whether the test covered the right scope, whether findings were fixed (the retest) and whether testing is repeated after changes. A report with a list of tested areas and the retest result answers most of those questions.