<?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: Md Abdus Salam Suhag</title>
    <description>The latest articles on DEV Community by Md Abdus Salam Suhag (@suhag).</description>
    <link>https://dev.to/suhag</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4233127%2F21ef4e20-94be-40d2-8d4f-9ab5533c7b18.jpg</url>
      <title>DEV Community: Md Abdus Salam Suhag</title>
      <link>https://dev.to/suhag</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/suhag"/>
    <language>en</language>
    <item>
      <title>A suspicious Git merge almost became a security incident.</title>
      <dc:creator>Md Abdus Salam Suhag</dc:creator>
      <pubDate>Thu, 12 Nov 2026 14:22:43 +0000</pubDate>
      <link>https://dev.to/suhag/a-suspicious-git-merge-almost-became-a-security-incident-1hek</link>
      <guid>https://dev.to/suhag/a-suspicious-git-merge-almost-became-a-security-incident-1hek</guid>
      <description>&lt;p&gt;A few days ago, I was working on a project and preparing to push some newly developed features to our organization's GitHub repository.&lt;/p&gt;

&lt;p&gt;But Git refused to push.&lt;/p&gt;

&lt;p&gt;It reported that my local branch and the remote branch were not in sync.&lt;/p&gt;

&lt;p&gt;That was strange because I was the only developer actively working on that project at the time. I checked GitHub, compared the latest commits, and everything looked identical. No new commits, no visible code changes.&lt;/p&gt;

&lt;p&gt;I initially thought it was just a Git issue.&lt;/p&gt;

&lt;p&gt;So, I pulled the remote changes.&lt;/p&gt;

&lt;p&gt;That's when I noticed something unusual: Git had entered a merge state, even though my editor wasn't showing any meaningful code changes.&lt;/p&gt;

&lt;p&gt;I was about to complete the merge when one question stopped me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why am I merging code when I can't see any actual changes?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead of proceeding, I decided to investigate further.&lt;/p&gt;

&lt;p&gt;After carefully inspecting the changes, I discovered some suspicious, heavily obfuscated code hidden among the project files.&lt;/p&gt;

&lt;p&gt;I had seen similar code patterns while exploring an open-source repository a few days earlier. That immediately raised a red flag.&lt;/p&gt;

&lt;p&gt;I suspected it was malicious code.&lt;/p&gt;

&lt;p&gt;Without taking any further risks, I reverted the suspicious changes and rotated the relevant secrets and credentials as an additional precaution.&lt;/p&gt;

&lt;p&gt;Fortunately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I hadn't pushed anything to the remote repository.&lt;/li&gt;
&lt;li&gt;No CI/CD pipeline had been triggered.&lt;/li&gt;
&lt;li&gt;No malicious code had reached production.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;But the bigger concern came afterward.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When I informed the other team members, I learned that some of them had already been affected.&lt;/p&gt;

&lt;p&gt;After investigating the attack pattern in more detail, I understood how dangerous this type of compromise could be.&lt;/p&gt;

&lt;p&gt;The general attack mechanism works like this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Malicious code is injected into a repository, often in an obfuscated form that makes it difficult to notice during normal code reviews.&lt;/li&gt;
&lt;li&gt;When someone clones or executes the affected project, the malicious code can run and attempt to collect sensitive credentials from their machine.&lt;/li&gt;
&lt;li&gt;If GitHub access tokens are compromised, attackers may use them to access other repositories the victim can reach.&lt;/li&gt;
&lt;li&gt;They can inject similar malicious code into those repositories, potentially spreading the attack to more developers and projects.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This creates a dangerous supply-chain risk. A developer's compromised credentials can become an entry point into multiple repositories and teams.&lt;/p&gt;

&lt;p&gt;I cannot confirm the exact initial entry point in our case, but repository access through other collaborators is one possibility.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A few lessons I took from this experience:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Never blindly trust a Git pull or merge, even when you are the only active developer.&lt;/li&gt;
&lt;li&gt;Carefully inspect unexpected changes before merging.&lt;/li&gt;
&lt;li&gt;Pay attention to obfuscated or unfamiliar code.&lt;/li&gt;
&lt;li&gt;Keep GitHub tokens and other secrets protected, with minimum required permissions.&lt;/li&gt;
&lt;li&gt;Regularly review repository access and audit unexpected commits.&lt;/li&gt;
&lt;li&gt;Treat suspicious repository changes as potential security incidents, not just Git issues.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sometimes, the most important security decision isn't writing more code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's knowing when to stop and investigate before running or merging code you don't fully trust.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>githubsecurity</category>
      <category>softwaredevelopment</category>
      <category>supplychainsecurity</category>
    </item>
  </channel>
</rss>
