<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kunsang Moktan</title>
    <description>The latest articles on DEV Community by Kunsang Moktan (@jojo_kunsang).</description>
    <link>https://dev.to/jojo_kunsang</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3660351%2F62e00f29-c443-45c9-a92a-6b170f5bce48.jpg</url>
      <title>DEV Community: Kunsang Moktan</title>
      <link>https://dev.to/jojo_kunsang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jojo_kunsang"/>
    <language>en</language>
    <item>
      <title>After 5 Years of Coding, This Is What Actually Matters</title>
      <dc:creator>Kunsang Moktan</dc:creator>
      <pubDate>Sun, 22 Feb 2026 10:09:03 +0000</pubDate>
      <link>https://dev.to/jojo_kunsang/after-5-years-of-coding-this-is-what-actually-matters-24ee</link>
      <guid>https://dev.to/jojo_kunsang/after-5-years-of-coding-this-is-what-actually-matters-24ee</guid>
      <description>&lt;p&gt;After nearly &lt;strong&gt;five years of coding&lt;/strong&gt; and &lt;strong&gt;two years of real-world production experience&lt;/strong&gt;, one thing has become very clear to me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The programming language or tech stack matters far less than how you think and write your logic.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What truly makes a difference is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How you structure your logic&lt;/li&gt;
&lt;li&gt;How you handle edge cases&lt;/li&gt;
&lt;li&gt;How you debug failures&lt;/li&gt;
&lt;li&gt;How you manage exceptions&lt;/li&gt;
&lt;li&gt;And how you implement meaningful logging for production systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The endless debate about which language or framework is “better” will never stop. But in real-world engineering, &lt;strong&gt;maintainable, readable, scalable, and production-ready code&lt;/strong&gt; matters far more than the stack itself.&lt;/p&gt;

&lt;p&gt;No programming language is inherently superior to another.&lt;br&gt;
Each one exists for a reason and serves a specific purpose. What matters is &lt;strong&gt;choosing the right tool based on the problem you’re trying to solve&lt;/strong&gt;, not personal preference.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;A Simple (and Slightly Sarcastic) Analogy&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Imagine you’re going to the market to buy a &lt;strong&gt;water bottle&lt;/strong&gt;.&lt;br&gt;
You need something portable, easy to carry, and suitable for drinking. The bottle costs &lt;strong&gt;₹100&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Right next to it, there’s a &lt;strong&gt;bucket&lt;/strong&gt; costing &lt;strong&gt;₹120&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now, you wouldn’t say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“I’ll take the bucket because it can store more water.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Why?&lt;br&gt;
Because &lt;strong&gt;storage capacity isn’t your use case&lt;/strong&gt;. You can’t comfortably drink from it or carry it around.&lt;/p&gt;

&lt;p&gt;The same logic applies to software development.&lt;/p&gt;

&lt;p&gt;Just because a framework is powerful or popular doesn’t mean it’s the right choice for every project. For example, building a website for a client whose top priority is &lt;strong&gt;SEO&lt;/strong&gt; might not be best served by a client-side heavy React application. In that case, &lt;strong&gt;WordPress, SSR, or another SEO-friendly stack&lt;/strong&gt; could be a far better fit.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;The Real Point&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Choosing a tech stack should be driven by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project requirements&lt;/li&gt;
&lt;li&gt;Business goals&lt;/li&gt;
&lt;li&gt;Scalability needs&lt;/li&gt;
&lt;li&gt;Team expertise&lt;/li&gt;
&lt;li&gt;Long-term maintainability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Personal bias&lt;/li&gt;
&lt;li&gt;Trend popularity&lt;/li&gt;
&lt;li&gt;Or attachment to a favorite framework&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can’t—and shouldn’t—build every project using the same stack (like MERN) just because you like it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Good engineers don’t worship tools. They choose them wisely.&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Lessons Learned from the React2Shell Vulnerability (December 3, 2025)</title>
      <dc:creator>Kunsang Moktan</dc:creator>
      <pubDate>Sat, 13 Dec 2025 18:17:53 +0000</pubDate>
      <link>https://dev.to/jojo_kunsang/lessons-learned-from-the-react2shell-vulnerability-december-3-2025-2ieo</link>
      <guid>https://dev.to/jojo_kunsang/lessons-learned-from-the-react2shell-vulnerability-december-3-2025-2ieo</guid>
      <description>&lt;p&gt;On &lt;strong&gt;December 3, 2025&lt;/strong&gt;, the &lt;em&gt;React2Shell&lt;/em&gt; vulnerability was disclosed, exposing a serious remote code execution risk in certain React and Next.js setups. Unfortunately, this wasn’t just a headline for me—I experienced it firsthand on a client’s production server.&lt;/p&gt;

&lt;p&gt;This post documents &lt;strong&gt;what happened&lt;/strong&gt;, &lt;strong&gt;how the compromise was detected&lt;/strong&gt;, and &lt;strong&gt;the most important lessons I learned&lt;/strong&gt; as a developer.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Incident
&lt;/h2&gt;

&lt;p&gt;One of my client’s servers was running &lt;strong&gt;Next.js 16&lt;/strong&gt;, which was affected by the vulnerability.&lt;/p&gt;

&lt;p&gt;When I SSH’d into the server to deploy routine changes, I immediately noticed something was wrong:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;node&lt;/code&gt; commands were failing unexpectedly&lt;/li&gt;
&lt;li&gt;Deployment scripts wouldn’t execute&lt;/li&gt;
&lt;li&gt;The server felt unusually slow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Checking system resources revealed the real issue.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Found
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CPU usage was constantly above 100%&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;A suspicious process named &lt;strong&gt;&lt;code&gt;xmirg&lt;/code&gt;&lt;/strong&gt; was consuming &lt;strong&gt;~106% CPU&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Several &lt;strong&gt;unauthorized &lt;code&gt;.sh&lt;/code&gt; files&lt;/strong&gt; and a &lt;strong&gt;ZIP archive&lt;/strong&gt; appeared in the project’s root directory&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Attempts to kill the &lt;code&gt;xmirg&lt;/code&gt; process were unsuccessful—it &lt;strong&gt;restarted automatically&lt;/strong&gt; every time.&lt;/p&gt;

&lt;p&gt;After deeper inspection, I discovered the malware had registered itself as a system service:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;system.update.update.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The name was deliberately chosen to resemble a legitimate system update service, making it easy to overlook.&lt;/p&gt;

&lt;p&gt;At this point, it was clear that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The server had been &lt;strong&gt;fully compromised&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;It had been turned into a &lt;strong&gt;cryptocurrency mining machine&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Application performance had degraded significantly&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Containment &amp;amp; Resolution
&lt;/h2&gt;

&lt;p&gt;Fortunately, the &lt;strong&gt;cloud service provider detected the malicious activity&lt;/strong&gt; and temporarily limited the server’s CPU usage.&lt;/p&gt;

&lt;p&gt;However, because the compromise occurred at the system level:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cleaning the server was &lt;strong&gt;not safe&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Trust in the system was &lt;strong&gt;irreversibly lost&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The only correct action was to delete the server entirely and provision a new one from scratch.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Key Lessons Learned
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Never Deploy Applications as the Root User&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This was the most critical mistake.&lt;/p&gt;

&lt;p&gt;The application was deployed and running with &lt;strong&gt;root privileges&lt;/strong&gt;, which allowed the attacker to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install system-level services&lt;/li&gt;
&lt;li&gt;Execute arbitrary shell scripts&lt;/li&gt;
&lt;li&gt;Persist even after killing processes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Best practice:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a &lt;strong&gt;dedicated non-root user&lt;/strong&gt; for deployments&lt;/li&gt;
&lt;li&gt;Grant only the minimum permissions required&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;sudo&lt;/code&gt; explicitly when necessary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This alone can significantly limit the impact of an RCE vulnerability.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;2. Firewalls Alone Are Not Enough&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The attack &lt;strong&gt;did not bypass the firewall&lt;/strong&gt;—it came through &lt;strong&gt;HTTPS (port 443)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This highlights an important truth:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If your application layer is vulnerable, network-level protection is not sufficient.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Security must include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dependency monitoring&lt;/li&gt;
&lt;li&gt;Timely patching&lt;/li&gt;
&lt;li&gt;Least-privilege execution&lt;/li&gt;
&lt;li&gt;Runtime behavior monitoring&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Vulnerabilities like &lt;strong&gt;React2Shell&lt;/strong&gt; are a reminder that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modern frameworks are powerful—but not immune&lt;/li&gt;
&lt;li&gt;One misconfiguration can turn a production server into a liability&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Server hardening is just as important as secure code&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This incident changed how I approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deployment permissions&lt;/li&gt;
&lt;li&gt;Server access control&lt;/li&gt;
&lt;li&gt;Incident response&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>security</category>
      <category>learning</category>
      <category>nextjs</category>
      <category>react</category>
    </item>
  </channel>
</rss>
