<?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 Roee Mayerowicz on Medium]]></title>
        <description><![CDATA[Stories by Roee Mayerowicz on Medium]]></description>
        <link>https://medium.com/@roee2?source=rss-202023b97140------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2405U2FI-Ttdu3kbHuYkkA.jpeg</url>
            <title>Stories by Roee Mayerowicz on Medium</title>
            <link>https://medium.com/@roee2?source=rss-202023b97140------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 23:54:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@roee2/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[Peeling Back Obfuscated JavaScript: A Practical Reverse Engineering Guide]]></title>
            <link>https://levelup.gitconnected.com/peeling-back-obfuscated-javascript-a-practical-reverse-engineering-guide-c7c7aab02c43?source=rss-202023b97140------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7c7aab02c43</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[Roee Mayerowicz]]></dc:creator>
            <pubDate>Sun, 22 Mar 2026 12:31:17 GMT</pubDate>
            <atom:updated>2026-03-23T15:19:07.905Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RMtkQQw0piEQOS1hb8fkaw.png" /></figure><p>If you’ve ever opened a website’s JavaScript and been greeted by thousands of unreadable lines of code, you’ve probably encountered <strong>obfuscation</strong>.</p><p>Modern websites increasingly rely on JavaScript to implement security mechanisms such as bot detection, fingerprinting, and client-side validation. To protect these systems, developers often rely on code <strong>obfuscation</strong> — techniques that intentionally transform readable code into something far harder to analyze.</p><p>For engineers interested in understanding how these protections work, reverse engineering obfuscated JavaScript becomes an essential skill. While the core principles of reverse engineering remain the same, analyzing browser-executed JavaScript presents a unique set of challenges compared to traditional binary analysis.</p><p>In this article, we’ll explore some common JavaScript obfuscation techniques and discuss practical strategies for analyzing them.</p><h3>Reverse Engineering: Binaries vs. JavaScript</h3><p>Traditional reverse engineering usually focuses on compiled binaries. In these cases, high-level code is compiled into <strong>machine instructions</strong> that the CPU executes directly. Reverse engineering typically involves working with assembly instructions and understanding how compiled logic behaves at runtime.</p><p>JavaScript operates very differently.</p><p>Because JavaScript is designed as a <strong>cross-platform scripting language</strong>, it usually runs inside a browser environment rather than as native machine code. While technologies like WebAssembly can bring compiled code into the browser, the vast majority of JavaScript is still delivered as source code and executed by the browser’s JavaScript engine.</p><p>This creates a different defensive landscape.</p><p>Since the code must ultimately be delivered to the client, preventing execution isn’t realistic. Instead, developers rely on <strong>obfuscation techniques</strong> that make the code difficult to read, analyze, or modify.</p><p>In other words, the code is visible — but understanding it becomes the real challenge.</p><h3>Why Developers Obfuscate JavaScript</h3><p>In the modern web, JavaScript obfuscation is primarily used to protect:</p><ul><li><strong>Intellectual Property:</strong> Proprietary algorithms and business logic.</li><li><strong>Security Mechanisms:</strong> Anti-scraping and bot-detection scripts.</li><li><strong>Client-Side Validation:</strong> Payloads that verify user integrity before talking to a server.</li></ul><p>For example, many web security systems rely on client-side scripts to collect behavioral signals, verify browser fingerprints, or generate cryptographic tokens that distinguish real human users from automated traffic.</p><p>If an attacker can easily read that logic, they can write a script to spoof it. <strong>Obfuscation slows this process down by destroying the true structure of the code</strong>. The goal isn’t perfect, unbreakable secrecy — it’s to raise the barrier to entry high enough to delay or discourage analysis.</p><h3>Method 0: Minification (The Baseline)</h3><p>Before diving into active obfuscation, we have to talk about <strong>minification</strong>.</p><p>Minification reduces the footprint of JavaScript files by stripping out everything that isn’t strictly necessary for execution. This includes:</p><ul><li>Whitespace</li><li>Comments</li><li>Line breaks</li></ul><p>While its primary purpose is to improve page load speeds by shrinking file sizes, it also acts as a very basic layer of code unreadability.</p><p>Take this simple function:</p><pre>const test = (argumentOne, argumentTwo) =&gt; {<br>  console.log(&#39;hello world&#39;);<br>  // Example comment<br>  console.log(argumentOne, argumentTwo);<br>};</pre><p>After a standard minification pass, it looks like this:</p><pre>const test=(argumentOne,argumentTwo)=&gt;{console.log(&quot;hello world&quot;);console.log(argumentOne,argumentTwo)};</pre><p>Aggressive minifiers will go a step further, renaming your carefully chosen variables to meaningless, single-letter identifiers:</p><pre>const test=(o,l)=&gt;{console.log(&quot;hello world&quot;);console.log(o,l)};</pre><p>The logic remains identical, but readability drops. Fortunately, this is trivial to reverse. Almost all modern browsers and IDEs feature a “<strong>Pretty Print</strong>” button that automatically injects line breaks and indentation, returning the code to a readable (if poorly named) state.</p><h3>Method 1: String Encoding</h3><p>One of the oldest and most common tricks in the obfuscation playbook is string encoding. Instead of writing human-readable strings, developers encode them using hexadecimal or Unicode representations. This immediately breaks basic static analysis techniques (like hitting Ctrl+F or using grep to find specific keywords). This technique prevents simple keyword searches from revealing important logic.</p><p>Consider this basic statement:</p><pre>console.log(&quot;\x42\x6F\x6F\x6D&quot;)</pre><p>When executed, the JavaScript engine resolves the hex and outputs:</p><pre>console.log(&quot;Boom&quot;)</pre><p>While that looks simple enough, it gets a lot more interesting when combined with JavaScript’s dynamic property access. In JS, you can call object properties using bracket notation and strings.</p><p>This allows an obfuscator to turn a simple console.log into this:</p><pre>console[&quot;\x6c\x6f\x67&quot;](&quot;\x42\x6F\x6F\x6D&quot;)</pre><p>Or, weaponizing the eval function, it can be abstracted even further:</p><pre>eval(&quot;\x63\x6f\x6e\x73\x6f\x6c\x65&quot;)[&quot;\x6c\x6f\x67&quot;](&quot;\x42\x6F\x6F\x6D&quot;)</pre><p>Because everything is now represented as isolated string fragments, obfuscators rarely leave them inline. Instead, they will pack all the strings into a massive, shuffled array at the top of the file, and reference them by their index:</p><pre>_ = [&quot;\x63\x6f\x6e\x73\x6f\x6c\x65&quot;,&quot;\x6c\x6f\x67&quot;,&quot;\x42\x6F\x6F\x6D&quot;]<br>eval(_[0])[_[1]](_[2])</pre><p>In a three-item array, the execution flow is easy to map. But in real-world environments, these scripts often contain thousands of lines of code mapping back to an array with hundreds of encoded, mathematically shifted strings. <strong>Manual analysis quickly becomes impossible</strong>, forcing the reverse engineer to write custom scripts just to unpack the array.</p><h3>When Obfuscation Gets Serious</h3><p>Modern commercial obfuscators rarely rely on a single trick. They are built to layer multiple techniques on top of each other, including:</p><ul><li><strong>String encoding and array shuffling</strong> (as seen above).</li><li><strong>Runtime decoding:</strong> Strings that only decode themselves when certain environmental conditions are met.</li><li><strong>Control-flow flattening:</strong> Breaking linear if/else logic into massive, flat switch statements inside infinite while loops.</li><li><strong>Dead code injection:</strong> Adding thousands of lines of fake logic to waste the analyst’s time.</li></ul><p>Layered together, these transformations turn simple logic into a monolithic wall of unreadable code. For the reverse engineer, defeating this is a process of “<strong>deobfuscation</strong>”: gradually peeling back the layers, simplifying the control flow, and restoring the original intent.</p><h3>Bonus: The Most Absurd JavaScript Encoding</h3><p>If you want to see just how far JavaScript syntax can be stretched, look no further than <a href="https://jsfuck.com/"><strong>JSFuck</strong></a>.</p><p>Created in 2014 by developer Martin Kleppe, JSFuck is an esoteric programming style that executes valid JavaScript using <em>only six characters</em>:</p><p>[ ] ( ) ! +</p><p>Despite this extreme limitation, JSFuck is Turing-complete, meaning it can express literally any valid JavaScript program. While it is too bloated to be used as a practical obfuscation method in production environments, it is a brilliant reminder of how flexible — and wonderfully weird — the JavaScript engine can be.</p><h3>Final Thoughts</h3><p>Reverse engineering client-side JavaScript is less about breaking complex cryptographic math, and more about understanding the architecture of deception.</p><p>As web security systems continue to evolve, obfuscation techniques are only getting more sophisticated. For engineers interested in web security, debugging complex applications, or simply understanding how modern web defenses operate behind the scenes, learning to unmask obfuscated code is an incredibly valuable and highly addictive skill.</p><p><em>In future articles, I’ll dive deeper into the rabbit hole, exploring advanced obfuscation techniques like control-flow flattening, and the practical tools you can use to break them. Stay tuned.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7c7aab02c43" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/peeling-back-obfuscated-javascript-a-practical-reverse-engineering-guide-c7c7aab02c43">Peeling Back Obfuscated JavaScript: A Practical Reverse Engineering Guide</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[96x Faster: Why Your Chromium CI Doesn’t Need Git]]></title>
            <link>https://levelup.gitconnected.com/96x-faster-why-your-chromium-ci-doesnt-need-git-f6cd735d0b76?source=rss-202023b97140------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6cd735d0b76</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[chromium]]></category>
            <dc:creator><![CDATA[Roee Mayerowicz]]></dc:creator>
            <pubDate>Mon, 23 Feb 2026 14:31:01 GMT</pubDate>
            <atom:updated>2026-02-27T15:36:57.999Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JUClm8TVdsyHZf6LFMO2sA.png" /></figure><p>Maintaining a custom Chromium fork is an expensive endeavor — not just in engineering hours, but in CI/CD resources.</p><p>In a recent project optimizing a patched Chromium fork, I inherited a GitHub Actions pipeline where the checkout and setup phase averaged <strong>1 hour and 37 minutes</strong>. This delay occurred before a single line of code was ever compiled. By re-evaluating the source acquisition strategy, I was able to reduce that time to <strong>1 minute and 15 seconds.</strong></p><p>This was not achieved through minor caching tweaks. It required a fundamental architectural shift.</p><h3>The Strategic Insight</h3><blockquote><strong>CI environments do not require Git history — even for patched forks.</strong></blockquote><p>In our CI context, only two things were required: <strong>a deterministic source snapshot</strong> and a <strong>reproducible patch layer</strong>.</p><p>By treating Chromium as an immutable artifact rather than a living repository, the overhead of the Git protocol was eliminated entirely. The following architecture made this possible.</p><h3>The Traditional Bottleneck</h3><p><a href="https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md">The official Google documentation</a> is designed for developer flexibility. It typically follows this workflow:</p><ol><li>Clone depot_tools.</li><li>Execute gclient sync.</li><li>Perform a rebase against upstream.</li><li>Build.</li></ol><p>While this is vital for a developer workstation, flexibility introduces overhead that CI does not benefit from. In this context, branch navigation is unnecessary; the requirement is simply to build a specific revision with a defined set of modifications.</p><h3>Analyzing the Overhead of gclient sync</h3><p>When a sync is triggered, a complex orchestration is performed:</p><ul><li><strong>Dependency Resolution:</strong> DEPS are parsed to resolve hundreds of sub-repositories.</li><li><strong>Git Negotiation:</strong> Hundreds of handshakes and packfile transfers are initiated.</li><li><strong>Metadata Overhead:</strong> Refs, tags, and history — none of which are utilized by the CI — are downloaded.</li><li><strong>Hook Execution:</strong> DEPS specify &quot;hooks&quot;—arbitrary scripts that are executed to download pre-built binaries (like the Clang toolchain, Node.js runtime, and sysroots) and configure the local environment.</li></ul><p>Even with --no-history, packfile negotiation and object inflation still occur across hundreds of repositories.</p><p>On a GitHub Actions runner, this resulted in nearly two hours of high-latency network I/O.</p><h3>The Transition to Stateless Patching</h3><p>A common misconception in modern DevOps is that patching necessitates Git. While Git is an excellent tool for <em>creating</em> patches, utilizing a full Git tree in CI simply to apply them is often overkill.</p><p>Before Git dominated the landscape, large-scale projects like the Linux Kernel were maintained via patch-based workflows on mailing lists relying on the standard Linux patch utility to apply changes deterministically.</p><p><strong>The asymmetry is obvious:</strong> A patch file is typically kilobytes of text, whereas a full multi-repository Git checkout transfers gigabytes of objects and history. By decoupling modifications from the Git history, the process was shifted from <strong>Stateful Patching</strong> (rebasing branches) to <strong>Stateless Patching</strong> (applying diffs directly to a directory).</p><h3>The Implementation</h3><p>To achieve maximum velocity, a model was implemented based on three deterministic layers:</p><ol><li><strong>The Source Tree:</strong> Official source tarballs (e.g., chromium-100.0.4845.0-lite.tar.xz) are utilized. These represent the fully materialized state of the superproject at a pinned revision. These are fully resolved snapshots that require no Git negotiation.</li><li><strong>The Patch Layer:</strong> The standard Linux patch command is used to apply modifications directly to the extracted filesystem.</li><li><strong>Manual Orchestration:</strong> Only the essential toolchain scripts are triggered.</li></ol><pre># 1. Acquisition of the snapshot (completed in seconds)<br># Using the &quot;Lite&quot; tarball to minimize transfer size.<br>curl -O https://commondatastorage.googleapis.com/chromium-browser-official/chromium-[VERSION]-lite.tar.xz<br>tar -xf chromium-[VERSION]-lite.tar.xz<br># 2. Patch application without Git<br># This is performed as a pure filesystem transformation.<br>patch -p1 &lt; ./my_patches/custom_feature.patch<br># 3. Manual toolchain orchestration<br>python3 ./tools/rust/update_rust.py<br>python3 ./tools/clang/scripts/update.py<br>./third_party/node/update_node_binaries<br>./build/linux/sysroot_scripts/install-sysroot.py</pre><blockquote><strong><em>Note on the Lite Version:</em></strong><em> The lite version is smaller because it excludes documentation and other non-essential artifacts. For CI systems, especially ephemeral runners, the lite archive is often preferable: smaller transfer size, faster extraction, and identical build correctness.</em></blockquote><h3>The Results: A 96x Reduction</h3><p>By eliminating Git negotiation and multi-repo resolution, a staggering improvement was observed in the pipeline:</p><pre>+--------------------+----------------------+------------------------------------+<br>| Phase              | Previous (Git-based) | Optimized (Snapshot + Linux Patch) |<br>+--------------------+----------------------+------------------------------------+<br>| Source Acquisition | 1h 22m               | 45s                                |<br>| Setup &amp; Hooks      | 15m                  | 30s                                |<br>| Total Setup Time   | 1h 37m               | 1m 15s                             |<br>+--------------------+----------------------+------------------------------------+</pre><h3>Trade-offs and Application</h3><ul><li><strong>Recommended for:</strong> Ephemeral CI runners and production release builds. This ensures <strong>idempotency</strong> — every build begins from the exact same bytes.</li><li><strong>Not recommended for:</strong> Local developer environments or workflows requiring git bisect, dynamic DEPS modifications, iterative patch stack rebasing, or any process that depends on Git metadata at build time. In those scenarios, gclientand a full repository checkout remain the correct and necessary tools.</li></ul><p>For those seeking a reference implementation, the <a href="https://github.com/ungoogled-software/ungoogled-chromium-portablelinux/blob/master/scripts/shared.sh"><strong>Ungoogled-Chromium</strong></a> project demonstrates a similar snapshot and patch model. Upstream is treated as an immutable base, and changes are maintained as a transparent patch set.</p><h3>Final Thoughts</h3><p>This experience reinforced an important lesson: tools designed for developer flexibility are not always optimal for automated systems.</p><p>gclient is a masterpiece of dependency management, but it was built for people, not automated pipelines. By moving to a stateless, snapshot-based model, nearly two hours were reclaimed from every build cycle.</p><p>In high-performance engineering, sometimes the most effective tool is the one that has been in the Linux /bin/ folder for decades.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6cd735d0b76" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/96x-faster-why-your-chromium-ci-doesnt-need-git-f6cd735d0b76">96x Faster: Why Your Chromium CI Doesn’t Need Git</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Don’t Zip (GitHub Artifacts) in CI]]></title>
            <link>https://itnext.io/dont-zip-github-artifacts-in-ci-da7297f161ed?source=rss-202023b97140------2</link>
            <guid isPermaLink="false">https://medium.com/p/da7297f161ed</guid>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Roee Mayerowicz]]></dc:creator>
            <pubDate>Sat, 31 Jan 2026 13:41:01 GMT</pubDate>
            <atom:updated>2026-02-25T14:47:58.943Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b1l7bjfy35L5kRVGhnnFIw.png" /></figure><p>In my day job, I work on a Chromium fork for AI. As you can imagine, the build output is <em>big</em> , close to a gigabyte of files in some cases. When your artifacts are that large, CI performance stops being a “nice to have” and becomes critical.</p><p>Recently, our core changed frequently and significantly, which forced us to invest in a more efficient CI pipeline. After adding caching wherever possible, we managed to reduce release times from hours to minutes. That freed up some time to nitpick and optimize the remaining bottlenecks.</p><p>One thing stood out.</p><p>At the end of every CI run, we uploaded the build output as a ZIP file to GitHub Artifacts and S3. That step alone took <strong>1.2–2 minutes per run</strong>. For something that happens <em>every single build</em>, that’s expensive.</p><p>The problem is simple: <strong>ZIP compression is single-threaded by default</strong>. On large artifacts, that becomes a hard limit.</p><p>So I tried a small change: switching to multi-threaded compression.</p><h3>Compression speed</h3><pre>zip:   1:18.85 (real)<br>pigz:  0:21.38 (real)<br>zstd:  0:05.51 (real)</pre><p>From over a minute to just a few seconds.</p><p>And it doesn’t stop there — decompression is also faster:</p><h3>Decompression speed</h3><pre>zip:   0:19.47 (real)<br>pigz:  0:12.79 (real)<br>zstd:  0:04.58 (real)</pre><p>At this point, it’s hard to justify ZIP in a controlled environment like CI. ZIP still makes sense when distributing artifacts to external users, where compatibility matters. But when you control both ends of the system, <strong>there’s very little reason to accept a single-threaded bottleneck</strong>.</p><p>Small change. Big win.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da7297f161ed" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/dont-zip-github-artifacts-in-ci-da7297f161ed">Don’t Zip (GitHub Artifacts) in CI</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>