<?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 Atharv Kulkarni on Medium]]></title>
        <description><![CDATA[Stories by Atharv Kulkarni on Medium]]></description>
        <link>https://medium.com/@atharvvk853?source=rss-470c316fe2cf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*9Z7wjt3Q8Q6W-EbA</url>
            <title>Stories by Atharv Kulkarni on Medium</title>
            <link>https://medium.com/@atharvvk853?source=rss-470c316fe2cf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 22:27:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@atharvvk853/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[VESSEL (Vulnerability Evaluation and Secure Software Engineering Layer)]]></title>
            <link>https://medium.com/@atharvvk853/vessel-vulnerability-evaluation-and-secure-software-engineering-layer-78250e113b8a?source=rss-470c316fe2cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/78250e113b8a</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Atharv Kulkarni]]></dc:creator>
            <pubDate>Tue, 24 Feb 2026 18:45:26 GMT</pubDate>
            <atom:updated>2026-02-24T18:46:04.135Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I crammed a local ML model into Chrome to stop Devs from leaking data.</h3><p>Let’s talk about the elephant in the DevSecOps room. We spend millions on Web Application Firewalls (WAFs), Cloud Security Posture Management (CSPM), and complex CI/CD scanning tools. But historically, how do the biggest data breaches actually happen?</p><p>Look at the data. Uber got hacked because a developer left credentials in a PowerShell script. Samsung engineers famously leaked proprietary source code by pasting it into ChatGPT to find a bug. Government contractors accidentally drop Aadhaar IDs or Social Security Numbers into public Jira tickets because they are rushing to close a sprint.</p><p>The security perimeter isn’t the cloud anymore. The perimeter is the human, and the biggest vulnerability in your entire enterprise is the web browser. By the time a packet containing a plaintext password or an AWS_ACCESS_KEY hits your corporate proxy, the game is already over.</p><p>I got tired of watching developers (and myself) make these mistakes. I needed a solution that lived <em>inside</em> the browser, catching the errors at the keystroke level before the HTTP request even fired.</p><p>So, I built <strong>VESSEL</strong> (Vulnerability Evaluation and Secure Software Engineering Layer).</p><blockquote>While researching security, I came across an amazing new tool by Carnegie Mellon University called <a href="https://sei.cmu.edu/news/vessel-tool-enhances-container-reproducibility-and-security/">Vessel</a>, which secures Docker containers from injected malware. It clicked instantly saw that and directly decided to keep same name as it was solving almost same problem.</blockquote><p>It is a zero-latency, browser-native DevSecOps engine. Here is the deep technical breakdown of how I built it, the tech stack I used, how I trained the ML model, and the absolute nightmare of bugs I had to squash to make it work.</p><h3>The Tech Stack: Fighting the Browser (In Deep)</h3><p>Building a security tool inside Chrome means you are playing by Google’s rules, specifically the Manifest V3 (MV3) architecture. MV3 killed persistent background pages, meaning my app had to be entirely event-driven.</p><p>Here is the exact stack I settled on to make this possible without destroying the user’s RAM:</p><ul><li><strong>The Interceptors (DOM Layer):</strong> Vanilla JavaScript content scripts (content-ai-interceptor.js, content-spec-watcher.js, content-paste-redactor.js). I explicitly banned React, Vue, or Tailwind from the content scripts. Injecting a massive framework into every single webpage a user visits is an engineering crime. I used raw DOM manipulation (document.createDocumentFragment, MutationObserver) for absolute zero-latency execution.</li><li><strong>The Brain (Service Worker Layer):</strong> Chrome Manifest V3 Service Worker (background.js). Since MV3 aggressively kills background scripts to save memory, I had to implement a state-hydration architecture to keep the extension alive and listening without draining the laptop&#39;s battery.</li><li><strong>The Machine Learning Engine:</strong> onnxruntime-web. This runs a WebAssembly (WASM) binary directly in the browser environment. I used a quantized (INT8) NLP model to keep the extension&#39;s total footprint under 5MB.</li><li><strong>The Cloud Remediation Engine:</strong> Google Gemini 1.5 Flash API. I chose Flash specifically because of its massive context window and sub-second Time-to-First-Token (TTFT). When you are blocking a developer’s UI, you cannot wait 5 seconds for an LLM to think.</li><li><strong>Bundler &amp; Build Tools:</strong> Vite and Rollup. Getting onnxruntime-web WASM files to bundle correctly for a Chrome Extension is notoriously difficult because of Chrome&#39;s strict Content Security Policies (CSP). I had to write custom Rollup configurations to correctly copy the .wasm binaries into the dist folder and declare them in the web_accessible_resources array of the manifest.json.</li><li><strong>Permissions:</strong> I kept it as tight as possible. activeTab, scripting, clipboardRead, clipboardWrite, and storage.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qt61rtkl6PfnNfXpS7A5Mg.png" /></figure><h3>Feature 1: The Paste Shield &amp; Data Loss Prevention</h3><p>My first goal was stopping the clipboard leaks. If you paste an AWS key into ChatGPT, I want to block it.</p><p>At first, I used Regex. Big mistake. Regex is dumb. It started blocking randomly generated database UUIDs and Git commit hashes because they “looked” like secrets.</p><p>I had to build a multi-stage heuristics pipeline. For Indian Aadhaar cards, PAN cards, or Credit Cards, catching a 16-digit string isn’t enough. I wrote a local JavaScript implementation of the <strong>Luhn Algorithm (Modulus 10)</strong>. When you hit Ctrl+V, VESSEL intercepts the paste event, grabs the clipboard payload, and runs the cryptographic checksum in about 2 milliseconds. If the math fails, it lets the paste happen. If the math passes, it triggers redactor.js to mask the entropy (AKIA****************) while keeping the rest of your text intact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CYrtzEe7LtvunGhtvYfsNA.png" /></figure><h3>Feature 2: The Spec Architect &amp; The Local ML Model</h3><p>This is where the project went from a “cool script” to a “massive engineering headache.”</p><p>I wanted VESSEL to read what a developer is typing into a Jira ticket (e.g., <em>“We will upload photos directly to a public S3 bucket”</em>) and instantly flag the architectural flaw. But I absolutely refused to send every single keystroke to a cloud API. That’s a massive privacy violation and would introduce terrible UI lag.</p><p>I needed a local Machine Learning model.</p><h4>How the ML Model is Trained for Words</h4><p>I built a custom, highly-distilled Natural Language Processing (NLP) model and exported it to .onnx.</p><p>Here is how I trained it:</p><ol><li><strong>The Dataset:</strong> I scraped thousands of open-source GitHub issues, PRDs, and vulnerable code descriptions, tagging them into categories: Auth, Database, Storage, API, and Injection.</li><li><strong>Vectorization (The Words):</strong> Instead of a massive, RAM-heavy LLM, I used a lightweight word-embedding/TF-IDF approach. The model is specifically trained to look for high-risk technical vectors. Words like &quot;JWT&quot;, &quot;bcrypt&quot;, and &quot;login&quot; fire up the Auth neurons. Words like &quot;upload&quot;, &quot;S3&quot;, &quot;PDF&quot;, and &quot;public&quot; fire up the Storage neurons.</li><li><strong>The Tensor Math:</strong> Inside my Chrome service worker, when you type, the JS debounces your text and feeds it into the ort.Tensor. The ONNX WASM binary multiplies the keyword weights against its neural net.</li><li><strong>The Trigger:</strong> If the tensor outputs a confidence score of &gt; 0.85 for a vulnerable architecture, my script injects a pulsing red badge into the DOM right over your Jira text box.</li></ol><p>All of this happens locally, in milliseconds, using zero internet bandwidth.</p><h3>Feature 3: The Gemini API Key (Why it matters)</h3><p>If the local ONNX model is so smart, why do I need an API key?</p><p>Because the local .onnx model is a <strong>Classifier</strong>, not a <strong>Generator</strong>. It is just a tiny, quantized matrix of numbers that says, <em>&quot;Hey, this text looks like a dangerously configured AWS bucket.&quot;</em> It does not know how to write the code to fix it.</p><p>This is the core of VESSEL’s Hybrid Architecture:</p><ul><li><strong>The Trigger (Local ONNX):</strong> Zero latency, zero cost, absolute privacy.</li><li><strong>The Brain (Gemini API):</strong> Heavyweight remediation.</li></ul><p>When the user clicks that red badge, the extension finally makes a network call. It takes the specific Jira text, wraps it in a massive system prompt (&quot;You are a Senior Cloud Architect. Fix this exact spec...&quot;), and fires it to the Gemini API. Gemini 1.5 Flash processes the context and returns highly specific, actionable DevSecOps rules (e.g., <em>&quot;Implement Pre-Signed URLs, enforce HTTPS, validate MIME types&quot;</em>).</p><p>Without the API key, VESSEL is just an alarm bell. With the Gemini API, it becomes an automated Senior Engineer sitting on your shoulder.</p><h3>The Absolute Nightmare Bugs I Faced</h3><p>I want to be transparent. Building this almost made me rage-quit.</p><p><strong>1. React Synthetic Events vs. The DOM</strong> To block Prompt Injections on ChatGPT, I tried to attach an event listener to the ‘Send’ button. It failed miserably. Frameworks like React use Synthetic Events that bypass standard DOM bubbling. My extension was firing too late, and the malicious payloads were leaking through.</p><ul><li><em>The Fix:</em> I had to hijack the keydown and click events during the <strong>Capture Phase</strong> using window.addEventListener(&#39;keydown&#39;, interceptor, true). Once my heuristics flagged a hidden [SYSTEM OVERRIDE] div, I used event.stopImmediatePropagation() to literally freeze the website&#39;s JavaScript, rip out the bad HTML, and release the event.</li></ul><p><strong>2. The Infinite API Loop</strong> When Gemini returned the security suggestions, I injected the text into the Jira box. But guess what? Jira listens for text changes. So my content script saw the “new” text, sent it to the ONNX model, triggered the badge, called Gemini again, and pasted <em>more</em> text. I accidentally built an infinite loop that crashed my browser tab and burned through my API quota in 30 seconds.</p><ul><li><em>The Fix:</em> I had to build a strict state-management lock (isVesselMutating = true) before dispatching the synthetic input events back to the React DOM.</li></ul><h3>Conclusion: The Browser Engine is Incomplete</h3><p>Building VESSEL proved something to me. I shouldn’t have to write custom DOM traversal algorithms and compile WASM binaries just to stop a developer from pasting a database password into a public text box.</p><p>We desperately need a native navigator.security API. Browsers need built-in tensor computation to scan DOM mutations and outgoing events natively. Until Google or Apple fixes the browser engine itself, tools like VESSEL aren&#39;t just a hackathon project—they are the only way to actually secure the software supply chain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78250e113b8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Distributed Version Control System from Scratch]]></title>
            <link>https://medium.com/@atharvvk853/building-a-distributed-version-control-system-from-scratch-ad4f5082614a?source=rss-470c316fe2cf------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad4f5082614a</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[gitops]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Atharv Kulkarni]]></dc:creator>
            <pubDate>Sat, 17 Jan 2026 06:20:04 GMT</pubDate>
            <atom:updated>2026-01-17T06:20:04.375Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pulling Git Out of the Black Box</h3><p>Most developers use Git daily without ever questioning what’s happening beneath git add, git commit, or git push. I was one of them—until I decided to build a <strong>Git-inspired distributed version control system</strong> from scratch.</p><p>This project isn’t a Git clone. It’s an attempt to understand the <em>engineering principles</em> behind version control: state tracking, immutability, staging, and remote synchronization — by implementing them myself using a <strong>custom CLI, a REST backend, and cloud storage</strong>.</p><p>The result is a working VCS with a CLI and a GitHub-style web dashboard, built using the <strong>MERN stack and AWS S3</strong>.</p><h3>High-Level Architecture</h3><p>The system is intentionally split into three clear layers:</p><ol><li><strong>Local CLI</strong> — manages developer workflow and local state</li><li><strong>Backend API</strong> — stores metadata and repository state</li><li><strong>Cloud Storage</strong> — persists actual file contents</li></ol><p>This separation mirrors Git’s philosophy: <em>local-first operations with explicit remote synchronization</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*taChLtt_GiRMwcPqB5-ZZQ.png" /></figure><h3>1. Local CLI &amp; the Staging Area</h3><p>The CLI is built using yargs and manages a hidden directory called:</p><pre>.atharvGit/</pre><p>This directory acts as the local database for the repository.</p><h3>Repository Initialization</h3><p>Running init creates the internal structure:</p><pre>.atharvGit/<br>├── staging/<br>├── commits/<br>└── config.json</pre><p>The config.json stores environment-specific metadata such as repository identifiers and remote configuration.</p><h3>Staging Files (add)</h3><p>Instead of just tracking file paths or diffs, <strong>the system physically copies files</strong> into the staging directory.</p><p>Why copy files?</p><ul><li>It guarantees a <strong>true snapshot</strong> at the time of staging</li><li>It avoids ambiguity caused by later local edits</li><li>It makes state inspection and debugging trivial early on</li></ul><p>This is intentionally different from Git’s content-addressed object store.<br> The tradeoff is storage efficiency — and I accepted that tradeoff for correctness and clarity.</p><h3>Committing Changes (commit)</h3><p>A commit creates an <strong>immutable snapshot</strong>.</p><p>What happens internally:</p><ol><li>A <strong>UUID</strong> is generated as the commit ID</li><li>All staged files are moved into:</li></ol><pre>commits/&lt;commitID&gt;/</pre><ol><li>A commit.json file is generated containing:</li></ol><ul><li>commit message</li><li>timestamp</li></ul><p>Once created, a commit is never modified.</p><p><em>One thing I underestimated early on was disk I/O.<br> Copying entire files is simple, but as repositories grow, it becomes expensive.<br> I kept this design anyway — correctness first, optimization later.</em></p><h3>2. Remote Synchronization (push)</h3><p>The push operation is where local state meets distributed systems reality.</p><p>It performs <strong>two coordinated operations</strong>:</p><h3>A. Blob Storage (AWS S3)</h3><p>The CLI traverses the local commits/ directory and uploads files to AWS S3 using deterministic keys:</p><pre>commits/&lt;commitID&gt;/&lt;filename&gt;</pre><p>This guarantees:</p><ul><li>Commit isolation</li><li>No accidental overwrites</li><li>Easy retrieval per commit</li></ul><p>At this stage, the system uploads <strong>entire files</strong>, not deltas — a deliberate limitation acknowledged in the roadmap.</p><h3>B. State Persistence (Backend API)</h3><p>After uploading blobs, the CLI updates the backend via REST:</p><ul><li>Repository metadata</li><li>Commit list</li><li>File references</li></ul><p>This allows the web dashboard to reflect exactly what has been pushed, without directly inspecting S3.</p><h3>3. Web Dashboard</h3><p>The frontend is built with <strong>React + Vite</strong>, designed to feel familiar to GitHub users.</p><h3>Key Features</h3><h4>Repository View</h4><ul><li>Commit history</li><li>File listings per commit</li><li>Real-time updates via WebSockets</li></ul><h4>Contribution Graph</h4><p>Using @uiw/react-heat-map, the dashboard displays a contribution graph similar to GitHub’s.</p><p>Each push records an entry in an Activity collection in MongoDB, making contribution tracking explicit rather than inferred.</p><h4>Real-Time Events</h4><p>Socket.io broadcasts:</p><ul><li>Repository updates</li><li>User connections</li><li>Push activity</li></ul><p>This keeps the UI reactive without constant polling.</p><h3>Environment Setup</h3><h3>Backend .env</h3><pre># Database<br>MONGODB_URI=your_mongodb_connection_string<br>PORT=3002<br># Auth<br>JWT_SECRET_KEY=mysecretkey<br># AWS<br>AWS_ACCESS_KEY_ID=your_access_key<br>AWS_SECRET_ACCESS_KEY=your_secret_key<br>AWS_REGION=ap-south-1<br>S3_BUCKET=your_bucket_name</pre><h3>Setup Steps</h3><ol><li>Clone the repository</li><li>Run npm install in both backend and frontend</li><li>Configure AWS IAM with s3:PutObject and s3:GetObject</li><li>Start backend (npm start)</li><li>Use the CLI:</li></ol><pre>node index.js &lt;command&gt;</pre><h3>What This Project Taught Me</h3><p>Rebuilding Git-like behavior changes how you think about version control:</p><ul><li>Commits are about <strong>trust</strong>, not convenience</li><li>Staging is about <strong>intent</strong>, not automation</li><li>Push is a <strong>distributed systems problem</strong>, not a file upload</li><li>Immutability simplifies everything downstream</li></ul><p>Most importantly, I learned that Git’s real brilliance isn’t its commands — it’s how aggressively it protects history.</p><h3>Future Roadmap</h3><p>There’s a lot left to build:</p><h4>Delta Compression</h4><p>Store only file changes instead of full blobs to reduce storage and bandwidth.</p><h4>Branching &amp; Merging</h4><p>Implement HEAD pointers and branch references to support parallel development.</p><h4>Collaborative Issues</h4><p>Multi-user issue discussions with status labels (Open / Closed).</p><h4>Stronger Authorization</h4><p>JWT middleware on all sensitive routes to enforce ownership guarantees.</p><h3>Final Thoughts</h3><p>Using Git is easy.<br> <strong>Building something like it forces you to understand why it works.</strong></p><p>This project pushed me deep into file systems, distributed state, and cloud architecture — and it completely changed how I think about version control.</p><p><strong>Repository: </strong><a href="https://github.com/atharv-k-979/Github">https://github.com/atharv-k-979/Github</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad4f5082614a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>