<?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 Philip Voß on Medium]]></title>
        <description><![CDATA[Stories by Philip Voß on Medium]]></description>
        <link>https://medium.com/@philip.barwi?source=rss-cb5e698e3619------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*5s1X6SRgBIUHVCDBE6TRAw.jpeg</url>
            <title>Stories by Philip Voß on Medium</title>
            <link>https://medium.com/@philip.barwi?source=rss-cb5e698e3619------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 02:09:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@philip.barwi/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[Bypassing File Upload Restrictions via Presigned URLs]]></title>
            <link>https://medium.com/@philip.barwi/bypassing-file-upload-restrictions-via-presigned-urls-b40b4632d1fc?source=rss-cb5e698e3619------2</link>
            <guid isPermaLink="false">https://medium.com/p/b40b4632d1fc</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Philip Voß]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 12:22:57 GMT</pubDate>
            <atom:updated>2024-08-16T12:23:15.394Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Modern Web Applications hosted on AWS often use a combination of S3 for Client-Side Code and API-Gateway + AWS Lambda.</p><p>When new requirements arise, this setup might be challenging. For example, users at some point might need to be able to upload files. One of the official <a href="https://aws.amazon.com/de/blogs/compute/patterns-for-building-an-api-to-upload-files-to-amazon-s3/">solution patterns</a> provided by AWS is the generation of a pre-signed URL and a client-side upload to the AWS S3 Bucket. This will bypass the 10mb limit, which API Gateway has when using the S3 proxy integration. Also, this often is the most simple solution.</p><p>Basically it says — generate a pre-signed URL as an API Endpoint and let the client directly upload a file to S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q7Nm9MzybBnmNVp9.png" /></figure><p>Giving the client the pre-signed URL opens the door to bypass any client-side defined file type and size limits (it allows uploads of up to 5TB).</p><h3>Exploitation</h3><p>When analyzing the upload functionality of an application, it is therefore worth looking into API endpoints that respond with something like this:</p><blockquote><a href="https://s3.amazonaws.com/finance-department-bucket/2022/tax-certificate.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIA3SGQVQG7FGA6KKA6%2F20221104%2Fus-east-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20221104T140227Z&amp;X-Amz-Expires=3600&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Signature=b228dbec8c1008c80c162e1210e4503dceead1e4d4751b4d9787314fd6da4d55">https://s3.amazonaws.com/finance-department-bucket/2022/tax-certificate.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIA3SGQVQG7FGA6KKA6%2F20221104%2Fus-east-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20221104T140227Z&amp;X-Amz-Expires=3600&amp;X-Amz-SignedHeaders=host&amp;X-Amz-Signature=b228dbec8c1008c80c162e1210e4503dceead1e4d4751b4d9787314fd6da4d55</a></blockquote><p>I often stumbled upon unauthenticated API functions that would happily return a pre-signed URL for file uploads.</p><p>Using the presigned URL for exploitation is fairly easy — all that needs to be done is a POST to the URL with the file as data. In Python it looks like this:</p><pre>with open(file_path) as file:<br>  requests.put(presigned_url, data=file)</pre><p>Now, after the file was uploaded successfully, you can (in case the S3 Bucket allows public read) access your file based on the path of the presigned link.</p><h3>Risks</h3><p>The risks vary and typically include the normal “<a href="https://cwe.mitre.org/data/definitions/434.html">arbitrary file upload</a>” common weakness. Furthermure high cost can be induced as <a href="https://aws.amazon.com/de/s3/pricing/">S3 Pricing</a> is based on the stored volume (and requests). If the S3 also has an alternate domain name, like the one of your corporation, it could be used for malware distribution.</p><h3>Mitigation</h3><p>Use the last pattern <a href="https://aws.amazon.com/de/blogs/compute/patterns-for-building-an-api-to-upload-files-to-amazon-s3/">provided by AWS</a>. It is more complex but allows for a custom authorization lambda to be used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GNAAESpal1JTNZmNLSHUaA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b40b4632d1fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are fraudsters executing credential stuffing attacks on your website?]]></title>
            <link>https://medium.com/@philip.barwi/are-fraudsters-executing-credential-stuffing-attacks-on-your-website-3ce89eb457cf?source=rss-cb5e698e3619------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ce89eb457cf</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[credential-stuffing]]></category>
            <category><![CDATA[owasp]]></category>
            <dc:creator><![CDATA[Philip Voß]]></dc:creator>
            <pubDate>Sun, 01 Mar 2020 11:59:06 GMT</pubDate>
            <atom:updated>2020-03-01T11:59:06.211Z</atom:updated>
            <content:encoded><![CDATA[<h3>What are credential stuffing attacks?</h3><p>So… what are credential stuffing attacks and why should you care about them? Credential stuffing attacks fall under the A2 “Broken Authentication” security risk (<a href="https://owasp.org/www-project-top-ten/OWASP_Top_Ten_2017/Top_10-2017_A2-Broken_Authentication">OWASP Top Ten 2017</a>). Broken authentication is the second most important threat vector according to the OWASP Top Ten 2017, following the leader “Injection”.</p><blockquote>Credential stuffing is the automated injection of breached username/password pairs in order to fraudulently gain access to user accounts.<br>- <a href="https://owasp.org/www-community/attacks/Credential_stuffing">OWASP</a></blockquote><p>The risk behind it is pretty obvious. Fraudsters compromise your user’s credentials and exploit them to monetize the accounts — depending on the business model of your site. Often the verified accounts are sold on the darkweb and used by others to commit fraudulent purchases unbeknownst to your real users. In the end, for your business, this could mean diminished bad reputation, disgruntled customers and even possibly a direct financial impact (delivery of unpaid products, ..)</p><p>A recent example would be the disney+ service, where its users‘ credentials were compromised just a few days after the service went live (<a href="https://www.zdnet.com/article/thousands-of-hacked-disney-accounts-are-already-for-sale-on-hacking-forums/">ZDNet news</a>).</p><h3>Are fraudsters trying to exploit my customers’ accounts?</h3><p>Short answer: Probably yes.</p><p>In order to find out if there are attackers actively exploiting your website and if so, how many? It is a prerequisite that you write appropriate metrics and index your logs (into an elk cluster or splunk, for example) in order to be able to analyze the activities accordingly (if you’re not doing this already, you should have a look into <a href="https://owasp.org/www-project-top-ten/OWASP_Top_Ten_2017/Top_10-2017_A10-Insufficient_Logging%252526Monitoring">OWASP A10 — Insufficient Logging &amp; Monitoring</a>).</p><p>Before searching for credential stuffing attacks in your metrics, you will have to know what exactly you are searching for. Basically, we can categorize these attacks into two categories:</p><h4>“Obvious attacks”</h4><p>Obvious attacks are… well, obvious! What i mean by that is, there are attackers that don’t really mind being detected or using any “stealth” techniques. Often they try multiple thousands of guesses in a short amount of time and have a big impact on your system metrics or even your system’s availability:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*fB69XBlmF81hpuevPLrBmg.png" /></figure><p>You should be able to detect them by filtering for the following in your logs:</p><ul><li>Filter for any “POST” “/login” request</li><li>Filter for any “result=error” attempt</li></ul><p>Or just having a look into your login metrics. These kinds of attacks will normally — as shown in the illustration above — have a huge impact on your metrics. If you want to dive deeper into a specific attack, you can start filtering by having a look at unusual HTTP Headers, such as country or ISP, depending on the data you have available.</p><h4>“Under the radar attacks”</h4><p>These are the less obvious attacks, but may happen on a daily basis, without you ever noticing it. There are simple ways to get some basic insights in how/if attackers are trying to exploit your users that way and more sophisticated approaches. Depending on the resources you are willing to invest, you might be able to detect more/fewer attackers.</p><p><strong>A basic approach<br></strong>Often there are stealthy credential stuffing attacks, which are not distributed, ergo from a single IP address. Here is a “pseudo” query you could adapt, depending on the query language in your logsearch engine:</p><p><em>Must:</em></p><ul><li><em>time-range: 1d</em></li><li><em>http_method: POST</em></li><li><em>url_path: /login</em></li><li>COUNT(result=failed &gt; 5)</li></ul><p><em>Must Not:</em></p><ul><li><em>ip_address: your company’s IP </em>(Note: You should still have a look if there is something fishy coming from your own IP addresses, but for the task now, we can exclude these)</li></ul><p><em>Sort By:</em></p><ul><li><em>COUNT(ip_address)</em></li></ul><p>After adopting this query into your logsearch language, you will have a list of (optionally sorted by the most actions per IP address) login attempts, where the user failed to login for at least 5 times over a day.</p><p><strong>More sophisticated approaches</strong></p><p>If you are willing to have a deeper look into what attackers might be doing on your system regarding credential stuffing, you can write a small application, looking into the users behaviour and filtering for unusual behaviour. There are machine learning approches (which normally require training data) or you could start off by a rule based approach.</p><p>Interesting rules would be:</p><ul><li>Has the user changed his email/password combination with every retry (normally users either have a typo in their email or misspelled their password, but they wouldn’t change both) <br><em>Note: To compare these you will only need the first few chars of the hashed email &amp; password. Please don’t log these in cleartext and make sure their access rights are set correctly</em></li><li>What is the time timeout between the login attempts (stealthy attackers often use timeouts which don’t vary too much between login attempts)</li></ul><h3>Conclusion</h3><p>The initial question was “Are fraudsters executing credential stuffing attacks on your website?”. The short answer was: probably yes.</p><p>With the steps mentioned above you can have a look into your own system and verify if there are attackers trying to compromise your users.</p><p>Note: If you don’t find anything, this doesn’t necessarily mean there’s nobody there.</p><h3>Thanks</h3><p>Thanks to <a href="https://twitter.com/Maconando4">Maconando</a> for proofreading and adding helpful suggestions!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GV5smYeCtvx3lPW9-yl1SQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ce89eb457cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>