Sitemap
Aditya Kumar

Aditya Kumar

BTech | Security Software Engineer & Researcher | Cloud Security | Python, AWS, MERN, ReactJS | Mail: adii.utsav@gmail.com

Web Application Security: Hands-On Practice (Chapter 11 from The Web Application Hacker’s Handbook)

8 min readFeb 13, 2026

Note: This write-up reflects my learning and hands-on practice based on the book The Web Application Hacker’s Handbook: Discovering and Exploiting Security Flaws by Dafydd Stuttard and Marcus Pinto.

Press enter or click to view image in full size

Attacking Application Logic:

What is “logic” in a web application?

Every web application (like a banking site, shopping website, or college portal) works based on logic. Logic means rules and decisions that tell the application what to do in different situations.

Web applications rely heavily on logic, which converts human requirements into small executable steps. Logic flaws are hard to detect, often missed by automated tools, and overlooked compared to common vulnerabilities like SQL injection. Due to their uniqueness and subtlety, logic flaws are highly valuable targets for attackers.

The Nature of Logic Flaws:

Logic flaws are errors in application reasoning caused by faulty or incomplete assumptions made by developers. They have no fixed patterns, making them difficult for automated tools and standard testing to detect. Due to their diversity and subtlety, logic flaws remain a long-term and valuable target for attackers.

Real-World Logic Flaws:

Example1: Fooling a Password Change Function

Step1: (Goal: Normal password change)

Press enter or click to view image in full size

Step2: (Goal: The logic flaw attack)

Press enter or click to view image in full size

This exploits the logic flaw. No existingPassword parameter at all.

Step3: (Goal: Verify if the attack worked)

Press enter or click to view image in full size

In case it is secured then the following output would have came:

Press enter or click to view image in full size

Example2: Proceeding to Checkout

Step1: (Goal: Check the normal behaviour)

Add item to cart:

Press enter or click to view image in full size

Review cart:

Press enter or click to view image in full size

Payment (legitimate):

Press enter or click to view image in full size

Delivery (legitimate):

Press enter or click to view image in full size

Step2: (Goal: Forced browsing)

Add item to cart (same as normal):

Jump straight to delivery:

Press enter or click to view image in full size

Clearly, Order placed WITHOUT payment.

Verify the Exploit:

Press enter or click to view image in full size

Example3: Rolling Your Own Insurance

Step1: Open the Burp Suite, and in the browser open the website as shown below:

Press enter or click to view image in full size

Step2: Enter the amount in normal way, and proceed normally:

Press enter or click to view image in full size

Then,

Press enter or click to view image in full size

Then,

Press enter or click to view image in full size

Then,

Press enter or click to view image in full size

Observe the burp:

Press enter or click to view image in full size

See the /step1. And the /step2:

Press enter or click to view image in full size

Step3: (Goal: Change Price After Step 1)

For this, forward the request to repeater:

Press enter or click to view image in full size

Example4: Breaking the Bank

Browser:

Press enter or click to view image in full size

Step1: (Goal: Login as normal user). Alice:alice123

Press enter or click to view image in full size

Now, click on “Register Another Account” and register the other account:

Press enter or click to view image in full size

Following confirmation comes:

Press enter or click to view image in full size

The app did: session[“customer”] = create_customer_object(data, cust_number)

It OVERWROTE our authenticated identity.

Step2: (Goal: Over writing the registration)

In the new tab, go to the ‘/dashboard’ :

Press enter or click to view image in full size

We logged in as Alice… But now we’re inside Bob’s account.

Why This Is Dangerous? The app reused the same object: session[“customer”]

For:

· Authentication

· Registration

· Identity storage

Registration overwrote it.

Example5: Erasing an Audit Trail

Browser:

Press enter or click to view image in full size

Step1: (Goal: Login as the normal user)

Press enter or click to view image in full size

Following dashboard shall appear:

Press enter or click to view image in full size

Step2: (Goal: To exploit) Create a fake admin. Go to the “create user” link:

Press enter or click to view image in full size

Fill it like this, and click on “Create” button, and then logout:

Press enter or click to view image in full size

Now, login as the tempadmin:

Press enter or click to view image in full size

Step3: (Goal: Malicious activity)

Click on : Reset all passwords. Now every user password = hacked

Press enter or click to view image in full size

Click on: Delete Audit Logs.

Press enter or click to view image in full size

Now, Click on View logs:

Press enter or click to view image in full size

Everything else is gone.

What Happened?

The system assumed: If someone deletes logs, the deletion itself will be logged.

But:

Get Aditya Kumar’s stories in your inbox

Join Medium for free to get updates from this writer.

1. You created a second admin.

2. Used it for attack.

3. Deleted logs.

4. Only entry left points to fake account.

There is no evidence linking original admin. Perfect crime.

Example6: Beating a Business Limit

Browser:

Press enter or click to view image in full size

When clicked on “Login”:

Press enter or click to view image in full size

Again,

Press enter or click to view image in full size

Step1: (Goal: Normal test)

Press enter or click to view image in full size

When clicked on “Transfer” button:

Press enter or click to view image in full size

Clearly, Protection works for positive numbers.

Step2: (Goal: bypassing)

Press enter or click to view image in full size

When did:

Press enter or click to view image in full size

Transfer 20,000 from A → B. WITHOUT approval.

Balances become:

Account A: 30000

Account B: 30000

We bypassed anti-fraud protection.

Example7: Cheating on Bulk Discounts

Browser:

Press enter or click to view image in full size

Step1: (Goal: Normal behaviour)

Press enter or click to view image in full size

Add the first three, then visit the View Cart:

Press enter or click to view image in full size

Clearly, Discount applied.

Step2: (Goal: To cheat)

Remove any two of them from the cart:

Press enter or click to view image in full size

Original price was $80. We still have 25% discount. System did NOT recalculate.

Example8: Abusing a Search Function

Browser:

Press enter or click to view image in full size

Step1: (Goal: Broad Search) Search: Wahh Consulting

Press enter or click to view image in full size

We are NOT subscribed. We see titles but no content.

Step2: (Goal: Try Narrowing) Search: Wahh Consulting takeover

Press enter or click to view image in full size

We just learned: One article contains the word “takeover”.

Step3: (Goal: Refine further) Search: Wahh Consulting takeover NGS

Press enter or click to view image in full size

Step4: (Goal: Test Different Outcomes)

Search: Wahh Consulting takeover cancelled -> 0 matches

Search: Wahh Consulting takeover completed -> 0 matches

Without subscribing, we just reconstructed: Wahh Consulting completed takeover of NGS, is not present.

Example9: Snarfing Debug Messages

Browser1:

Press enter or click to view image in full size

Browser2:

Press enter or click to view image in full size

Step1: (Goal: Login)

· Browser 1 → Login as alice

· Browser 2 → Login as bob

Browser 1:

Press enter or click to view image in full size

Browser 2:

Press enter or click to view image in full size

Step2: (Goal: Alice Triggers an Error)

In Browser 1 (Alice):

Go to: Transfer Money

Press enter or click to view image in full size

Try to transfer the money ’5000’.

Press enter or click to view image in full size

This triggers the artificial bug.

We get redirected to: /error

You’ll see:

· Alice’s username

· Alice’s session token

· Alice’s parameters

· Error message

So far, this seems normal.

Step3: (Goal: Bob Steals Alice’s Debug Info)

In Browser 2 (Bob): Without triggering any error, manually go to:

http://127.0.0.1:5000/error

Press enter or click to view image in full size

Bob now sees:

· Alice’s username

· Alice’s session token

· Alice’s transfer details

This is cross-user data leakage.

Example10: Racing against the Login

Browser:

Press enter or click to view image in full size

Race condition:

Press enter or click to view image in full size

Avoiding Logic Flaws:

Logic flaws are prevented by:

· Clear documentation

· Strict session-based identity

· No shared mutable state

· Careful state transitions

· Defensive design reviews

· Lateral thinking during code review

Contact Me
📧 Email: adii.utsav@gmail.com
🔗 LinkedIn: https://www.linkedin.com/in/aditya-kumar-3241b6286/
💻 GitHub: https://github.com/Rememberful

--

--

Aditya Kumar
Aditya Kumar

Written by Aditya Kumar

BTech | Security Software Engineer & Researcher | Cloud Security | Python, AWS, MERN, ReactJS | Mail: adii.utsav@gmail.com