Skip to content
Bugwise
Menu
Web Testing

Security Testing in Depth: Access, Logic, Sessions and Abuse

Go past the basic security checks. Test permission matrices across roles and workspaces, tamper with requests to find business logic flaws, check the full session lifecycle and look for rate-limit bypasses.

40–60 min advanced Web

A team tool passed every check from the basic security list. Changing invoice IDs in the URL returned 404. The admin page refused normal users. Logout worked.

Three months after release, a customer found something else. A Viewer in their team had deleted forty invoices. The Delete button was hidden for Viewers, but the APIAPIThe way different software parts talk to each other, like an app asking a server for data.Open in glossary → behind it never checked the role. The Viewer had found the request in a browser extension’s log and replayed it.

Basic checks catch the obvious holes. This lesson is about the next layer: permissions across roles and customers, rules the server forgets to enforce, sessions that live too long, and limits that can be bypassed. It builds on Security Basics for Testers and API Testing in Depth, so read those first.

Part Not started

Access control in depth

The basics taught you two checks: change an ID (horizontal: same role, someone else’s data) and open an admin page as a normal user (vertical: a lower role doing a higher role’s job). privilege escalationPrivilege escalationGetting more rights than your role allows, such as a Viewer deleting data or a customer reaching admin functions.Open in glossary → is the name for the vertical kind.

Real products add two more dimensions:

The permission matrix

Write the rules as a table: actions in rows, roles in columns, and what the spec says in each cell. Then test every cell through the API, not only through the UI. The UI hides buttons, so it only proves what the page shows, not what the server allows.

Always add a column for “admin of another workspace”. That is the account most likely to find a cross-customer leak, because it has every permission, just in the wrong place.

Try it below. The spec for an invoicing app is already in the cells. Press each cell to send the request as that role, and find the cells where the server’s answer doesn’t match the spec.

Ledgerly · permission matrix for the Acme workspace

Each cell shows what the spec expects ( allowed, denied). Press a cell to send that request as that role.

ActionViewerEditorAdminOther org admin
View an invoiceGET
Edit an invoicePATCH
Delete an invoiceDELETE
Export all invoicesGET
Invite a memberPOST
Change the planPUT
Requests sent: 0 / 24Mismatches found: 0 / 3

Where access checks hide

Teams usually protect the main page of a feature. The forgotten paths are the side doors that return the same data:

Side doorWhat to try with a lower role or another workspace
Exports and reportsCSV, PDF and “Download all” endpoints. They often skip the checks the list page has.
Search and autocompleteSearch for a name from another workspace. Even a suggestion in the dropdown is a leak.
Files and attachmentsCopy an attachment’s URL, sign out or switch user, and open it. Long random URLs are not access control.
Notifications and emailsDoes a Viewer get an email with data they can’t see in the app?
Bulk actionsBulk actionAn action applied to several selected items at once, like Delete, Archive or Mark as paid.Open in glossary →Select items, then add another workspace’s ID to the bulk request.
Counts and totalsA dashboard that says “12 invoices” while the list shows 9.
Older or mobile API versions/api/v1/ next to /api/v2/, or the mobile app’s endpoints. Fixes often land only in the newest one.

When permissions change

Permissions are not fixed. Test what happens after a change, because many apps check the role only at login:

  1. Downgrade. As Admin, change Leo from Editor to Viewer. In Leo’s already-open browser, try to edit. Expected: refused right away, not after he logs in again.
  2. Removal. Remove Leo from the workspace. His open session, his mobile app and any API tokens he created must stop working for that workspace.
  3. Invites. Use an invite link twice, or after it expired, or after the invite was cancelled. Change the role in the invite request from viewer to admin.
  4. Shared links. Create a “share with anyone who has the link” URL, then turn sharing off. The old link must stop working.

Check this part

  1. Which extra column catches cross-customer leaks in a permission matrix?

  2. The invoice list page is protected for Viewers. What else should you test?

  3. Leo is changed from Editor to Viewer while he is logged in. When should he lose edit rights?

A permission matrix across roles and customers, the places where access checks are usually forgotten, and what happens when permissions change.

Part Not started

Business logic flaws

A business logic flawBusiness logic flawA business rule the server doesn't enforce, abused with normal-looking requests.Open in glossary → is a rule of the business that the server doesn’t enforce. No strange characters or hacking tools are needed: the requests look completely normal, they just contain values or happen in an order nobody planned for.

The root cause is almost always the same: the server trusts what the client sends. Everything in the browser or the app can be changed: hidden fields, disabled buttons, JavaScript checks, request bodies. Changing a request on purpose is called parameter tamperingParameter tamperingChanging values in a request, such as a price, an ID or a hidden field, before it reaches the server.Open in glossary →.

What to change

AreaWhat to tryExpected
Prices and totalsChange price, total or discount in the checkout requestThe server calculates prices from its own catalog and ignores the client’s numbers
Quantities0, -1, 1.5, 99999400 for anything that isn’t a sensible whole number
Hidden fieldsplan, role, account_id, status, verified in profile or sign-up requestsOnly the fields the form really has are accepted
Step orderOpen the “order confirmed” or step-3 URL directly, skipping payment or verificationRedirect back to the first unfinished step
DiscountsThe same coupon twice, two coupons that shouldn’t combine, a one-per-customer coupon on a second accountOnly the allowed combination is applied
LimitsA free plan’s limit (3 projects): create the fourth through the API instead of the button403 or a clear “upgrade” error

The safest rule for fields is an allowlist: accept only name and newsletter, refuse everything else. A blocklist (“refuse role and credit_balance”) always misses a field someone adds later. Basic mass assignmentMass assignmentA bug where an API saves every field from the request body, including ones the user must not change.Open in glossary → checks with "role": "admin" are covered in API Testing in Depth. Here, try fields that blocklists tend to forget.

Try it: intercept and edit

Below are two requests captured by a proxy toolProxy toolA program that sits between the app and the server so you can watch and change network traffic.Open in glossary → in a test shop. Edit the JSONJSONA simple text format for data, used by most APIs, like {"name": "Anna", "age": 31}.Open in glossary → body and forward it to the server. The server rejects some changes correctly, so you’ll see what good behavior looks like too.

Proxy · intercepted requests (test shop)

Sent when Anna presses “Pay €93.10”. Edit the body, then forward it to the server.

POST /api/checkout · Content-Type: application/json
  • Make the server charge less than the real price
  • Get an order with a negative amount (money back)
  • Upgrade Anna’s plan without paying
Dev note: How testers do this for real

In Burp Suite or ZAP, turn on Intercept, perform the action in the browser, edit the request and press Forward. Or send a captured request to Repeater and change it there. Charles and Proxyman have Breakpoints for the same job, and they also work for mobile apps (see Proxy Tools). For an API you already know, Postman is often quicker.

Race conditions

Some rules hold for one request at a time but break when two arrive together. A gift card with €50 is redeemed in two tabs at the same moment, and both orders get €50 off. A “one free trial per account” button is pressed twice quickly, and two trials start. This is a race conditionRace conditionA bug that depends on the timing or order of events, so it only happens sometimes.Open in glossary → with money attached.

To test it, open the same action in two tabs and press both buttons as close together as you can, or double-click a submit button that doesn’t disable itself. Afterwards, check the balance or the database, not only the screen.

Dev note

Burp Suite Repeater can send a group of requests in parallel, which hits the server within a millisecond and finds races that two hands can’t. Ask before you run it on a shared environment.

Check this part

  1. The checkout request contains "unit_price": 79.0. You change it to 1 and the order is accepted for €1. What's wrong?

  2. Which protects a profile endpoint better against hidden fields?

  3. A €50 gift card is redeemed in two tabs at once and both orders get €50 off. What kind of bug is it?

Never trust the client: tampering with prices, quantities and fields, skipping steps, stacking discounts and racing two requests.

Part Not started

Sessions and tokens

A sessionSessionThe period during which a user stays logged in without entering their credentials again.Open in glossary → is the server’s memory that “this browser belongs to Anna”. The basics covered logout and idle timeoutTimeoutThe time limit after which an app stops waiting for a response and gives up.Open in glossary →. Here is the full life of a session, with a check for each stage.

When a session must end

EventWhat should happen to existing sessionsHow to test
LogoutThe server revokes the token, it doesn’t just forget it in the browserCopy a request with the token before logging out, then resend it. Expected: 401.
“Log out of all devices”Every session ends, including the mobile appLog in on two browsers and a phone, press it on one, refresh the others
Password change or resetOther sessions end (at least as an option the user sees)Same setup, change the password, check the other devices
Account disabled or removed from a teamAccess ends right awayDisable the test user as admin, refresh the user’s open tab
Idle timeoutSession ends after the agreed time without activityAsk the team for the number, wait, then act
Absolute timeoutSession ends after a maximum time, even if the user is activeCommon in banking and admin tools. Ask if there is one.

The first row is the most important one, and the most often broken. With tokens like a JWTJWTJSON Web Token: a signed token with three base64url parts (header, payload, signature) that APIs use to identify the caller.Open in glossary →, the server often can’t “take back” a token it already signed, so logout only deletes it in the browser. The token then keeps working until it expires. If it expires in 15 minutes that’s a known trade-off. If it lasts 30 days, it’s a bug worth reporting.

When a session must change

At login. If the site gives anonymous visitors a session cookieCookieA small piece of data a website stores in your browser, for example to keep you logged in.Open in glossary → (for example for a shopping cart), its value must change when the user logs in. Otherwise an attacker who planted a known session ID in the victim’s browser is logged in as the victim afterwards. This is session fixationSession fixationA bug where the session ID stays the same after login, so a planted ID becomes a logged-in session.Open in glossary →.

To test it: open DevToolsDevToolsDeveloper tools built into browsers for inspecting pages, network traffic and errors.Open in glossary → › Application › Cookies, note the session cookie’s value, log in, and compare. A new value is expected.

When privileges change. Same idea after a role upgrade or a successful second factor in two-factor authentication: a new session ID.

Where the token lives

Check in DevTools where the app stores the token. An HttpOnly cookie can’t be read by page JavaScript. A token in localStorageLocal storageBrowser storage where websites keep data that survives closing the tab, like settings or a cart.Open in glossary → can be read by any script on the page, so one Cross-site scripting (XSS)Cross-site scripting (XSS)An attack where text a user enters is run as code in other people's browsers.Open in glossary → bug is enough to steal it. The cookie flags are explained in Cookies, Sessions and Storage.

Requests from other sites (CSRF)

Browsers send cookies with requests to a site, even when the request starts on another site. Without protection, a page on evil.example could submit a hidden form to your app, and the browser would attach the user’s session cookie. This is CSRFCSRFCross-site request forgery: another site makes the user's browser send a request to your app, with the user's cookies.Open in glossary →.

Modern browsers block most of it with the SameSite cookie flag, but testers can still check two things:

  • Session cookies have SameSite=Lax or Strict. None means the cookie is sent on requests from every site.
  • Nothing changes data through a GET request or a simple link. If /account/delete?confirm=yes deletes the account, an image tag on any page can trigger it. Look in the Network tab: actions that change data should be POST, PUT, PATCH or DELETE.
Dev note: CSRF tokens

Many frameworks also add a hidden CSRF token to every form and check it on the server. To test it, resend a form request through a proxy with the token removed or changed: the server should refuse it with 403. Ask the developers which protection the app uses before you report a missing token.

Check this part

  1. You log out, then resend a request that still carries the old token. It returns 200. What does that mean?

  2. The session cookie has the same value before and after login. Which bug is this?

  3. GET /account/delete?confirm=yes deletes the account. Why is that dangerous?

The whole life of a session: when it must change, when it must end, where it is stored, and how cookies protect against requests from other sites.

Part Not started

Rate limits, enumeration and abuse

Rate limits that can be bypassed

The basics checked that a limit exists: 10 wrong passwords and you’re slowed down. A good limit also can’t be stepped around. With your test account and the team’s agreement, try:

BypassHow to try itExpected
Spelling of the emailAnna@test.com, anna@test.com (spaces), ANNA@TEST.COMAll count as the same account
Reset on success4 wrong passwords, 1 correct login with a second test account, 4 more wrongThe counter is per account, not “since the last success”
Another endpointThe same login through the mobile API, the old /api/v1/login or the “Sign in with code” flowEvery way in shares the limit
A new codeRequest a new SMS code after 4 wrong guessesThe guess counter doesn’t start from zero with each new code
Many accounts, one passwordTry one common password on 20 test accountsThe server notices many failures from one source (this is called password spraying)

Simple maths shows why it matters: a 4-digit code has 10,000 possible values. With no limit, a script tries them all in minutes. With 5 attempts per code, the chance of guessing is 5 in 10,000.

Dev note

Limits by IP address are often bypassed when the server trusts the X-Forwarded-For header from the client. A tester can add that header with a different IP in a proxy and see whether the counter resets. Do this only in your test environment and with the team.

Enumeration through the side doors

Login says “Email or password is incorrect” for both cases. Good. But account enumerationAccount enumerationFinding out which emails are registered from differences in error messages or responses.Open in glossary → has other doors:

  • Sign-up: “This email is already registered” tells anyone who has an account. A safer flow says “Check your inbox” for both cases and sends a different email.
  • Password reset: “We sent a link to anna@test.com” vs “No account found”.
  • Invites and sharing: typing an email in “Share with…” shows the person’s name and photo.
  • Response size or time: the page looks the same, but in the Network tab the response for a real account is larger or much slower. Compare a few times.

Report these as one issue per flow. The team decides how much it matters: for a bank or a health app it’s serious, for a public forum it may be accepted.

Abuse without breaking in

Some problems don’t break any rule in the code, but still cost the company money or trust:

  • SMS and email pumping: “Send code again” with no limit, or to phone numbers in expensive countries, can create a large SMS bill.
  • Referral and sign-up bonuses: one person, ten test emails with +1, +2 (anna+1@test.com), ten bonuses.
  • Free trials: a new trial after deleting and re-creating the account.
  • Fake reviews or votes: the same account voting twice through the API.

These are good questions for refinement: “What stops someone from doing this 1,000 times?”

Check this part

  1. Login blocks anna@test.com after 5 failures, but ANNA@test.com gets 5 more. What's the bug?

  2. Which response leaks whether an account exists?

How rate limits get bypassed, the other places that reveal which accounts exist, and abuse that costs money without breaking in.

Part ProNot started

Lab: find the bugs

This is a vulnerable test build of Ledgerly, an invoicing app that companies share with their team. It runs only in your browser with fake data. Under it is a proxy log: open any request to see its token and response, then Resend it or Edit and resend it with a different method or path.

Three test accounts:

  • Mia, Admin at Acme
  • Leo, Viewer at Acme: he can see invoices but not change them
  • Sam, Admin at Globex, a different customer

Use everything from this lesson: the role matrix, the other workspace, the side doors, the session lifecycle and the responses the page doesn’t show.

🐞 Bug hunt: Ledgerly test build

This demo has 5 hidden bugs. Explore it like a tester, then check your findings.

Found0/5

Sign in to Ledgerly

Test accounts (staging):

Proxy · 0 requests (preserved across logout)

Sign in to start capturing requests.

Resend uses the request’s original Authorization header, like a proxy tool does.

  1. 1

    Hint: Sign in as Leo, open an invoice, then edit its request in the proxy log.

  2. 2

    Hint: Sign in as Sam and type the address of one of Acme's invoices.

  3. 3

    Hint: Log out, then resend a request from before.

  4. 4

    Hint: The Members page shows names and roles. What does its request return?

  5. 5

    Hint: Change the password in Settings and read the session list.

Check this part

  1. In the lab, PATCH as Leo returned 403 but DELETE returned 204. What does that tell you?

  2. Why did the Members page look fine although the API leaked password hashes?

An invoicing app for teams with a proxy log under it, and five security bugs to find by switching users, editing requests and reading responses.

The rest of this lesson is in Bugwise Pro

The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.

Part ProNot started

Rating and reporting

This lesson on the OWASP map

What you testedOWASP Top 10 (2025) category
Permission matrix, other workspace, side doorsBroken Access Control, still number one
Price and quantity tampering, step skipping, races, abuseInsecure Design: the rule was never designed into the server
Session lifecycle, fixation, bypassable limits, enumerationAuthentication Failures
Hashes and tokens in responsesBroken Access Control and Cryptographic Failures

How severe is it?

Answer three questions in every security report. Together they decide the severitySeverityHow much damage a bug does to the product or the user.Open in glossary →:

  1. Who can do it? Anyone on the internet, any logged-in user, only an admin, or only someone with access to the victim’s device.
  2. What do they get? Read one record, read everyone’s data, change or delete data, take over accounts, move money.
  3. How hard is it? Change one number in the URL, edit a request in a proxy, or win a race within milliseconds.
ExampleWhoWhatHow hardSeverity
Other workspace reads any invoiceAny customerRead all customers’ dataChange one IDCritical
Viewer deletes invoicesAny ViewerDelete company dataEdit a requestHigh
Old token works after logoutSomeone who has the tokenUse the accountNeeds the token firstMedium–High
Sign-up reveals registered emailsAnyoneLearn who has an accountType an emailLow–Medium, depends on the product
Dev note: CVSS

Security teams often score bugs with CVSS (Common Vulnerability Scoring System), which turns similar questions into a number from 0 to 10. You don’t need to calculate it, but your three answers give the security team what they need for the score.

Example test cases

TC-SEC2-001Each role gets the expected result for every action in the permission matrix

Preconditions

  • Test users for every role, plus an admin of a second workspace
  • The permission matrix from the spec

Steps

  1. For each action, send the request as each role (through the API, not only the UI)
  2. Note the status code in the matrix
  3. Mark every cell that differs from the spec

Expected result

Every cell matches the spec. Denied actions return 403 (same workspace) or 404 (other workspace) and change no data.

TC-SEC2-002Exports and search never include another workspace's data

Preconditions

  • Workspaces A and B with known, different records

Steps

  1. As admin of A, run Export all
  2. Search for a client name that exists only in B
  3. Open an attachment URL from B while signed in to A

Expected result

Only A data in the export. No results or suggestions from B. The attachment returns 404.

TC-SEC2-003A downgraded user loses rights without logging in again

Steps

  1. Log in as Editor in browser 1
  2. As Admin in browser 2, change the Editor to Viewer
  3. In browser 1, edit an invoice without reloading

Expected result

The edit is refused with 403. The UI shows the user no longer has permission.

TC-SEC2-004Checkout ignores prices and totals sent by the client

Preconditions

  • Proxy tool set up for the test environment

Steps

  1. Add an item that costs €79 to the cart
  2. Intercept the checkout request
  3. Change unit_price to 1 and forward it

Expected result

The order is charged €79 (the server uses its own price), or the request is rejected with 400.

TC-SEC2-005Quantities below 1 are rejected

Steps

  1. Intercept the add-to-cart or checkout request
  2. Send qty 0, then -1, then 1.5

Test data

qty: 0, -1, 1.5

Expected result

400 for each value. No order with a zero or negative total is created.

TC-SEC2-006An old token is refused after logout

Steps

  1. Log in and capture any API request with its token
  2. Log out
  3. Resend the captured request

Expected result

401 Unauthorized. No data is returned.

TC-SEC2-007Password change ends other sessions

Steps

  1. Log in on browser 1, browser 2 and the mobile app
  2. Change the password in browser 1
  3. Refresh browser 2 and reopen the app

Expected result

Browser 2 and the app ask for login. The session list shows only browser 1.

TC-SEC2-008The session ID changes at login

Steps

  1. Open the site signed out and note the session cookie value in DevTools
  2. Log in
  3. Compare the value

Expected result

A new session cookie value after login. The old value no longer works.

TC-SEC2-009The login limit can't be bypassed with a different spelling of the email

Preconditions

  • Agreed with the team: 5 failures lock the account for 15 minutes

Steps

  1. Fail 5 times with anna@test.com
  2. Try ANNA@test.com and " anna@test.com " with a wrong password
  3. Try the correct password

Expected result

All spellings are locked. The correct password is refused until the lockout ends.

Tip: click a test case to expand it.

Key takeaways

Check this part

  1. Which three questions decide a security bug's severity?

  2. In the test case for prices, which result is correct?

How this lesson maps to the OWASP Top 10, how to rate a security bug's severity, and ready-made test cases for roles, tampering, sessions and limits.

The rest of this lesson is in Bugwise Pro

The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.

Checklist

Security testing in depth (test environment only)

0 of 13 checked

Finished this page?Nice work, this page is complete!

Mark it as done to track your progress. It's saved in this browser, no account needed.

Its cards are now in your Bites review ⚡
Esc

Type to search the whole site.