<?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 Theankitsaini16 on Medium]]></title>
        <description><![CDATA[Stories by Theankitsaini16 on Medium]]></description>
        <link>https://medium.com/@theankitsaini16?source=rss-5471faa74dce------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9vVvZ6jK_dnbKLFN</url>
            <title>Stories by Theankitsaini16 on Medium</title>
            <link>https://medium.com/@theankitsaini16?source=rss-5471faa74dce------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 22:33:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@theankitsaini16/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[A Secret Key in Plain Sight:
How I Earned My First $200 Finding a Hidden API Leak]]></title>
            <link>https://medium.com/@theankitsaini16/a-secret-key-in-plain-sight-how-i-earned-my-first-200-finding-a-hidden-api-leak-97bd6b40dbb0?source=rss-5471faa74dce------2</link>
            <guid isPermaLink="false">https://medium.com/p/97bd6b40dbb0</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[reconnaissance]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[api-key]]></category>
            <dc:creator><![CDATA[Theankitsaini16]]></dc:creator>
            <pubDate>Sun, 24 May 2026 17:16:28 GMT</pubDate>
            <atom:updated>2026-05-24T17:16:28.340Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A JavaScript file. One exposed key. And months of patience that finally paid off — here’s the full story of my first paid bug bounty.</em></p><h3>Introduction</h3><p>This is the story of my first paid bug bounty — a $200 reward from VFS Global, one of the world’s largest visa and consular outsourcing companies. The vulnerability was an API key exposed inside a publicly accessible JavaScript file on their web application onevasco.com. While it may sound simple on the surface, the real impact came from proving how that single exposed key could disrupt critical business services — and that story took six months to tell.</p><p>The bug was found through a structured recon methodology, not by luck. This write-up walks through every step, from initial scope mapping to final disclosure, so you can replicate this approach on your own programs.</p><h3>About the Program</h3><p>VFS Global runs a public bug bounty program listed on YesWeHack — one of the leading European bug bounty platforms. YesWeHack connects security researchers with organizations that want their systems tested by the community, with rewards based on the severity and impact of confirmed findings.</p><p>The scope included onevasco.com, the company’s global visa application portal. With millions of users processing sensitive travel documents through this platform, any vulnerability affecting its infrastructure carries real-world weight.</p><p><em>“When choosing targets, I always prefer programs with broad scope. More subdomains = more attack surface = more chances to find something nobody else checked.”</em></p><h3>Recon Methodology: How I Found It</h3><p>Finding this bug wasn’t about getting lucky. It was the result of following a repeatable methodology I’ve built over time. Here’s exactly what I did, step by step.</p><h3>Step 1 Saving the In-Scope Domains</h3><p>The first thing I do on any engagement is record all domains explicitly listed in scope. I save them to a local file so every subsequent tool has a clean, consistent input. This prevents scope creep and keeps my recon targeted.</p><p># Saved all in-scope domains to a file<br><em>touch domains.txt</em></p><h3>Step 2 Subdomain Enumeration</h3><p>With the root domains saved, I ran subdomain enumeration using four different tools in parallel. Using multiple tools is important because each one queries different data sources — passive DNS, certificate transparency logs, brute-force wordlists — and combining their results gives a much more complete picture.</p><p>1. subfinder — passive subdomain discovery using APIs from SecurityTrails, VirusTotal, Shodan, and more.<br><em>subfinder -dL domains.txt -all -recursive -o subs/subfinder_domains.txt</em></p><p>2. amass — active and passive enumeration with DNS resolution and graph mapping.<br><em>amass enum -config ~/.config/amass/config.ini -passive -df domains.txt -o subs/amass_passive.txt</em></p><p>3. assetfinder — fast passive discovery using certificate transparency and web scraping.<br><em>assetfinder -subs-only domains.txt &gt; subs/assetfinder_domains.txt</em></p><p>4. crt.sh — certificate transparency log search. Certificates expose subdomains that never show up in DNS brute-force.<br><em>curl -s “https://crt.sh/?q=%25.gecina.fr&amp;output=json&quot; \ | sed ‘s/\\u0000//g’ \ | grep -v “&lt;html” \ | jq -r ‘.[].name_value’ \ | tr ‘\n’ ‘,’ \ | tr ‘,’ ‘\n’ \ | sed ‘s/\*\.//g’ \ | sort -u &gt; subs/crtsh.txt</em></p><p><em>5.</em>Filter all the unique subdomains into a one file.<em><br>cat subs/*.txt | sort -u &gt; all_subs.txt</em></p><h3>Step 3 Checking Live Subdomains with httpx</h3><p>Raw subdomain lists contain a lot of noise — expired domains, parked pages, dead hosts. Before wasting time on a URL, I use httpx to probe each subdomain and filter down to only the ones actually returning HTTP responses. This saves hours.</p><p><em>cat all_subs.txt | httpx-toolkit -silent -ports 80,443,8080,8443 -o alive/alive_subs.txt</em></p><h3>Step 4 URL Collection from Live Subdomains</h3><p>With a clean list of live domains, the next step is collecting every URL those domains have ever served — JavaScript files, API endpoints, parameters, paths. I use three tools here because they pull from different sources: active crawling, Wayback Machine archives, and Google’s indexed URLs.</p><p>5. katana — fast, active web crawler that follows links and extracts URLs from JavaScript.<br><em>cat alive/alive_subs.txt | katana -d 3 -silent -o urls/katana_urls.txt</em></p><p>6. waybackurls — pulls historical URLs from the Wayback Machine archive.<br><em>curl -s “http://web.archive.org/cdx/search/cdx?url=*.target.com/*&amp;output=text&amp;fl=original&amp;collapse=urlkey&quot; | sed ‘s_https*://__’ | cut -d’/’ -f1 | sort -u &gt; subs/wayback.txt</em></p><p>7. gau (Get All URLs) — aggregates URLs from Wayback Machine, Common Crawl, and OTX.<br><em>cat alive/alive_subs.txt | gau — subs — threads 50 | sort -u &gt; urls/gau_urls.txt</em></p><p>combine all the unique urls into a one file.<br><em>cat urls/*.txt | sort -u &gt; all_urls.txt</em></p><h3>Step 5 Filtering JavaScript Files</h3><p>From tens of thousands of collected URLs, I use grep to filter down only the JavaScript files. JS files are goldmines — they contain API keys, internal endpoints, tokens, and business logic that developers forget is publicly accessible.</p><p><em>cat all_urls.txt | grep -E “\.js$” &gt;&gt; js.txt</em></p><h3>Step 6 — Scanning JS Files with Nuclei</h3><p>Now comes the automated part. I ran Nuclei with its JavaScript secret detection templates against all the collected JS file URLs. Nuclei checks each file for common patterns — API keys, tokens, credentials, private keys — using community-maintained signatures.</p><p><em>cat js.txt | nuclei -t ~/.local/nuclei-templates/http/exposures/</em></p><p>This is where the API key surfaced. Nuclei flagged a match inside the file:</p><p><a href="https://www.onevasco.com/ind/en/main.a6d94dedc267cc1d.js">https://www.onevasco.com/dir{1}/dir{2}/main.file_name.js</a></p><p>The key was embedded in plaintext inside the minified JavaScript bundle — a token for the IPData geolocation API.</p><h3>Verification: Is This Key Actually Valid?</h3><p>Finding a string that looks like an API key means nothing until you verify it works. A lot of researchers skip this step and report dead keys — that’s a fast track to getting your report closed as N/A.</p><h3>Basic curl Check</h3><p>My first move was a simple curl request to the IPData API endpoint using the exposed key:</p><p>curl <a href="https://api.ipdata.co/152.59.150.110?api-key=f74aee6d810181112e64b9e2ef1da8efeef609fb104d658e128ec80d">https://api.ipdata.co/152.59.150.110?api-key=</a>&lt;api-key&gt;</p><p>The API responded immediately with full geolocation data:</p><p>{</p><p>“ip”: “152.59.150.110”,</p><p>“region”: “Assam”,</p><p>“country_name”: “India”,</p><p>“latitude”: 26.188499,</p><p>“longitude”: 91.739196,</p><p>“asn”: { “name”: “Reliance JIO Infocomm Limited” }</p><p>}</p><p>The key was live and working. But a valid API key that only gets a few requests is low-impact. I needed to understand the actual blast radius.</p><h3>Bash Script — Testing API Rate Limits</h3><p>Many APIs — especially on free tiers — enforce a daily request limit. If this key was on a free plan with a 1,500 request/day cap, the risk is moderate. But if it was unlimited or on a paid plan, the risk is significantly higher. I wrote a basic bash script to find out:</p><p><em>#!/bin/bash</em></p><p><em># Send 1000 requests and check for rate limit errors</em></p><p><em>for i in $(seq 1 1000); do</em></p><p><em>STATUS=$(curl -s -o /dev/null -w “%{http_code}” \</em></p><p><em>“https://api.ipdata.co/8.8.8.8?api-key=&lt;api-key&gt;&quot;)</em></p><p><em>echo “Request $i: HTTP $STATUS”</em></p><p><em>if [ “$STATUS” != “200” ]; then</em></p><p><em>echo “Rate limit hit at request $i”</em></p><p><em>break</em></p><p><em>fi</em></p><p><em>done</em></p><p>Every single one of those 1,000 requests came back with HTTP 200. No rate limit. No throttling. No error response. The key kept working without interruption.</p><p><em>“When all 1,000 requests returned 200, I knew this wasn’t a free tier key. This was something the company was paying for — and I could exhaust it.”</em></p><h3>Checking IPData’s Pricing Plans</h3><p>I went directly to the IPData platform and looked at their pricing. Their free plan caps out at 1,500 requests per day. Paid plans scale into millions of daily requests depending on the tier — and they cost real money.</p><p>Given the key handled 1,000 back-to-back requests without any pushback, this was clearly a paid subscription. That changes the risk profile entirely.</p><h3>Business Impact: Why They Paid $200 for “Just an API Key”</h3><p>This is the section most researchers get wrong. Finding a key is step one. Explaining why it matters to the business is what converts a report into a bounty.</p><p>Here is the real impact I documented:</p><h3>Service Disruption via Quota Exhaustion</h3><p>VFS Global uses the IPData API as part of their application infrastructure — likely to power geolocation features for users accessing the platform from different countries. If a malicious actor sends enough requests to exhaust the daily quota, those geolocation features stop working entirely for legitimate users.</p><p>For a company processing hundreds of thousands of visa applications globally, a degraded or unavailable service translates directly to lost productivity, user frustration, and potential SLA violations. This is a real business outage — caused by a single exposed API key.</p><h3>Financial Loss from API Abuse</h3><p>On a paid plan, every API call costs money. An attacker running continuous requests against this key isn’t just disrupting the service — they’re running up VFS Global’s bill. Depending on the plan tier, thousands of requests per day could translate to hundreds of dollars in unauthorized charges that VFS Global has no easy way to dispute without rotating the key and investigating the abuse.</p><h3>Infrastructure Intelligence Gathering</h3><p>The geolocation data returned by IPData includes latitude, longitude, ASN, ISP, and carrier information for any queried IP. Applied to VFS Global’s own server IPs, this is a reconnaissance tool — it gives an attacker a detailed map of where infrastructure physically lives, which network it runs on, and who operates it. That kind of intelligence is the starting point for targeted physical, network, or social engineering attacks.</p><p><em>“The lesson I took away from this report: always show the actual impact on the business. Not just ‘I found a key’ — but ‘here is what breaks, here is what it costs, here is who it affects.’ That’s the difference between a duplicate/informational and a paid bounty.”</em></p><h3>Disclosure Timeline</h3><p>Bug bounty is a test of patience as much as skill. Here is how the six-month disclosure played out:</p><p>• November 5, 2024 — Submitted report on YesWeHack. Received acknowledgment within hours.</p><p>• November 27, 2024 — Team asked to demonstrate security impact. Went back to research additional impact vectors.</p><p>• December 13, 2024 — Provided geolocation PoC: extracted lat/long coordinates of infrastructure IPs using the exposed key.</p><p>• December 14, 2024 — Added note about paid API plan and financial abuse potential.</p><p>• December 15, 2024 — Submitted the bash script PoC demonstrating quota exhaustion via 1,000+ continuous requests.</p><p>• February 5, 2025 — Followed up professionally after extended silence.</p><p>• April 22, 2025 — Team confirmed they had shared the report internally and were reviewing.</p><p>• May 14, 2025 — Report accepted. CVSS updated to 5.3 Medium. Fix deployed. Asked to verify.</p><p>• May 25, 2025 — Noticed the API was still responding despite reported fix. Flagged to the team.</p><p>• October 22, 2025 — Team confirmed the key was fully removed from the JavaScript bundle.</p><p>• November 3, 2025 — Verified: endpoint returns no key, access denied. Fix confirmed.</p><p>• November 4, 2025 — Report closed as Resolved. $200 bounty awarded. ✓</p><h3>Key Lessons for Bug Hunters</h3><p><strong>Follow a methodology, not a hunch</strong></p><p>This bug wasn’t found by randomly clicking around. It came from a repeatable pipeline: scope → subdomains → live hosts → URL collection → JS filtering → secret scanning. Build your own methodology and run it consistently on every target.</p><p><strong>Use multiple tools for the same task</strong></p><p>Subfinder alone would have missed subdomains that amass found. Katana alone would have missed URLs that Wayback Machine had archived. Redundancy in recon tools = better coverage.</p><p><strong>Always verify before reporting</strong></p><p>A key that looks like an API key is not a finding. A working, exploitable key with documented impact is a finding. The curl test and the bash rate-limit script turned a potential N/A into a $200 bounty.</p><p><strong>Show business impact, not just technical facts</strong></p><p>The triage team asked me to prove impact — twice. The researchers who can’t answer that question lose their bounty. Always ask: what breaks for the business if an attacker exploits this? Service downtime? Financial loss? Data exposure? Make the answer impossible to ignore.</p><p><strong>Patience and professionalism win</strong></p><p>This report sat open for six months. I kept following up, providing new PoCs when asked, and staying respectful throughout. That matters. Security teams are busy, programs get backlogged, and researchers who stay constructive are the ones who get paid.</p><p><strong>Responsible Disclosure: </strong><em>This vulnerability has been fully remediated by VFS Global. All testing was conducted within the scope and rules of the YesWeHack bug bounty program. This write-up is shared for educational purposes only.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97bd6b40dbb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Broken Access Control: How a Single Parameter Allowed Unauthorized Cloud Account Creation and…]]></title>
            <link>https://medium.com/@theankitsaini16/broken-access-control-how-a-single-parameter-allowed-unauthorized-cloud-account-creation-and-c346696c8379?source=rss-5471faa74dce------2</link>
            <guid isPermaLink="false">https://medium.com/p/c346696c8379</guid>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[broken-access-control]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ethcial-hacking]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Theankitsaini16]]></dc:creator>
            <pubDate>Wed, 13 May 2026 13:13:23 GMT</pubDate>
            <atom:updated>2026-05-13T13:13:23.420Z</atom:updated>
            <content:encoded><![CDATA[<h3>Broken Access Control: How a Single Parameter Allowed Unauthorized Cloud Account Creation and Persistent Access</h3><h3>Introduction</h3><p>While conducting security testing on a SaaS cloud platform, I came across an interesting authorization flaw that allowed any unauthenticated or low-privileged user to create and persistently control cloud-based AI user accounts simply by manipulating a single URL parameter.</p><p>This write-up walks through the discovery, exploitation, impact, and remediation of the vulnerability. To respect responsible disclosure practices, I have intentionally omitted the target domain and any identifying details about the affected platform.</p><h3>Background</h3><p>Modern SaaS platforms often rely on UUIDs (Universally Unique Identifiers) to manage user accounts, sessions, and resources. UUIDs are designed to be unpredictable, but they are <em>not</em> a security mechanism on their own. When applications treat client-supplied UUIDs as trusted input without verifying ownership or authorization, the door opens to a class of vulnerabilities known as <strong>Insecure Direct Object References (IDOR)</strong> and <strong>Broken Access Control</strong>, both of which appear in the OWASP Top 10.</p><p>This finding is a textbook example of what happens when server-side validation is missing.</p><h3>The Vulnerability</h3><p>The affected endpoint was responsible for provisioning new “S3 AI user” accounts on the platform. It accepted a single parameter via a GET request:</p><pre>GET /add_s3_ai_user.php?id=&lt;user_id&gt;</pre><p>Under normal conditions, the id parameter would contain a UUID generated by the server for the currently authenticated user. The expected behavior would be to validate that:</p><ol><li>The supplied identifier belongs to the authenticated session.</li><li>The identifier was legitimately issued by the server.</li><li>The requester is authorized to create or access the resource.</li></ol><p>In practice, none of these checks were performed. The backend trusted whatever value the client supplied and proceeded to create an account tied to that arbitrary identifier.</p><h3>Steps to Reproduce</h3><p>The exploitation flow was straightforward:</p><p><strong>Step 1 — Observe the legitimate request.</strong> After logging into a test account, I noticed the application calling the endpoint with a valid server-issued UUID:</p><pre>GET /add_s3_ai_user.php?id=4f8a2b1c-9d3e-4f7a-b2c1-8e6d9f0a1b2c</pre><p><strong>Step 2 — Tamper with the parameter.</strong> Using an intercepting proxy, I replaced the UUID with an arbitrary string of my own choosing:</p><pre>GET /add_s3_ai_user.php?id=12345</pre><p><strong>Step 3 — Forward the request.</strong> The server responded successfully, indicating that a new S3 AI user account had been provisioned under the attacker-supplied identifier.</p><p><strong>Step 4 — Reuse the identifier.</strong> Replaying requests using the same arbitrary string returned access to the previously created account. The identifier persisted server-side and could be reused indefinitely.</p><p>In other words: the attacker not only created accounts at will but also retained persistent control over them.</p><h3>Why This Matters</h3><p>At first glance, creating “an account with a random string as the ID” may sound harmless. However, the security implications run deeper:</p><ul><li><strong>Unauthorized resource provisioning.</strong> Any actor could spin up cloud-backed AI user accounts without legitimate authorization, potentially consuming backend resources, storage quotas, or compute capacity tied to the platform’s infrastructure.</li><li><strong>Persistent unauthorized access.</strong> Because the attacker chose the identifier, they could return at any time and continue using the account. Unlike server-generated UUIDs, an attacker-chosen string is fully known to them.</li><li><strong>Bypass of access control models.</strong> The endpoint completely sidestepped the platform’s intended authorization model. There was no ownership check, no session-to-resource binding, and no validation of identifier provenance.</li><li><strong>Potential pivoting.</strong> Depending on what the AI user account was linked to (storage buckets, API keys, model access, billing), an attacker could leverage these accounts to access associated services or escalate further.</li><li><strong>Abuse and denial-of-wallet risk.</strong> Automated mass account creation could be used to exhaust backend resources, inflate cloud costs, or stage further attacks such as spam, scraping, or model abuse.</li></ul><h3>Root Cause Analysis</h3><p>The fundamental issue was <strong>misplaced trust in client-supplied input</strong>. The application made three flawed assumptions:</p><ol><li>That the id parameter received from the client was always one previously issued by the server.</li><li>That UUID-like strings were inherently trustworthy.</li><li>That the act of possessing an identifier was equivalent to being authorized to use it.</li></ol><p>None of these assumptions hold in an adversarial environment. The server is the only entity that can authoritatively determine ownership and authorization, yet here that responsibility was effectively delegated to the client.</p><h3>Recommended Remediation</h3><p>To properly address this class of issue, the following measures are recommended:</p><ul><li><strong>Generate identifiers server-side only.</strong> Never accept account or resource identifiers from the client during creation flows. The server should mint them and return them to the client.</li><li><strong>Bind resources to authenticated sessions.</strong> Every account or resource should have a clear ownership relationship to an authenticated user, enforced at the database and application layer.</li><li><strong>Enforce authorization on every request.</strong> Before processing any action on a resource, verify that the authenticated user has the right to access or modify it.</li><li><strong>Reject unknown or attacker-shaped identifiers.</strong> If an incoming identifier does not match a server-issued record tied to the current session, the request should be denied outright.</li><li><strong>Add monitoring and rate limiting.</strong> Suspicious patterns such as rapid account creation, identifiers from unusual sources, or repeated access to non-owned resources should be detected and throttled.</li><li><strong>Audit related endpoints.</strong> Where one endpoint exhibits this pattern, others often do too. A broader review of the application’s authorization model is warranted.</li></ul><h3>Lessons Learned</h3><p>This finding is a reminder that authorization is not a feature to be sprinkled on later, it is a foundational property of every endpoint that touches user data or resources. UUIDs, random strings, and obscure parameters provide no real security on their own. What matters is whether the server <em>verifies</em> that the requester is allowed to do what they are asking to do.</p><p>Common takeaways from this case:</p><ul><li>Treat every client-supplied identifier as untrusted input.</li><li>Never assume that “the frontend will send the right value.”</li><li>Test creation flows as carefully as you test read or delete flows. They are equally sensitive.</li><li>Bug bounty hunters and security testers should always look at how identifiers flow through an application and whether ownership is enforced at each step.</li></ul><h3>Disclosure Timeline</h3><p>The issue was reported to the affected vendor through their responsible disclosure channel and has since been acknowledged. Details about the specific platform have been withheld in line with responsible disclosure principles.</p><h3>Closing Thoughts</h3><p>Broken access control remains one of the most impactful and most common vulnerability classes in modern web applications, and it continues to top the OWASP charts for good reason. Findings like this one demonstrate that the bar for exploitation is often very low: a single tampered parameter, no authentication bypass required, no exotic payloads, just a missing check on the server side.</p><p>If you are building cloud-facing applications, the single most valuable habit you can adopt is to ask, for every endpoint: <em>“How does the server know this user is allowed to do this?”</em> If you cannot answer that question with confidence, you have likely just found your next bug.</p><p><em>Thanks for reading. If you found this write-up useful, feel free to share it with others working in application security or web development. Stay curious, and always check the </em><em>id parameter.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c346696c8379" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Trusting the Client Side Put an Entire Wallet at Risk]]></title>
            <link>https://medium.com/@theankitsaini16/how-trusting-the-client-side-put-an-entire-wallet-at-risk-4a2e620fc241?source=rss-5471faa74dce------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a2e620fc241</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[burpsuite]]></category>
            <dc:creator><![CDATA[Theankitsaini16]]></dc:creator>
            <pubDate>Wed, 13 May 2026 12:20:52 GMT</pubDate>
            <atom:updated>2026-05-13T12:20:52.189Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A tale of an XSS find, a 2-rupee payment, and unlimited free money — all from one manipulated parameter.</em></p><p>The best bugs don’t always announce themselves. Sometimes you walk away from an endpoint convinced there’s nothing there and then you come back, spend 2 rupees, and walk away with unlimited money.</p><p>This is the story of how I found two separate vulnerabilities in the wallet functionality of a company I was testing one a reflected XSS capable of full account takeover, and the other a business logic flaw that let me add arbitrary amounts to my wallet balance with nothing more than a modified HTTP request.</p><h3>The first find: a reflected XSS hiding in plain sight</h3><p>I was brought in to assess the platform’s wallet and payment functionality. The endpoint was clean on first pass no obvious injection points, no leaking tokens, nothing that jumped out. I moved on.</p><p>On a second look, I caught something subtle: the amount parameter in the payment flow was reflected back in the page before the redirect to the payment gateway (Razorpay, PayPal, card processors). That reflection, left unsanitized, was an open door for cross-site scripting.</p><p><strong>What makes reflected XSS on a payment page dangerous:</strong> A user can be sent a crafted link to the payment initiation page. When they load it, the malicious script runs in their authenticated session — stealing cookies, hijacking the account, or silently initiating transactions on their behalf.</p><p>I documented the XSS, wrote it up, and submitted the report to the development team. That vulnerability alone warranted a fix. But there was more to find.</p><h3>The resource problem — and the 2-rupee experiment</h3><p>The admin had provided me with a limited test budget — just a few tokens in Indian rupees. Not enough to fully exercise all the wallet and payment flows I wanted to examine. So instead of letting that stop me, I decided to go deep on the minimum viable transaction: a 2-rupee payment.</p><p>I wanted to understand, at the request level, exactly what happened after a payment succeeded. What did Razorpay send back? What did the server do with it? What could be influenced from the outside?</p><p><em>“The server trusted the client-side amount value without proper validation.”</em></p><p>I made the payment while watching every outbound and inbound request in my proxy. After Razorpay confirmed the transaction, a series of callbacks and webhook-style requests came through. Among them was one that caught my eye immediately.</p><h3>The request that changed everything</h3><p>The post-payment request contained several parameters that the server appeared to use to finalize the wallet top-up:</p><p>// Legitimate post-payment callback (abbreviated) <br>POST /api/wallet/confirm { “orderId”: “ord_Kx72mQ9…”, “id”:“pay_Rz90nL4…”, “amount”: 2 // ← in rupees }</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0xNWiAqjy8g9-uZ4GsmLjA.png" /></figure><p>I sent this request to Repeater. Then I changed amount from 2 to a much higher number and forwarded the request.</p><p>The server accepted it. My wallet balance updated immediately to reflect the manipulated value.</p><p>I had just added money to my wallet that I never paid for — by changing a single number in a request.</p><p>Attack flow — step by step:</p><p>1.Initiate a legitimate payment — minimum amount ₹2 via Razorpay</p><p>2.Razorpay processes payment and returns a success callback with orderId, id, and amount</p><p>3.Intercept that callback in a proxy before it reaches the server</p><p>4.Modify amount from 2 to any desired value — e.g. 10000</p><p>5.Server trusts the client-supplied amount, credits wallet without cross-checking against actual transaction record</p><h3>Why this works — and why it shouldn’t</h3><p>The root cause is a server that trusts the client. When a payment is completed, the correct architecture is for the server to verify the transaction details directly with the payment gateway — not to accept whatever the client sends back.</p><p>Vulnerable pattern</p><p>Server reads amount from the client&#39;s callback request and credits the wallet with that value</p><p>Correct pattern</p><p>Server uses orderId to query Razorpay&#39;s API directly and retrieves the verified, authoritative amount from the gateway</p><p>Payment gateways like Razorpay expose server-to-server APIs specifically for this purpose. After a transaction, the backend should fetch the order details using the order ID — the amount, currency, and status — from Razorpay directly, over a server-side request authenticated with the secret API key. Anything the client sends should be treated as untrusted input.</p><h3>The broader lesson</h3><p>This vulnerability class isn’t rare or exotic. It shows up anywhere a server delegates trust to the client for a value that should be authoritative — prices in e-commerce checkouts, quantities in order forms, discount amounts in coupon flows, and, as here, wallet top-up amounts.</p><p>The fix isn’t complex. The principle is simple: anything a user can see, a user can modify. If a value has financial consequence, it must be verified from a source the server controls.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a2e620fc241" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>