Skip to content
White-box penetration testing

Test your critical code with the full picture

You share accounts, architecture notes and read-only access to your source code. Our testers use the code to find the riskiest paths and prove each flaw against the running system, and AI drafts the report for their review. You get the deepest coverage for the time spent.

  • Read-only code access
  • Every flaw proven on the running app
  • AI-drafted, expert-reviewed reports

AI-powered, expert-verified

How WhyXpose AI works on this test

On a white-box test, testers follow the code to the riskiest paths while AI scans the running app and triages what it flags. AI drafts each write-up, proof of concept and fix, and a tester reviews every draft.

  1. AI-guided recon
  2. AI scanning
  3. AI triage
  4. Expert verification
  5. AI-drafted report

Verified under the Cyber Verification Programs for Anthropic Claude and OpenAI Codex Self-hosted open-source AI modelsSee the AI engine

Starting point

What the tester knows

Everything a developer on your team would know about the system in scope, with read access only.

Given

  • A test account for each role, as in a grey-box test
  • Architecture notes and data-flow diagrams, where you have them
  • Read-only access to the source code in scope
  • Relevant configuration, such as framework, deployment or infrastructure settings
  • A developer the testers can ask about how something is meant to work

Not given

  • Write access to your repositories
  • Production credentials, keys or secrets
  • Code or systems outside the agreed scope

Testers only need to read. Remove or rotate live secrets before you share code.

Trade-offs

What white-box testing finds, and what it misses

It goes deepest in the time available. The cost is the trust and setup that code access needs.

What it finds well

  • Logic flaws in money, permission and data flows, spotted by reading the code
  • Missing authorization checks on rarely used or undocumented endpoints
  • Unsafe cryptography, weak randomness and predictable tokens
  • Injection sinks buried several layers below the request
  • Hard-coded secrets, risky configuration and debug features left switched on

Blind spots

  • It needs code access, which means trust, internal sign-off and time to set up
  • It does not show how much an outsider can discover on their own
  • A large codebase needs a tight scope, or depth spreads thin
  • It is not a line-by-line audit of every file, and it does not replace secure code review
When to choose it

When white-box is the right call

Choose it when the system is critical and you can share code.

  • The code moves money or grants access

    Payments, refunds, sign-in, permissions and anything that decides who sees what. A missed flaw here costs the most.

  • Before a major launch or rewrite

    New code has never faced an attacker. Testing it with the code open finds flaws before your users do.

  • Earlier tests came back clean

    Grey-box tests found little, and you want to know whether the app is solid or the flaws are just hard to reach.

  • Much of the logic is out of sight

    Background jobs, webhooks, queues and feature flags do real work but are hard to reach from the outside.

Can’t share code? Grey-box testing gets you most of the way. See grey-box penetration testing

Compare

Black-⁠box vs grey-⁠box vs white-⁠box

The more the tester knows, the deeper they get in the same time. What changes is what you share and what is simulated.

  • Black-box

    Starting knowledge
    Target names only: domains, URLs or IP ranges
    Accounts provided
    No
    Source code
    No
    What it simulates
    An anonymous attacker on the internet
    Depth per day of effort
    Lowest: much of the time goes on discovery
    Typical fit
    Internet-facing estates and external network tests
    What you provide
    Target domains, URLs or IP ranges
  • Grey-box

    Starting knowledge
    Accounts for each role, plus any API docs you have
    Accounts provided
    Yes, one per role
    Source code
    No
    What it simulates
    A signed-in user, customer or partner, or a stolen account
    Depth per day of effort
    Higher: time goes on what each role can reach
    Typical fit
    Most SaaS apps, APIs and mobile apps
    What you provide
    Test accounts per role, API docs if available
  • White-box

    This page
    Starting knowledge
    Accounts, architecture notes, configuration and source code
    Accounts provided
    Yes, one per role
    Source code
    Yes, read-only
    What it simulates
    An insider, or an attacker who knows how the system is built
    Depth per day of effort
    Highest: the code points testers at the riskiest paths
    Typical fit
    Payment, authentication and other critical code
    What you provide
    Accounts, architecture notes, source code access

Read about the other two approaches

How it runs

How a white-box pentest runs

Five stages, from code access to verified fixes.

  1. STEP 01

    Scoping and access

    We agree the systems and repositories in scope, the roles to test, and how read-only code access is granted and later removed.

  2. STEP 02

    Reading the code

    Testers read your architecture notes and the code that handles sign-in, permissions, input and money, and list the riskiest paths.

  3. STEP 03

    Code-guided testing

    Each suspicious path is attacked on the running app with real requests, so every finding is proven, not theoretical.

  4. STEP 04

    Reporting

    AI drafts the write-up and a tester reviews it. Each finding points to the code behind it, with a CVSS 3.1 vector, proof of concept and fix, in your dashboard and a branded PDF.

  5. STEP 05

    Retest

    When a fix ships, testers check the change in the code and replay the attack against the running app.

See how findings, CVSS 3.1 scores and fixes look in the final PDF.

View sample report (PDF)
From the blog

Choosing a pentest approach: guides

  • Penetration testing

    Black-Box vs White-Box vs Grey-Box Penetration Testing

    Black-box, white-box and grey-box penetration testing compared: what testers know in each, coverage and cost trade-offs, and how to pick the right one.

    8 min read
  • Penetration testing

    7 Types of Penetration Testing and Which One You Need First

    Types of penetration testing explained: web, API, mobile, network, cloud and social engineering tests, what each one finds, and which to buy first.

    10 min read

All penetration testing guides

FAQs

White-box penetration testing: FAQs

What is white-box penetration testing?

It is a penetration test where the testers get full context: accounts for each role, architecture notes, configuration and read-only access to your source code. They use the code to find the riskiest paths, then attack the running system to prove what is really exploitable.

Is white-box testing the same as a code review?

No. A secure code review reads code to find weaknesses. A white-box pentest uses the code as a map, then proves each issue against the running app with real requests. You get fewer theoretical findings and more proven ones, but not a line-by-line audit of every file.

How do you get access to our code?

Usually through read-only access to the repositories in scope, or a code archive. We agree the method, the scope and when access ends in writing before testing starts. Remove or rotate any live secrets in the code before you share it.

Do we still need black-box or grey-box testing?

White-box covers what a signed-in user can do, as grey-box does, and goes further. It does not show what an outsider can discover with no help, so you may want to pair it with an outside-in recon pass or a black-box test of your internet-facing hosts.

Where does AI fit in a white-box test?

Testers read the code and prove each flaw on the running app themselves. AI drafts the report: the write-up, proof-of-concept steps and the fix for each finding, which a tester reviews and edits. Every reported finding is verified by a pentester. Engagement data such as findings and report content may be processed by Anthropic Claude and OpenAI Codex under their API terms (not used to train their models), or by our self-hosted open-source models.

Is white-box worth the extra setup?

For critical code, usually yes. Time that would go on guessing how the system works goes on testing it instead, so you get deeper coverage for the same effort. For a simple marketing site or brochure app, grey-box or black-box is usually enough.

Most attack paths cross more than one target. Test them together under one scope and one report.

  • Hands-on testing of your web apps for broken access control, injection, session flaws and business-logic abuse.

  • API penetration testing

    Every endpoint tested for object and function level authorization, token handling, data exposure and rate limits.

  • One place for every finding: status, CVSS 3.1, proof of concept, comments, retests and one-click PDF reports.

Test your most critical code in depth