// GLOSSARY

Black box, gray box, and white box: three levels of knowledge in a test

Black box, gray box, and white box are three levels of knowledge a tester starts with: from no information at all, through user accounts and documentation, to access to the source code. The choice changes how much of the budget goes to reconnaissance and how much to finding vulnerabilities. For web applications the default choice is gray box, because the tester gets accounts for every role and doesn’t have to spend time obtaining them.

// 01

The three variants side by side

CriterionBlack boxGray boxWhite box
What the tester knowsOnly what is public: a domain or an IP rangeAccounts for every role, documentation, an architecture descriptionThe same as gray box, plus the source code
What is handed overThe target of the test and the rules of engagementTest accounts, test data, a developer contactThe repository, the database schema, the environment configuration
Where the time goesA large share on reconnaissance and gaining accessMost of it on testing features and rolesMost on reading code and verifying the branches found
What it reveals in additionWhat is visible from outside without a single accountAuthorization flaws between user rolesValidation and logic flaws buried deep in the code
What it wastesBudget on finding out what the company already knowsAn attacker’s view without an account, unless you also test from outsideTime reading code in a large application
Effect on durationLonger for the same scope and the same number of findingsMatches the estimate the scope was planned withLonger preparation, faster confirmation of findings
When it makes senseChecking the external perimeter without knowledge of the insideThe default mode for web applications and APIsIn-house development with a large share of business logic

The difference between the variants isn’t in how thorough the test is, but in how much of the agreed time goes to finding out information the client already has. One note on spelling: gray box and grey box are the same thing; we use the US form, gray.

// 02

When black box makes sense and when it’s a waste

Black box makes sense where the goal is to verify what an attacker sees without any access at all: the external perimeter, a public portal, a mail gateway. For an application behind a login, though, a large part of the time is spent obtaining an account and mapping the features, work that gray box settles by handing over credentials.

The argument for black box is that it’s more realistic. It rests on an equation that doesn’t hold: the less the tester knows, the more faithfully they supposedly simulate an attacker. The trouble is the time budget. An attacker can push at one company for months at no cost; the tester has 15 days. Simulating ignorance therefore means buying reconnaissance instead of findings.

  • The external perimeter is being tested and the question is what can be seen from there at all.
  • The brief includes checking whether anyone catches the attack.
  • The application is public and the tester can register an account themselves.
  • The client needs to show a counterparty that the test ran without inside information.

Choose black box if you’re testing what is visible from the internet, not what happens after login.

// 03

Why gray box is the default for applications

Gray box is the default choice for web applications and APIs because the tester gets an account for every role and can go straight to checking whether it’s possible to climb from one role into another. Authorization flaws, meaning access to someone else’s data after a legitimate login, can’t be tested without an account for every role.

Handing over accounts also solves a practical problem: without them, the tester has no idea that besides the ordinary user the application also has an approver role and a branch manager role. The range of checks the tester goes through is governed by the methodology, not by the level of knowledge; for web that is most often the OWASP Web Security Testing Guide.

Choose gray box if the application has more than one user role and you care that all of them get tested.

// 04

When it pays to give the tester the source code

White box pays off for applications that the company develops itself and that carry a lot of custom logic: payment flows, limit calculations, integrations with banking interfaces. With the code, the tester also verifies branches that can’t normally be reached from the interface and, for each finding, points straight to the place that needs fixing.

The worry that handing over code gives something away to the tester misses the point. Code doesn’t raise the severity of a finding; it only shortens the path to it. What the tester may and may not do with it is governed by the NDA and the rules of engagement anyway, not by keeping the repository secret.

  • You develop the application yourselves or have access to the code through your vendor.
  • A substantial part of the risk is in the logic, not the configuration.
  • The test is meant to follow up on a code review or on fixes from the previous round.
  • The application processes payments, health data, or other sensitive data.

// 05

For a network and for an application the words don’t mean the same thing

For an application, the level of knowledge means accounts, documentation, and source code. For a network it’s something else: whether the tester knows the topology, IP ranges, and list of systems in advance, or has to find them alone. The same word in an inquiry for a test of an application and its roles and for a test of networks and servers therefore means different preparation each time.

For an internal network there is also a third variable that box terminology doesn’t cover at all: what privileges the tester starts with. Whether they get an ordinary domain account or first have to get onto the network themselves changes the result of the test more than how much documentation they read beforehand.

// 06

What is actually handed over in each variant

The list of inputs belongs in the brief, not in the kickoff call. When accounts and test data get sorted out only after the start, the time comes out of testing, regardless of the variant chosen.

InputBlack boxGray boxWhite box
Scope and rules of engagementAlwaysAlwaysAlways
An account for every user roleNoAlwaysAlways
Test data and a test environmentBy agreementAlwaysAlways
Description of architecture and integrationsNoUsuallyAlways
A developer contact for questionsNoUsuallyAlways
An exception on the web application firewall (WAF) or rate limitingDepends on the goal of the testUsuallyUsually
Access to the repositoryNoNoAlways

// 07

Frequently asked questions

White box usually yields the most findings, because the tester doesn’t spend time hunting for entry points and also sees branches of code that can’t be reached from the interface. The difference from gray box is smaller than expected, though, and for applications without custom logic it tends to be negligible.

Black box is more realistic in one respect only: it copies the attacker’s starting position. It doesn’t copy their time. An attacker can keep trying for months; a tester has days, so the result tends to be a less explored application, not a more faithful simulation.

No. For web applications the default mode is gray box, meaning accounts and documentation but no code. Code makes sense for in-house development with a lot of business logic, and where the test is meant to follow up on a code review.

For the same scope, yes. Black box spends part of the days on reconnaissance, so less time is left for the testing itself. Gray box and white box are planned for the same number of days; the days are just split differently between preparation and testing.

Yes, and for tests that also aim to verify detection it’s often a sensible approach. You agree that the first few days run without information, and at a predetermined moment the tester receives accounts. The condition is that this is in the rules of engagement in advance, not decided by the running results.

Related pages

Updated September 5, 2026.

// TEST BRIEF

Not sure which variant to put in your inquiry?

Tell us what you want tested. We’ll get back to you and schedule a call to pin down scope, timing, and price.