<?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: Pablo Albornoz Afanasiev</title>
    <description>The latest articles on DEV Community by Pablo Albornoz Afanasiev (@fs-doc).</description>
    <link>https://dev.to/fs-doc</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%2F4078815%2F4d8cf3c1-d8be-4125-9c46-d9895be1d28f.jpg</url>
      <title>DEV Community: Pablo Albornoz Afanasiev</title>
      <link>https://dev.to/fs-doc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fs-doc"/>
    <language>en</language>
    <item>
      <title>Check my latest post!</title>
      <dc:creator>Pablo Albornoz Afanasiev</dc:creator>
      <pubDate>Tue, 27 Oct 2026 10:47:38 +0000</pubDate>
      <link>https://dev.to/fs-doc/check-my-latest-post-482i</link>
      <guid>https://dev.to/fs-doc/check-my-latest-post-482i</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/fs-doc/everyone-said-patch-immediately-nobody-said-what-to-do-for-the-next-six-hours-1h1f" class="crayons-story__hidden-navigation-link"&gt;Everyone said patch immediately. Nobody said what to do for the next six hours.&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/fs-doc" class="crayons-avatar  crayons-avatar--l  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4078815%2F4d8cf3c1-d8be-4125-9c46-d9895be1d28f.jpg" alt="fs-doc profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/fs-doc" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Pablo Albornoz Afanasiev
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Pablo Albornoz Afanasiev
                
                
              
              &lt;div id="story-author-preview-content-4920982" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/fs-doc" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4078815%2F4d8cf3c1-d8be-4125-9c46-d9895be1d28f.jpg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Pablo Albornoz Afanasiev&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/fs-doc/everyone-said-patch-immediately-nobody-said-what-to-do-for-the-next-six-hours-1h1f" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Oct 26&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/fs-doc/everyone-said-patch-immediately-nobody-said-what-to-do-for-the-next-six-hours-1h1f" id="article-link-4920982"&gt;
          Everyone said patch immediately. Nobody said what to do for the next six hours.
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/security"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;security&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/devops"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;devops&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/node"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;node&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/architecture"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;architecture&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/fs-doc/everyone-said-patch-immediately-nobody-said-what-to-do-for-the-next-six-hours-1h1f" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt;&amp;nbsp;reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/fs-doc/everyone-said-patch-immediately-nobody-said-what-to-do-for-the-next-six-hours-1h1f#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            9 min read
          &lt;/small&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>cybersecurity</category>
      <category>discuss</category>
      <category>infosec</category>
      <category>security</category>
    </item>
    <item>
      <title>Everyone said patch immediately. Nobody said what to do for the next six hours.</title>
      <dc:creator>Pablo Albornoz Afanasiev</dc:creator>
      <pubDate>Mon, 26 Oct 2026 11:50:52 +0000</pubDate>
      <link>https://dev.to/fs-doc/everyone-said-patch-immediately-nobody-said-what-to-do-for-the-next-six-hours-1h1f</link>
      <guid>https://dev.to/fs-doc/everyone-said-patch-immediately-nobody-said-what-to-do-for-the-next-six-hours-1h1f</guid>
      <description>&lt;p&gt;On October 20th, two critical PHP vulnerabilities went public before the advisory did. Unauthenticated remote code execution, CVSS 9.2, and proof-of-concept code already circulating. &lt;a href="https://unit42.paloaltonetworks.com/cve-2026-109618-cve-2026-109619/" rel="noopener noreferrer"&gt;Unit 42 counted&lt;/a&gt; more than 22.6 million exposed instances at the time of publication.&lt;/p&gt;

&lt;p&gt;Someone named it PHP2Shell and the name stuck.&lt;/p&gt;

&lt;p&gt;The next day, Node.js shipped a security release fixing ten issues. One of them was an out-of-bounds write in the Brotli decoder, which also meant remote code execution. That one got called Node2Shell.&lt;/p&gt;

&lt;p&gt;Two runtime-level RCEs in forty-eight hours, in the two runtimes that serve a very large share of the web. Every vendor blog said the same thing, and they were right: patch immediately.&lt;/p&gt;

&lt;p&gt;Here's the part nobody writes about. Between reading the advisory and having every service in your fleet actually running the patched runtime, there are hours. Sometimes days, if you have a lot of containers, a slow registry, or a change window you can't skip.&lt;/p&gt;

&lt;p&gt;During that gap, "patch immediately" is advice you've already taken and are still waiting on.&lt;/p&gt;

&lt;p&gt;So what do you do in the meantime?&lt;/p&gt;

&lt;h2&gt;
  
  
  Why these two were unusually bad
&lt;/h2&gt;

&lt;p&gt;It's worth being precise about what made these different from an ordinary dependency CVE, because that's what determines which tools can help.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PHP2Shell&lt;/strong&gt; (CVE-2026-109618 and CVE-2026-109619) lives in PHP's error handling: out-of-memory and fatal-error paths that leave memory uninitialized or pointing at freed regions. An attacker needs nothing but an unauthenticated POST.&lt;/p&gt;

&lt;p&gt;And here's the detail that matters most. PHP parses the request &lt;em&gt;before your application code runs&lt;/em&gt;. Your authentication middleware, your input validation, your framework's request pipeline: none of it has executed yet. As &lt;a href="https://securitylabs.datadoghq.com/articles/php2shell-critical-vulnerabilities-in-php/" rel="noopener noreferrer"&gt;Datadog's analysis&lt;/a&gt; puts it, any PHP script on the server exposes the vulnerable path.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node2Shell&lt;/strong&gt; (CVE-2026-111497) is an out-of-bounds write in the Brotli decoder inside the runtime. The obvious way in is a request with &lt;code&gt;Content-Encoding: br&lt;/code&gt; reaching an app on Express 5 or body-parser 2.x, which decompresses the body for you.&lt;/p&gt;

&lt;p&gt;But &lt;a href="https://www.contrastsecurity.com/security-influencers/node2shell-vulnerabilities-cve-2026-111497-analysis-and-remediation" rel="noopener noreferrer"&gt;Contrast's writeup&lt;/a&gt; points at two other paths that matter more than they first appear: a malicious &lt;em&gt;response&lt;/em&gt; decoded by &lt;code&gt;fetch()&lt;/code&gt;, and any direct call to &lt;code&gt;zlib.brotliDecompress()&lt;/code&gt;. The decoding happens inside the runtime, after traffic has already passed your perimeter, which is why a WAF is an unreliable control here.&lt;/p&gt;

&lt;p&gt;In both cases the vulnerable code sits &lt;em&gt;below&lt;/em&gt; your application. You can't write your way out of it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I want to say that plainly up front&lt;/strong&gt;, because the rest of this article is about response, not prevention, and I'd rather not pretend otherwise.&lt;/p&gt;

&lt;h2&gt;
  
  
  What hour one actually looked like
&lt;/h2&gt;

&lt;p&gt;Three things, roughly, depending on how much the organization had to lose.&lt;/p&gt;

&lt;p&gt;Some teams took services offline. At least one European government took its website down as a precaution. Given that in another case attackers had password hashes and MFA secrets within two hours of initial exploitation, and were attempting Domain Admin escalation, that wasn't an overreaction.&lt;/p&gt;

&lt;p&gt;Some blocked at the perimeter. Reasonable for PHP. Less reliable for Node, where the decoder runs after the request is already inside.&lt;/p&gt;

&lt;p&gt;And some applied the partial mitigations. For PHP2Shell that meant &lt;code&gt;memory_limit=-1&lt;/code&gt;, &lt;code&gt;session.upload_progress.enabled=0&lt;/code&gt;, and on PHP 8.5 also &lt;code&gt;fatal_error_backtraces=0&lt;/code&gt;. For Node2Shell, a virtual patch rejecting every request carrying a Brotli content encoding.&lt;/p&gt;

&lt;p&gt;Now look at what those mitigations cost you.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;memory_limit=-1&lt;/code&gt; removes the memory ceiling from your PHP workers. You're trading a code execution risk for an availability risk, and unless you already have request-size limits and container memory limits in place, you've just moved the problem somewhere else. Rejecting all Brotli bodies breaks legitimate clients that were doing nothing wrong.&lt;/p&gt;

&lt;p&gt;None of them is a fix. Every advisory said so.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;These are the right calls under the circumstances. They're also exactly the kind of change you want live for forty-eight hours and gone the moment you're patched.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Every lever you have is a deploy
&lt;/h2&gt;

&lt;p&gt;Here's what I think the real structural problem is, and it isn't specific to these two CVEs.&lt;/p&gt;

&lt;p&gt;Turn off file uploads. Reject one content encoding. Lock outbound calls to a short allowlist. Put the app in read-only mode. Kill the one feature that touches the risky path.&lt;/p&gt;

&lt;p&gt;Every one of those is a behavior change. And in most codebases, every one of them is a deploy: a config change, a rebuild, a rollout, a worker restart, across however many services you run. Under incident pressure. Through the same pipeline your platform team is currently using to ship the actual patch.&lt;/p&gt;

&lt;p&gt;That's the thing worth sitting with. During an incident, the fix path and the mitigation path compete for the same machinery, and that machinery is the riskiest tool in the building at precisely the moment everyone is tired and moving fast.&lt;/p&gt;

&lt;p&gt;Knight Capital lost $460 million in forty-five minutes partly because the attempted fix ran through the deployment process that had caused the problem, and made it worse.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If the only way to change what your application does is to ship code, your incident response time has a floor set by your build pipeline.&lt;/strong&gt; Not by how fast you understand the problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changes when behavior is data
&lt;/h2&gt;

&lt;p&gt;The alternative is that some of those behaviors live outside your code, as rules your application reads at runtime. That's what a policy engine does. &lt;a href="https://github.com/Govplane" rel="noopener noreferrer"&gt;Govplane&lt;/a&gt; is the one I work on, and the same argument holds for any of them.&lt;/p&gt;

&lt;p&gt;A policy is a rule in a signed file. Your app loads it, verifies it, and evaluates decisions in-process with no network call. Changing a rule means shipping a new file, not a new build.&lt;/p&gt;

&lt;p&gt;Two concrete examples from the Node side, because that's where policy can genuinely sit in the path.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rejecting Brotli bodies, per route, without a deploy
&lt;/h3&gt;

&lt;p&gt;The body gets decompressed by body-parser, so a check that runs before it never reaches the decoder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// must be registered BEFORE express.json() / body-parser&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decision&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;govplane&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;evaluate&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;api&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;resource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;request&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;decode&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;contentEncoding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;content-encoding&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;none&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;route&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;decision&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;decision&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;deny&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;415&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;content encoding not accepted&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The rule driving it is one line of JSON. The reason this beats hardcoding the same check is that you can scope it.&lt;/p&gt;

&lt;p&gt;Block &lt;code&gt;br&lt;/code&gt; on the three public webhook routes where you never expected it. Leave it alone on the internal endpoint where a partner legitimately sends compressed payloads. Then change your mind twenty minutes later when you learn more, without touching the build.&lt;/p&gt;

&lt;h3&gt;
  
  
  Constraining outbound calls
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;fetch()&lt;/code&gt; vector is the one I saw people underestimate, and it's the nastier of the two. If your application fetches a URL and the response comes back Brotli-encoded, your own outbound call is the attack vector.&lt;/p&gt;

&lt;p&gt;That matters a lot if any URL in your system is user-influenced: a webhook target, an integration endpoint, an avatar importer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decision&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;govplane&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;evaluate&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;integrations&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;resource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;outbound-http&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fetch&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;hostname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tenantId&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;decision&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;decision&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;allow&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;OutboundBlockedError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;decision&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ruleId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most teams already have an outbound allowlist somewhere. It's usually an environment variable, an array in a config file, or a regex somebody wrote in 2023.&lt;/p&gt;

&lt;p&gt;During an incident you want to shrink it to four hosts for a day and then put it back. &lt;strong&gt;The difference between that being a thirty-second change and a forty-minute change is whether it lives in a file your app reads, or in the build.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Shed the surface, not the service
&lt;/h2&gt;

&lt;p&gt;Taking the whole site down is the blunt instrument. Sometimes it's the correct one. If you have no idea what's reachable, pulling the plug is defensible.&lt;/p&gt;

&lt;p&gt;But most of the exposure in these two incidents was concentrated. For CVE-2026-109619, upload processing was a confirmed path, and upload progress is enabled by default, and runs even without &lt;code&gt;session_start()&lt;/code&gt;. For Node2Shell, the inbound path is specifically Brotli-encoded request bodies.&lt;/p&gt;

&lt;p&gt;If uploads are a policy-controlled capability rather than a code path, hour one looks different. You disable uploads across every service at once, keep the other 95% of the product running, and patch on a schedule your platform team sets rather than one panic sets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Containment doesn't have to mean shutdown. It should mean removing the capability that's dangerous right now, and leaving everything that works alone.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The mitigations are temporary. Make them look temporary.
&lt;/h2&gt;

&lt;p&gt;This is the part I'd most like people to take away, and it's the least discussed.&lt;/p&gt;

&lt;p&gt;You set &lt;code&gt;memory_limit=-1&lt;/code&gt; on Friday. You're patched by Tuesday.&lt;/p&gt;

&lt;p&gt;Is it still set?&lt;/p&gt;

&lt;p&gt;Emergency mitigations have a way of becoming permanent configuration. They get applied under pressure, usually by whoever was on call, usually outside the normal review process. The ticket to revert them gets written at 3am by someone who then takes two days off.&lt;/p&gt;

&lt;p&gt;Six months later nobody remembers why that value is there, and the safety ceiling it removed is still gone.&lt;/p&gt;

&lt;p&gt;When a mitigation is a policy rather than a config change, two things get easier. It carries metadata (who turned it on, why, and when it should be reviewed) in the same artifact as the rule. And reverting it is the same cheap operation as applying it, which removes the main excuse for leaving it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cve-2026-111497-brotli-block"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"meta"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"owner"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"platform-oncall"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"reason"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Node2Shell mitigation; remove once fleet is on 22.23.4+"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"reviewBy"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-10-27"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's not a clever technical feature. &lt;strong&gt;It's just writing down the expiry date at the moment you know it, instead of six months later when you don't.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What you'll want in the post-mortem
&lt;/h2&gt;

&lt;p&gt;The week after, somebody is going to ask what was live when. If you're in a regulated sector, somebody external will ask, and "we believe uploads were disabled sometime Tuesday afternoon" isn't an answer.&lt;/p&gt;

&lt;p&gt;The useful artifact is a record that says: this request was blocked, by this rule, in this policy, from this bundle version, at this timestamp.&lt;/p&gt;

&lt;p&gt;Not a log line saying a request was rejected. An explanation of &lt;em&gt;why it was rejected, and under what authority&lt;/em&gt;. Those are different questions, and the second one is what separates "our control worked" from "we got lucky."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;That's a general property of pushing behavior into data.&lt;/strong&gt; When the rules are a versioned, signed artifact, the history of what was in force is a byproduct instead of an archaeology project.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this does not do
&lt;/h2&gt;

&lt;p&gt;I'd rather state these than have them pointed out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It would not have prevented either vulnerability.&lt;/strong&gt; PHP2Shell executes before application code. Nothing in userland runs early enough to matter: not a framework, not a policy engine, not middleware. For Node2Shell, a direct &lt;code&gt;zlib.brotliDecompress()&lt;/code&gt; call inside a dependency you don't control is equally invisible to a policy layer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It doesn't tell you which runtime versions you're running.&lt;/strong&gt; Both advisories stressed inventorying each runtime separately, because the PHP inside a container image is often not the PHP on the host, and bundled interpreters differ from the CLI one. That's an SBOM and asset inventory problem, and it was the genuinely hard part of October for a lot of teams. A policy engine has nothing useful to say about it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It doesn't patch anything.&lt;/strong&gt; The patched versions are PHP 8.2.35, 8.3.36, 8.4.27 and 8.5.12, and Node 22.23.4, 24.22.1 and 26.12.1. Everything above is about the window before you get there. It is not a substitute for getting there.&lt;/p&gt;

&lt;h2&gt;
  
  
  The actionable bit
&lt;/h2&gt;

&lt;p&gt;The mitigations you need during a runtime CVE are mostly knowable before one happens. They're generic shapes: turn off uploads, reject an encoding, shrink the outbound allowlist, go read-only, kill one feature.&lt;/p&gt;

&lt;p&gt;If those exist as rules you can flip, hour one is an operational decision.&lt;/p&gt;

&lt;p&gt;If they don't, hour one is a design session followed by a deploy, run by tired people, through the pipeline that's already busy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Write them before you need them.&lt;/strong&gt; That's the whole recommendation, and it's worth doing whether or not you use a policy engine to do it.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I work on &lt;a href="https://github.com/Govplane" rel="noopener noreferrer"&gt;Govplane&lt;/a&gt;, an open-source runtime policy engine. It's MIT licensed, the bundle format is published, and it runs locally with no account. The code samples above use its Node SDK.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Further reading:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.tenable.com/blog/php2shell-cve-2026-109618-cve-2026-109619-frequently-asked-questions-about-critical-php-remote" rel="noopener noreferrer"&gt;Tenable's php2shell FAQ&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.aikido.dev/blog/node2shell-nodejs-brotli-rce-cve-2026-111497" rel="noopener noreferrer"&gt;Aikido - Node2Shell: Node.js Brotli vulnerability allows remote code execution (CVE-2026-111497)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://brandefense.io/blog/node2shell-nodejs-brotli-rce-cve-2026-111497/" rel="noopener noreferrer"&gt;Brandefense - Node2Shell: Node.js Brotli RCE (CVE-2026-111497), Fixed Versions and How to Check&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://securityonline.info/nodejs-security-release-october-2026/" rel="noopener noreferrer"&gt;Node.js October 2026 security releases&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>devops</category>
      <category>node</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Your `if` statements are a database nobody can query</title>
      <dc:creator>Pablo Albornoz Afanasiev</dc:creator>
      <pubDate>Sat, 15 Aug 2026 15:54:05 +0000</pubDate>
      <link>https://dev.to/fs-doc/your-if-statements-are-a-database-nobody-can-query-3d84</link>
      <guid>https://dev.to/fs-doc/your-if-statements-are-a-database-nobody-can-query-3d84</guid>
      <description>&lt;p&gt;Somewhere in your codebase there is a line that looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;plan&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;enterprise&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;tenantId&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;acme-corp&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nobody remembers who wrote the second half of that condition. It has been there for two years. It is almost certainly still load-bearing.&lt;/p&gt;

&lt;p&gt;Here is the thing I want to convince you of: that line isn't code. It's data, and it's stored in the worst possible place.&lt;/p&gt;

&lt;p&gt;Every conditional that encodes a business decision is really a row. It has a condition, an outcome, and a bunch of implicit context about when it applies. You have hundreds of these rows. They're spread across a dozen services, written in four different styles, and there is no way to list them.&lt;/p&gt;

&lt;p&gt;You have a database. You just can't query it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Five things a database gives you that your code doesn't
&lt;/h2&gt;

&lt;p&gt;Once you look at it this way, the problems stop feeling like sloppiness and start feeling structural.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There's no schema.&lt;/strong&gt; One service decides a customer is premium by checking &lt;code&gt;plan === 'premium'&lt;/code&gt;. Another checks &lt;code&gt;subscription.tier &amp;gt; 2&lt;/code&gt;. A third checks a flag that was set during a migration in 2023. All three are "the same rule" until the day they aren't, and there's nothing in the system that would notice the drift.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There's no way to query it.&lt;/strong&gt; Try to answer a simple question: &lt;em&gt;what rules are live in production right now?&lt;/em&gt; You can't. Someone has to read the source. And grep won't save you, because the interesting conditions are compound, spread across guard clauses, and half of them are expressed as an early &lt;code&gt;return&lt;/code&gt; rather than an &lt;code&gt;if&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There are no migrations.&lt;/strong&gt; Changing a rate limit from 100 to 200 requires a pull request, a review, a CI run, and a deploy window. You're pushing a code change through the full pipeline to change a number. It's a schema migration with none of the tooling that makes schema migrations tolerable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There's no audit log.&lt;/strong&gt; Git tells you who edited the line. It doesn't tell you who &lt;em&gt;decided&lt;/em&gt; the rule, when it was supposed to expire, or whether the customer it was written for is still a customer. Blame gives you an author and a timestamp, which is the least interesting part of the history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There's no access control.&lt;/strong&gt; The person accountable for the pricing policy can't read the pricing policy. They have to ask an engineer, who has to find it, and any change routes through a sprint. Not because anyone designed it that way — just because the rule lives in a file that only engineers can open.&lt;/p&gt;

&lt;p&gt;None of these are hard problems in a database. All of them are unsolved in your codebase.&lt;/p&gt;

&lt;h2&gt;
  
  
  The usual fix trades one problem for a worse one
&lt;/h2&gt;

&lt;p&gt;The standard answer is to pull the rules into a service. Remote config, a feature flag platform, a policy server. And it genuinely works: you get a UI, you get an audit trail, you get changes without a deploy.&lt;/p&gt;

&lt;p&gt;But look at what just moved. Your application now makes a network call to decide whether a user can read a document. That call is in the request path. It has a latency budget, a failure mode, and a dependency on somebody else's uptime.&lt;/p&gt;

&lt;p&gt;Which brings us to the part that always bothered me most. The single most valuable rule in your system is the kill switch — the one you flip when something is on fire at 3 a.m. And in this architecture, flipping it requires a third-party service to be up, during exactly the kind of incident where things are not up.&lt;/p&gt;

&lt;p&gt;You've fixed visibility by creating an availability problem. That's a real trade, and for a lot of teams it's the right one. But it's not the only option.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you actually want
&lt;/h2&gt;

&lt;p&gt;Work backwards from the five problems, and the requirements fall out on their own:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A declarative format with a schema&lt;/strong&gt;, so a rule is a thing you can validate rather than a thing you have to read&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One artifact&lt;/strong&gt;, so "what's live right now" is a file you can open instead of an archaeology project&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Changeable without a deploy&lt;/strong&gt;, because that's the whole point&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verifiable&lt;/strong&gt;, because a file that decides who can do what is a file worth signing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Evaluated locally&lt;/strong&gt;, so nothing sits between your request and its answer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That last one is what keeps the 3 a.m. case honest. If the rules are already on the machine, there's no service that can be down when you need them.&lt;/p&gt;

&lt;p&gt;This is what we ended up building, and it's called &lt;a href="https://github.com/Govplane" rel="noopener noreferrer"&gt;Govplane&lt;/a&gt;. Rules compile into a signed JSON bundle. You ship it like any other config artifact — a Git commit, an object in a bucket, a layer in your image. Your app loads it, checks the signature, and evaluates everything in memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Four use cases that turned out to be the same one
&lt;/h2&gt;

&lt;p&gt;Here's the part I didn't expect when we started.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Feature flags&lt;/strong&gt; are the obvious case. A policy matches on some context and returns &lt;code&gt;allow&lt;/code&gt; or &lt;code&gt;deny&lt;/code&gt;, and your code asks instead of assuming:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decision&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;govplane&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;evaluate&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;web&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;resource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;checkout-v2&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;access&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;region&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;eu&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;decision&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;decision&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;allow&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// new checkout&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Kill switches&lt;/strong&gt; are the same mechanism with a different effect. &lt;code&gt;kill_switch&lt;/code&gt; sits at the top of the precedence order, above &lt;code&gt;deny&lt;/code&gt;, above &lt;code&gt;throttle&lt;/code&gt;, above &lt;code&gt;allow&lt;/code&gt; — so a rule that shuts something off wins over every rule that would have permitted it. Flipping it means shipping a new bundle, which is a file copy, not a deploy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RBAC&lt;/strong&gt; is where it got interesting. Permissions are the same shape as flags: something about the caller, something about the resource, an allow-or-deny at the end. Put the role in the context and the resource in the target, and authorization is just another policy in the same bundle.&lt;/p&gt;

&lt;p&gt;This is also where signing stops being a nice-to-have. A file that decides who can delete records is a file that needs provenance. The SDK verifies the signature before it will evaluate anything — an unsigned bundle is refused unless you explicitly opt in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Custom effects&lt;/strong&gt; are the one I'd point at if you only read one section.&lt;/p&gt;

&lt;p&gt;The first three all answer a yes-or-no question. But policies can return a payload instead — and that means a policy can decide not &lt;em&gt;whether&lt;/em&gt; something happens, but &lt;em&gt;with what value&lt;/em&gt; it happens.&lt;/p&gt;

&lt;p&gt;We use this for things like per-tenant limits, where the answer isn't "allowed" or "denied" but "your ceiling is 500":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decision&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;govplane&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;evaluate&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;api&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;resource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;uploads&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;create&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;acme&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;plan&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pro&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;decision&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;decision&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;custom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;maxUploadSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;decision&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parsedValue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;maxUploadSizeMb&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A custom decision carries the value twice: &lt;code&gt;value&lt;/code&gt; as a raw string, and &lt;code&gt;parsedValue&lt;/code&gt; as the deserialized object when you enable &lt;code&gt;parseCustomEffect&lt;/code&gt;. The string is the canonical form — it's what gets signed — so whatever shape you put in there travels through the bundle untouched and comes out the other side exactly as you wrote it.&lt;/p&gt;

&lt;p&gt;That number used to be a &lt;code&gt;const&lt;/code&gt; in a config file, with a couple of &lt;code&gt;if&lt;/code&gt;s wrapped around it for the tenants that negotiated something different. Now it's a rule, in the same bundle as everything else, changed the same way.&lt;/p&gt;

&lt;p&gt;Once you can return values, the boundary between "feature flag system" and "business rules engine" stops being meaningful. It's the same lookup either way. The only difference is what comes back.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this leaves you
&lt;/h2&gt;

&lt;p&gt;I'm not going to pretend every conditional in your code should move. Most &lt;code&gt;if&lt;/code&gt; statements are control flow and belong exactly where they are.&lt;/p&gt;

&lt;p&gt;But some of them aren't. Some of them are business decisions that happen to be written in JavaScript — the ones somebody from finance or compliance would want to read, the ones that change on a different schedule than your code, the ones you'd want to flip in a hurry. Those are data pretending to be logic, and treating them as data makes the whole system easier to reason about.&lt;/p&gt;

&lt;p&gt;Govplane is &lt;a href="https://github.com/Govplane" rel="noopener noreferrer"&gt;MIT licensed&lt;/a&gt; and the bundle specification is public, so you can write and sign a bundle yourself without running any of our tooling. It runs entirely on your machine, in production, without an account. There's a hosted version for teams that want delivery and observability handled, but it's optional and most people won't need it.&lt;/p&gt;

&lt;p&gt;If you've got a &lt;code&gt;|| user.tenantId === 'acme-corp'&lt;/code&gt; sitting in your codebase right now, you already know which rules I'm talking about.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>opensource</category>
      <category>node</category>
      <category>softwareengineering</category>
    </item>
  </channel>
</rss>
