<?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: Jules Robineau</title>
    <description>The latest articles on DEV Community by Jules Robineau (@julesrobineau).</description>
    <link>https://dev.to/julesrobineau</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%2F4033931%2F6c7e37e2-5d4d-486b-81c8-591c267775cd.jpg</url>
      <title>DEV Community: Jules Robineau</title>
      <link>https://dev.to/julesrobineau</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/julesrobineau"/>
    <language>en</language>
    <item>
      <title>The security tool I was testing added itself to my agent config</title>
      <dc:creator>Jules Robineau</dc:creator>
      <pubDate>Fri, 13 Nov 2026 07:03:00 +0000</pubDate>
      <link>https://dev.to/julesrobineau/the-security-tool-i-was-testing-added-itself-to-my-agent-config-1hpg</link>
      <guid>https://dev.to/julesrobineau/the-security-tool-i-was-testing-added-itself-to-my-agent-config-1hpg</guid>
      <description>&lt;p&gt;In early October, I was comparing guardrails for my coding agent. One of them added itself to my configuration. It stayed active in all my sessions for about eight minutes.&lt;/p&gt;

&lt;p&gt;It was not malware. It was a documented feature. And that is exactly what made me think.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: any program that runs with your rights can change your AI agent's config. A hook added to &lt;code&gt;settings.json&lt;/code&gt; runs before every command, in every session. I saw it happen with dcg, a guardrail that registers itself again. Treat that file like a secret: backed up, compared, never changed in silence. And test unknown tools far from your real config.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This article is for developers and teams who use Claude Code or Codex on their own machines. You do not need to know hooks already: I explain them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The context: a test bench for guardrails
&lt;/h2&gt;

&lt;p&gt;A coding agent runs commands on your machine. A guardrail reads each command before it runs and blocks the dangerous ones, like &lt;code&gt;rm -rf ~&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In Claude Code, that guardrail takes the form of a hook. A hook is a command the agent runs automatically at a given moment, for example before each shell command. Hooks are declared in the file &lt;code&gt;~/.claude/settings.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The hook is part of the harness, the software around the model. I cover it in &lt;a href="https://jrobineau.com/en/blog/2026-10-21-what-is-an-agent-harness.html" rel="noopener noreferrer"&gt;the article on the harness&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;On 2 October, I tested three guardrails against 33 commands: 16 legitimate and 17 destructive. The bench has &lt;a href="https://jrobineau.com/en/blog/2026-11-04-ai-agent-guardrail-let-rm-rf-through.html" rel="noopener noreferrer"&gt;its own article&lt;/a&gt;. Here, I tell what happened on the side.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened
&lt;/h2&gt;

&lt;p&gt;One of the candidates is called dcg, short for &lt;em&gt;destructive command guard&lt;/em&gt;. It is an open source tool written in Rust. I tested version 0.15.2.&lt;/p&gt;

&lt;p&gt;The binary sat in a temporary folder of my session. I ran it once in hook mode, the way the agent would, without installing it.&lt;/p&gt;

&lt;p&gt;On that run, dcg wrote its own entry into my &lt;code&gt;~/.claude/settings.json&lt;/code&gt;. The entry pointed at the binary in the temporary folder. It did not ask me anything.&lt;/p&gt;

&lt;p&gt;A hook entry looks like this. The path is an example:&lt;/p&gt;

&lt;p&gt;This is the change to look for in a diff. The path is a generic example, not the one from my machine.&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="err"&gt;+&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/temporary-evaluation/dcg"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"PreToolUse"&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="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Bash"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"hooks"&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="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/path/to/temporary/folder/dcg"&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="p"&gt;]&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;From 08:17 to about 08:25, all my sessions sent their commands through that binary. Then I removed the entry and deleted its config folder, &lt;code&gt;~/.config/dcg&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  It is not malware, it is a feature
&lt;/h2&gt;

&lt;p&gt;The dcg documentation describes this behaviour. The tool has a &lt;code&gt;self_heal_hook&lt;/code&gt; option, on by default. Self-heal means the tool repairs itself.&lt;/p&gt;

&lt;p&gt;On every call in hook mode, dcg checks that its entry is still in &lt;code&gt;settings.json&lt;/code&gt;. If it is missing, it writes it back. Since version 0.7.7, it registers the absolute path of the binary that is running. In my case, that was the one in the temporary folder.&lt;/p&gt;

&lt;p&gt;The intent makes sense. A guardrail that another program can quietly remove does not protect much. The dcg docs say the option protects against a &lt;code&gt;settings.json&lt;/code&gt; overwritten during a session.&lt;/p&gt;

&lt;p&gt;The maintainers ran into the same case. According to the 0.14.0 changelog, their own tests could install the development binary as a global hook. They turned the feature off during tests with an environment variable.&lt;/p&gt;

&lt;p&gt;For you, the option turns off with &lt;code&gt;DCG_NO_SELF_HEAL=1&lt;/code&gt; or &lt;code&gt;self_heal_hook = false&lt;/code&gt; in its config.&lt;/p&gt;

&lt;p&gt;So my problem is not dcg. I ran a tool to evaluate it, and it changed the config of all my sessions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this file matters so much
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;settings.json&lt;/code&gt; holds more than preferences. It says which commands run before each agent action. It can also say which server your requests go to.&lt;/p&gt;

&lt;p&gt;The Claude Code docs are clear about hooks. They run shell commands with your full user permissions. They can read, change or delete any file your account can reach.&lt;/p&gt;

&lt;p&gt;The docs also say that direct edits to hooks are normally picked up automatically. No restart needed. So a single write to the file is enough to change how your sessions behave.&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fo0v051ajj0v525xddmco.png" class="article-body-image-wrapper"&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%2Farticles%2Fo0v051ajj0v525xddmco.png" alt="A tool writes a hook into settings.json, every session runs it" width="799" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Any program run with your rights can write your agent's config.&lt;/strong&gt; One write is enough, and every session applies it at once. Version the file and test unknown tools elsewhere.&lt;/p&gt;

&lt;p&gt;The hook's path matters too. A hook pointing at a temporary folder runs whatever sits there at the time of the call. If the file is gone, the docs say the action goes ahead with a plain error notice. The guardrail then blocks nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to spot a silent change
&lt;/h2&gt;

&lt;p&gt;There is no perfect recipe. Here is what I recommend, from simplest to strongest.&lt;/p&gt;

&lt;h3&gt;
  
  
  Put the file under version control
&lt;/h3&gt;

&lt;p&gt;The simplest step is to put the file under git. An allowlist keeps the rest of the folder out, since it holds session history and caches.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/.claude
git init
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'*\n!.gitignore\n!settings.json\n'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; .gitignore
git add .gitignore settings.json
git commit -m &lt;span class="s2"&gt;"agent config: baseline"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do the same in &lt;code&gt;~/.codex&lt;/code&gt; with &lt;code&gt;config.toml&lt;/code&gt; and &lt;code&gt;hooks.json&lt;/code&gt;. From then on, &lt;code&gt;git diff&lt;/code&gt; shows you exactly what changed, line by line.&lt;/p&gt;

&lt;p&gt;Never push that repository to a server. &lt;code&gt;settings.json&lt;/code&gt; can hold keys in its &lt;code&gt;env&lt;/code&gt; section. A committed secret stays in the history, even after you delete it. I cover that in &lt;a href="https://jrobineau.com/en/blog/2026-10-14-ghostaction-deleted-secret-still-in-git-history.html" rel="noopener noreferrer"&gt;the article on GhostAction&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check every time you open a terminal
&lt;/h3&gt;

&lt;p&gt;A check stored in the file it watches can disappear with it. Better to put it somewhere else, for example in your shell startup. This line in &lt;code&gt;~/.bashrc&lt;/code&gt; or &lt;code&gt;~/.zshrc&lt;/code&gt; warns you when the file has moved:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git -C ~/.claude diff --quiet HEAD -- settings.json &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"settings.json changed: git -C ~/.claude diff"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Listen for changes during the session
&lt;/h3&gt;

&lt;p&gt;Claude Code has a hook event made for this, called &lt;code&gt;ConfigChange&lt;/code&gt;. It fires when a settings file changes during a session. The docs suggest it for auditing or blocking those changes. This example logs the time of each change:&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="nl"&gt;"ConfigChange"&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="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user_settings"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"hooks"&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="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"date -Is &amp;gt;&amp;gt; ~/.claude/config-changes.log"&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="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It has two limits. Blocking only stops the current session from applying the change. The file stays modified on disk. And a block shows no message, neither to you nor to the agent.&lt;/p&gt;

&lt;h3&gt;
  
  
  Review your hooks
&lt;/h3&gt;

&lt;p&gt;In Claude Code, the &lt;code&gt;/hooks&lt;/code&gt; command opens a read-only list. It shows each hook, what it runs and the file that declares it. On the command line, &lt;code&gt;jq&lt;/code&gt; prints the list of commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;jq -r &lt;span class="s1"&gt;'.hooks[]?[].hooks[].command'&lt;/span&gt; ~/.claude/settings.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For each line, ask two questions. Do I recognize this command? Is its path stable, outside &lt;code&gt;/tmp&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;Also look at the &lt;code&gt;.claude/settings.json&lt;/code&gt; of the repositories you clone. The docs warn that in &lt;code&gt;claude -p&lt;/code&gt; mode, those hooks run without any trust dialog.&lt;/p&gt;

&lt;p&gt;Codex does better here. It records a fingerprint of each approved hook. A new or changed hook is set aside until you approve it in &lt;code&gt;/hooks&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That review covers hooks. Also review changes to the sandbox and the server address.&lt;/p&gt;

&lt;h3&gt;
  
  
  File permissions are not enough
&lt;/h3&gt;

&lt;p&gt;You can make the file read-only with &lt;code&gt;chmod 444&lt;/code&gt;. That blocks a direct write. It does not block a replacement.&lt;/p&gt;

&lt;p&gt;Many tools write a copy, then rename it over the original. That rename depends on the folder's permissions, not the file's. According to its changelog, dcg rewrites &lt;code&gt;settings.json&lt;/code&gt; exactly this way.&lt;/p&gt;

&lt;p&gt;And locking the whole &lt;code&gt;~/.claude&lt;/code&gt; folder would break Claude Code, which stores its sessions there. Permissions slow things down. They are not a barrier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test unknown tools far from your real config
&lt;/h2&gt;

&lt;p&gt;Detection tells you a change happened. Isolation keeps it from reaching your real config.&lt;/p&gt;

&lt;p&gt;Claude Code reads its config folder from the &lt;code&gt;CLAUDE_CONFIG_DIR&lt;/code&gt; variable when it is set. According to its docs, dcg honours it too. For a trial run, point it at a throwaway folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;CLAUDE_CONFIG_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"$(mktemp -d)"&lt;/span&gt; ./tool-under-test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That variable only protects you from tools that read it. A tool can hard-code &lt;code&gt;~/.claude&lt;/code&gt;. Changing &lt;code&gt;HOME&lt;/code&gt; removes no file permissions. For an unknown tool, use an isolated environment with no access to your real configuration.&lt;/p&gt;

&lt;p&gt;Also turn off automatic write features when the tool documents them, like &lt;code&gt;DCG_NO_SELF_HEAL=1&lt;/code&gt; for dcg.&lt;/p&gt;

&lt;p&gt;My rule since that incident is simple. I do not run dcg again without isolating it. And before plugging in my new guardrail, I had kept a dated copy of &lt;code&gt;settings.json&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Your agent's config is code that runs. Nobody should change it without you seeing it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[ ] List your agents' config files: &lt;code&gt;~/.claude/settings.json&lt;/code&gt;, &lt;code&gt;~/.codex/config.toml&lt;/code&gt;, &lt;code&gt;~/.codex/hooks.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] Version them locally with an allowlist, and never push that repository&lt;/li&gt;
&lt;li&gt;[ ] Add a &lt;code&gt;git diff --quiet&lt;/code&gt; check to your shell startup&lt;/li&gt;
&lt;li&gt;[ ] Log settings changes with a &lt;code&gt;ConfigChange&lt;/code&gt; hook&lt;/li&gt;
&lt;li&gt;[ ] Review your hooks with &lt;code&gt;/hooks&lt;/code&gt;: known command, stable path, nothing in &lt;code&gt;/tmp&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] Search your config files for &lt;code&gt;danger-full-access&lt;/code&gt; and unknown server addresses&lt;/li&gt;
&lt;li&gt;[ ] Test an unknown tool in an isolated environment with no access to your real configuration&lt;/li&gt;
&lt;li&gt;[ ] Check staged changes too with &lt;code&gt;git diff HEAD&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What to remember
&lt;/h2&gt;

&lt;p&gt;dcg did what its docs say. The lesson is not about one tool. It is about a habit.&lt;/p&gt;

&lt;p&gt;A file that decides what your agent runs deserves the same care as your code. You back it up, you compare its versions, and you know who touched it last.&lt;/p&gt;

&lt;p&gt;Do you want to check what runs with your agents' rights across your team? &lt;a href="https://jrobineau.com/en/contact.html" rel="noopener noreferrer"&gt;Let's talk&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://github.com/Dicklesworthstone/destructive_command_guard/blob/main/config.schema.json" rel="noopener noreferrer"&gt;dcg, self_heal_hook option&lt;/a&gt; · &lt;a href="https://github.com/Dicklesworthstone/destructive_command_guard/blob/main/CHANGELOG.md" rel="noopener noreferrer"&gt;dcg, changelog&lt;/a&gt; · &lt;a href="https://code.claude.com/docs/en/hooks" rel="noopener noreferrer"&gt;Claude Code, hooks&lt;/a&gt; · &lt;a href="https://code.claude.com/docs/en/setup" rel="noopener noreferrer"&gt;Claude Code, updates&lt;/a&gt; · &lt;a href="https://developers.openai.com/codex/hooks" rel="noopener noreferrer"&gt;Codex, hooks&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>coding</category>
      <category>llm</category>
      <category>security</category>
    </item>
    <item>
      <title>Your product depends on one AI provider: when it cuts you off, what does your code do?</title>
      <dc:creator>Jules Robineau</dc:creator>
      <pubDate>Thu, 12 Nov 2026 07:03:00 +0000</pubDate>
      <link>https://dev.to/julesrobineau/your-product-depends-on-one-ai-provider-when-it-cuts-you-off-what-does-your-code-do-3j0k</link>
      <guid>https://dev.to/julesrobineau/your-product-depends-on-one-ai-provider-when-it-cuts-you-off-what-does-your-code-do-3j0k</guid>
      <description>&lt;p&gt;On October 28, an internal tool I wrote for my own prospecting stopped drafting. The provider was not down. My claude.ai login had expired. Every call failed with "401 OAuth access token has expired". An API key was configured right next to it. My code never tried it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: an AI provider goes down, changes its quotas or refuses your login. Your product must not go down with it. Send every AI call through one router. Give it several backends in a stable order. When a backend refuses the login, bench it for ten minutes. The next one takes over, and nobody has to redeploy.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Incidents and versions: snapshot as of November 3, 2026.&lt;/p&gt;

&lt;p&gt;This article is for developers and product teams whose code calls a language model.&lt;/p&gt;

&lt;h2&gt;
  
  
  The provider lets you down more often than you think
&lt;/h2&gt;

&lt;p&gt;Look at the history on status.claude.com. On October 24 and 25, it lists five "Elevated errors" incidents on several models. Each one lasted between ten and thirty-five minutes. Thirty minutes is short for a provider. For your user, it is a button that stops answering.&lt;/p&gt;

&lt;p&gt;On October 1, the incident was of another kind. Credit purchases were slow to show up in account balances. Requests failed for "insufficient credit balance". The incident stayed open from 16:20 to 22:36 UTC. Your code had no bug. It got errors anyway.&lt;/p&gt;

&lt;p&gt;The Claude API documentation lists the cases. A 401 means your key is malformed, revoked or expired. A 429 means you hit a rate limit or a spend cap. A 529 means the API is overloaded. Three different causes, one result: your feature returns nothing.&lt;/p&gt;

&lt;p&gt;A serious product needs a &lt;strong&gt;degraded mode&lt;/strong&gt;. That is a state where your product delivers a reduced service instead of an error. For an AI feature, the simplest degraded mode is another provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  On October 28, my router picked the backend that no longer worked
&lt;/h2&gt;

&lt;p&gt;My tool runs on a Rust backend. It calls a model to classify messages, qualify emails, draft replies and summarize threads. An &lt;strong&gt;AI backend&lt;/strong&gt; here is one model provider my code knows how to call. The tool knows four: the Claude Code &lt;a href="https://en.wikipedia.org/wiki/Command-line_interface" rel="noopener noreferrer"&gt;CLI&lt;/a&gt;, the Anthropic API, the OpenAI API and a local Ollama.&lt;/p&gt;

&lt;p&gt;The Claude Code CLI is the default backend. It bills my subscription, not each request. It is the cheapest provider for a tool only I use.&lt;/p&gt;

&lt;p&gt;That morning, my claude.ai login had expired. An &lt;a href="https://en.wikipedia.org/wiki/OAuth" rel="noopener noreferrer"&gt;OAuth&lt;/a&gt; login is a time-limited authorization. When it expires, a human has to sign in again. The CLI wrote the error inside its JSON stream on standard output. Then it exited with code 1 and an empty standard error.&lt;/p&gt;

&lt;p&gt;My router did not look at that result. It saw the CLI installed, so available. It picked it on every call. Drafts, rewrites and CV and dossier generation all broke. An Anthropic API key was configured in the settings. It was never used.&lt;/p&gt;

&lt;p&gt;The fix comes down to two ideas. A refused login benches the CLI for ten minutes. And the router moves on to the next backend while the bench lasts.&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fx8vcxfj4x27pu11qal0p.png" class="article-body-image-wrapper"&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%2Farticles%2Fx8vcxfj4x27pu11qal0p.png" alt="One router, four AI backends in a stable order" width="799" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The backend that refuses the login is benched, the next one takes over.&lt;/strong&gt; Every feature goes through the router. A timeout or a rate limit benches nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  One entry point for every AI call
&lt;/h2&gt;

&lt;p&gt;Every AI feature in the tool goes through one method: &lt;code&gt;Clients::ai(settings)&lt;/code&gt;. It returns the backend to use for this call. Nothing calls a provider directly. That is what makes the fix possible: a rule written once protects every feature.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;ai_provider&lt;/code&gt; setting picks the primary provider. The others follow in a stable order:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;match&lt;/span&gt; &lt;span class="n"&gt;settings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ai_provider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;as_str&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="s2"&gt;"anthropic_api"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"anthropic_api"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"claude_code"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"openai"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"ollama"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"openai"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"openai"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"claude_code"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"anthropic_api"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"ollama"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"ollama"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"ollama"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"claude_code"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"anthropic_api"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"openai"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;// Default: the Claude Code CLI (subscription billing).&lt;/span&gt;
    &lt;span class="n"&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="s2"&gt;"claude_code"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"anthropic_api"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"openai"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"ollama"&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="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every client is optional. Without its environment variable, the client does not exist and the feature is off. Boot logs it once, then stays quiet. Ollama only joins the rotation if a five-second ping succeeded at boot.&lt;/p&gt;

&lt;p&gt;A sibling method, &lt;code&gt;ai_availability()&lt;/code&gt;, tells the settings screen which backends are usable right now. The user sees what the router sees. A provider that is down is not a surprise at click time.&lt;/p&gt;

&lt;p&gt;This router is part of the harness, the code around the model. I covered it in &lt;a href="https://jrobineau.com/en/blog/2026-10-21-what-is-an-agent-harness.html" rel="noopener noreferrer"&gt;the article on the harness&lt;/a&gt;: the harness decides what the model sees. Here, it also decides which model answers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Only a refused login benches a backend
&lt;/h2&gt;

&lt;p&gt;The CLI client keeps one date: the last time its login was refused. Two constants and one function are enough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="c1"&gt;/// Hard cap on a CLI invocation.&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="no"&gt;EXEC_TIMEOUT&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Duration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Duration&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;from_secs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;/// How long the router leaves the CLI out after its login was refused.&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="no"&gt;AUTH_BENCH&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Duration&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Duration&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;from_secs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;600&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;/// True when the CLI failed because its claude.ai login is missing or expired.&lt;/span&gt;
&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;is_auth_failure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Failed to authenticate"&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;&lt;code&gt;signed_in()&lt;/code&gt; returns false for &lt;code&gt;AUTH_BENCH&lt;/code&gt; after a refusal. The router skips the CLI while it is false. The next backend, usually the API key, takes over. A successful call clears the date. The CLI is back in the rotation without a restart.&lt;/p&gt;

&lt;p&gt;Only one kind of error triggers the bench. A timeout or a rate limit does not. The reason is simple. A timeout may pass on the next call. A rate limit lifts on its own. A refused login does not: it will refuse every call until a human signs in again.&lt;/p&gt;

&lt;p&gt;That is why the bench lasts ten minutes. Long enough to cover the calls coming in. Short enough to retry without anyone stepping in. It is a &lt;a href="https://en.wikipedia.org/wiki/Circuit_breaker_design_pattern" rel="noopener noreferrer"&gt;circuit breaker&lt;/a&gt; cut down to one case. I did not count errors or compute a rate. A date and a comparison are enough.&lt;/p&gt;

&lt;h2&gt;
  
  
  The test replays the real outage
&lt;/h2&gt;

&lt;p&gt;The unit test replaces the CLI with a shell script. The script mimics what the real CLI returned on October 28. A JSON result with the error message, then exit code 1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/sh&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; -f ok &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s\n'&lt;/span&gt; &lt;span class="s1"&gt;'{"result":"fine"}'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt; 0&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'%s\n'&lt;/span&gt; &lt;span class="s1"&gt;'{"type":"result","result":"Failed to authenticate. API Error: 401 OAuth access token has expired. Re-authenticate to continue."}'&lt;/span&gt;
&lt;span class="nb"&gt;exit&lt;/span&gt; 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The test &lt;code&gt;an_expired_login_benches_the_cli_until_a_run_succeeds&lt;/code&gt; does three things. It checks that the client believes it is signed in at first. It runs the script, sees the error and checks that &lt;code&gt;signed_in()&lt;/code&gt; turned false. Then it creates the &lt;code&gt;ok&lt;/code&gt; file, runs the script again and checks that &lt;code&gt;signed_in()&lt;/code&gt; is true again.&lt;/p&gt;

&lt;p&gt;A second test, &lt;code&gt;other_cli_failures_keep_the_cli_in_the_rotation&lt;/code&gt;, protects the other half of the rule. It feeds three messages to &lt;code&gt;is_auth_failure&lt;/code&gt;. The message "Failed to authenticate. API Error: 401 OAuth access token has expired." returns true. "claude timed out after 600 s" returns false. "rate limit reached" returns false too.&lt;/p&gt;

&lt;p&gt;Here is the useful part. The test holds the real output of the real incident. If the CLI ever changes its message, the test breaks before my product does.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same rule in Go
&lt;/h2&gt;

&lt;p&gt;This blog is mostly about Go, so here is the same pattern in Go. An interface for the backends, a slice in a stable order, one bench date per backend.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Backend is one AI provider the product knows how to call.&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;Backend&lt;/span&gt; &lt;span class="k"&gt;interface&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="nc"&gt;Generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// ErrAuth marks a refused login. Only this error benches a backend.&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nc"&gt;ErrAuth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"login refused"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;Router&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;backends&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nc"&gt;Backend&lt;/span&gt; &lt;span class="c1"&gt;// stable order, primary first&lt;/span&gt;
    &lt;span class="n"&gt;bench&lt;/span&gt;    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Duration&lt;/span&gt;
    &lt;span class="n"&gt;mu&lt;/span&gt;       &lt;span class="n"&gt;sync&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Mutex&lt;/span&gt;
    &lt;span class="n"&gt;until&lt;/span&gt;    &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Time&lt;/span&gt; &lt;span class="c1"&gt;// backend name -&amp;gt; benched until&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nc"&gt;NewRouter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bench&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Duration&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;backends&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="nc"&gt;Backend&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nc"&gt;Router&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nc"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;backends&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;backends&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bench&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;bench&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;until&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Time&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="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nc"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nc"&gt;Generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"no AI backend available"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;backends&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;benched&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Name&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="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
        &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Name&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="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Time&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="c1"&gt;// a success clears the bench&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Is&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ErrAuth&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Name&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="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Now&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="nc"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bench&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="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nc"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;benched&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Lock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Unlock&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="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Now&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="nc"&gt;Before&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;until&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;name&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;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nc"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;until&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Time&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Lock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Unlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;until&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;until&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each adapter translates its own refusal into &lt;code&gt;ErrAuth&lt;/code&gt;. For the CLI, that is the "Failed to authenticate" message. For the API, that is a 401 &lt;code&gt;authentication_error&lt;/code&gt;. The adapter returns &lt;code&gt;fmt.Errorf("%w: %v", ErrAuth, err)&lt;/code&gt;. The router never needs to know the providers.&lt;/p&gt;

&lt;p&gt;This version goes one step further than my Rust. When a backend fails, it tries the next one in the same call. My tool returns the error of the first refused call. Only the following calls go to the API key. Both work. The Go version avoids one visible error.&lt;/p&gt;

&lt;h2&gt;
  
  
  A gateway is one more dependency
&lt;/h2&gt;

&lt;p&gt;You can also buy this router. An &lt;a href="https://en.wikipedia.org/wiki/API_gateway" rel="noopener noreferrer"&gt;LLM gateway&lt;/a&gt; talks to dozens of providers, measures costs and fails over on its own. That is useful when you have many providers and many teams.&lt;/p&gt;

&lt;p&gt;But a gateway sees every one of your keys go by. On October 21, 2026, version 1.107.0 of LiteLLM, one of those gateways, was published on PyPI with a credential stealer. It collected system, browser, cloud and AI tool secrets, then sent them to an external domain. The version was pulled in under three hours. Anyone who installed it in that window has to rotate every key.&lt;/p&gt;

&lt;p&gt;The suspected cause deserves a pause. According to LiteLLM, a coding agent could write the user's GitHub token into a response body. And the gateway logged those response bodies. The token ended up in the logs. The component that centralizes your AI calls also centralizes what leaks.&lt;/p&gt;

&lt;p&gt;This is not a verdict against gateways. It is a reminder: every component between your code and the provider is a dependency that holds your secrets. My tool has four clients and a router of about sixty lines. For a product with two or three backends, that is often enough.&lt;/p&gt;

&lt;p&gt;And the less you call the model, the less you depend on the provider. I wrote about why you should &lt;a href="https://jrobineau.com/en/blog/put-the-llm-last.html" rel="noopener noreferrer"&gt;put the LLM last&lt;/a&gt; in the pipeline. A router protects the calls that remain.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;An AI provider is a dependency that fails. Code as if that were true.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Send every AI call through one function&lt;/li&gt;
&lt;li&gt;[ ] Declare the backends in a list, in a stable order&lt;/li&gt;
&lt;li&gt;[ ] Make every backend optional: no key, no client, one log line at boot&lt;/li&gt;
&lt;li&gt;[ ] Detect the refused login: 401, "Failed to authenticate", expired key&lt;/li&gt;
&lt;li&gt;[ ] Bench that backend for a fixed time, and skip it in the router&lt;/li&gt;
&lt;li&gt;[ ] Never bench on a timeout or a rate limit: retry&lt;/li&gt;
&lt;li&gt;[ ] Put the backend back in play as soon as one call succeeds&lt;/li&gt;
&lt;li&gt;[ ] Show the user which backends are available right now&lt;/li&gt;
&lt;li&gt;[ ] Replay the real output of the real outage in a test&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;An AI provider goes down, changes its quotas or refuses your login. The question is not if, but when. On that day, your code has two options: return an error, or move to the next backend. The second one costs a router, a list and a date.&lt;/p&gt;

&lt;p&gt;Open your code and look for the places that call a provider directly. Each one is a feature that will go down with it.&lt;/p&gt;

&lt;p&gt;Want an outside look at the reliability of your AI features? See &lt;a href="https://jrobineau.com/en/services.html" rel="noopener noreferrer"&gt;my services&lt;/a&gt;, or &lt;a href="https://jrobineau.com/en/contact.html" rel="noopener noreferrer"&gt;let's talk&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://status.claude.com/history" rel="noopener noreferrer"&gt;Incident history, status.claude.com&lt;/a&gt; · &lt;a href="https://status.claude.com/incidents/k0h22tsvnydg" rel="noopener noreferrer"&gt;Incident "Delayed credits on the Claude Platform", October 1, 2026&lt;/a&gt; · &lt;a href="https://status.claude.com/incidents/334jvgbrc4ff" rel="noopener noreferrer"&gt;Incident "Elevated errors for Claude Sonnet 5.5 and other models", October 25, 2026&lt;/a&gt; · &lt;a href="https://platform.claude.com/docs/en/api/errors" rel="noopener noreferrer"&gt;Claude API documentation, error codes&lt;/a&gt; · &lt;a href="https://thehackernews.com/2026/10/litellm-suspects-github-token-leak-in.html" rel="noopener noreferrer"&gt;The Hacker News, LiteLLM 1.107.0 compromise (October 22, 2026)&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>ai</category>
      <category>llm</category>
      <category>rust</category>
    </item>
    <item>
      <title>MFA decides who gets in, not how many records they take</title>
      <dc:creator>Jules Robineau</dc:creator>
      <pubDate>Wed, 11 Nov 2026 07:03:00 +0000</pubDate>
      <link>https://dev.to/julesrobineau/mfa-decides-who-gets-in-not-how-many-records-they-take-36gh</link>
      <guid>https://dev.to/julesrobineau/mfa-decides-who-gets-in-not-how-many-records-they-take-36gh</guid>
      <description>&lt;p&gt;Since summer 2025, several major French data leaks have followed a similar pattern. No technical flaw is put forward. A valid account logs in. Then it reads tens or even hundreds of thousands of records.&lt;/p&gt;

&lt;p&gt;After each leak, someone promises MFA everywhere. That is necessary. But MFA checks who logs in. It says nothing about how many records that account reads next.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: incidents at France Travail and SFR show the risk of compromised accounts. MFA strengthens authentication, but does not count records read. First narrow what an account can see. Then give it a read budget per hour, and alert as soon as it runs over.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This article is for developers and CTOs whose app, back office or API holds customer records. No security background needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Separate confirmed incidents from a claim
&lt;/h2&gt;

&lt;p&gt;This snapshot separates statements from the organizations and third-party accounts, as of October 31, 2026.&lt;/p&gt;

&lt;p&gt;These cases motivate volume checks after login. They do not all establish the same attack path. A valid account can expose far more data than its usual activity requires.&lt;/p&gt;

&lt;h2&gt;
  
  
  MFA guards the door, not what walks out
&lt;/h2&gt;

&lt;p&gt;MFA, multi-factor authentication, asks for a second proof on top of the password. A code on your phone, for example. It is the best defence against password theft. You need it everywhere.&lt;/p&gt;

&lt;p&gt;After July 2025, France Travail said it would speed up two-factor authentication on the affected tool. After the tax leak, the tax administration planned stronger authentication for all its staff by the end of 2026. That is the right first answer.&lt;/p&gt;

&lt;p&gt;MFA can also be required again for a sensitive action. On its own, though, it does not count the records read. Three cases show why that check matters.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A stolen session.&lt;/strong&gt; Credential-stealing malware can also steal &lt;a href="https://en.wikipedia.org/wiki/HTTP_cookie" rel="noopener noreferrer"&gt;session cookies&lt;/a&gt; from the browser. Those cookies have already passed MFA.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An account created by another account.&lt;/strong&gt; In December 2025, the attacker's two accounts were created with the rights of a real account. MFA checks the person. It does not tell you whether the account should exist.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A legitimate account that reads too much.&lt;/strong&gt; A badly tuned script, an export started by mistake. MFA strengthens identity checks. It does not prove the volume is normal.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In all three cases, each request on its own looks normal. The account is logged in, it has the right, the app answers. The missing question is "how many?".&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fjy6kg3lixt1vfimf6spr.png" class="article-body-image-wrapper"&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%2Farticles%2Fjy6kg3lixt1vfimf6spr.png" alt="Three questions between a stolen account and your records" width="800" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A stolen account passes MFA and the permissions, only a budget counts records.&lt;/strong&gt; Each answer on its own is correct. The third question sets the size of the leak.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add volume to your access checks
&lt;/h2&gt;

&lt;p&gt;After login comes authorization. That is the code that decides whether this account can read this record. Two models dominate. &lt;a href="https://en.wikipedia.org/wiki/Role-based_access_control" rel="noopener noreferrer"&gt;RBAC&lt;/a&gt; decides by role. &lt;a href="https://en.wikipedia.org/wiki/Attribute-based_access_control" rel="noopener noreferrer"&gt;ABAC&lt;/a&gt; decides by attributes: who asks, for which resource, in which context.&lt;/p&gt;

&lt;p&gt;I know both well. I built an ABAC system for application permissions. On an earlier contract, I coded role-based access to records.&lt;/p&gt;

&lt;p&gt;Both models evaluate one request at a time. Can this account read this record? Yes. And the next one? Yes again. If the account may read the whole directory, the rule says yes 62,848 times. Every answer is correct.&lt;/p&gt;

&lt;p&gt;A classic permission rule keeps no memory of past requests. It does not know this account has read 40,000 records since noon. A volume check needs a counter, including when an ABAC policy uses that counter.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://jrobineau.com/en/blog/2026-09-21-abac-in-production-what-breaks.html" rel="noopener noreferrer"&gt;my article on ABAC in production&lt;/a&gt;, the worst danger was a code path that never asks for permission. An export, a batch job, an admin tool. Volume is the same problem, one step further. Even when every path asks, nobody counts the answers.&lt;/p&gt;

&lt;h2&gt;
  
  
  First, no account should be able to read everything
&lt;/h2&gt;

&lt;p&gt;Start with the scope of permissions. Before you count, shrink what an account can see. An account that can read everything turns every credential theft into a full leak.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Limit each account to its own scope. A salesperson sees their customers, not the whole company's. A partner sees the files entrusted to them.&lt;/li&gt;
&lt;li&gt;Separate the right to create accounts. In December 2025, one account was enough to open two more. An account that hands out access deserves its own monitoring.&lt;/li&gt;
&lt;li&gt;Cap the page size. An API that accepts &lt;code&gt;?limit=100000&lt;/code&gt; offers a full export to anyone with an account.&lt;/li&gt;
&lt;li&gt;Make bulk export a separate right. Reading one record on screen and downloading the whole file are not the same need.&lt;/li&gt;
&lt;li&gt;Give internal tools a read-only database account, limited to a few views. I covered that in &lt;a href="https://jrobineau.com/en/blog/2026-10-09-metabase-leak-internal-tools-exposed.html" rel="noopener noreferrer"&gt;the article on the Metabase leak&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These rules shrink the size of a leak. They still do not tell you when an account reads too much.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give every account a read budget
&lt;/h2&gt;

&lt;p&gt;A read budget is the maximum number of records an account can read per hour. Beyond it, the app refuses and warns someone. After the tax leak, the French government floated the same idea: quotas on data access, everywhere.&lt;/p&gt;

&lt;p&gt;Count records, not requests. A classic rate limiter counts calls per minute and blocks beyond that. But a single call with a large page can return 10,000 records. What leaks is the volume.&lt;/p&gt;

&lt;p&gt;Here is an example in Go. It is a generic, deliberately short example, not production code. It uses a middleware. A middleware is a function placed in front of your HTTP handlers. It sees every request and can refuse it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Example only: a read budget per account, counted in records, not requests.&lt;/span&gt;
&lt;span class="c1"&gt;// shortcut: single-instance counters; use atomic shared counters before scaling out.&lt;/span&gt;
&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;ReadBudget&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;mu&lt;/span&gt;     &lt;span class="n"&gt;sync&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Mutex&lt;/span&gt;
    &lt;span class="n"&gt;limit&lt;/span&gt;  &lt;span class="kt"&gt;int&lt;/span&gt;           &lt;span class="c1"&gt;// records per account per window&lt;/span&gt;
    &lt;span class="n"&gt;window&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Duration&lt;/span&gt; &lt;span class="c1"&gt;// for example one hour&lt;/span&gt;
    &lt;span class="n"&gt;counts&lt;/span&gt; &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;reset&lt;/span&gt;  &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Time&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Spend reserves n records for the account. False means the budget is spent.&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nc"&gt;ReadBudget&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nc"&gt;Spend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Lock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mu&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Unlock&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="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Now&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="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;After&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reset&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;counts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;window&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="n"&gt;account&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;counts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;account&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="kc"&gt;false&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;counts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// The handler must use the supplied limit in its database query.&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nc"&gt;ReadBudget&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nc"&gt;Middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Handler&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;HandlerFunc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nc"&gt;AccountID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Context&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="c1"&gt;// set earlier by the auth middleware&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"authentication required"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;StatusUnauthorized&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nf"&gt;pageSize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Spend&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;slog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Warn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"read budget exceeded"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"account"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"size"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"read limit reached"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;StatusTooManyRequests&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&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="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;size&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="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// pageSize validates the requested reservation; the handler enforces it.&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;pageSize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;strconv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Atoi&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;URL&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Query&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="nc"&gt;Get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"limit"&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="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&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;What this example does:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The account identity comes from the authentication middleware, never from a request parameter.&lt;/li&gt;
&lt;li&gt;The budget reserves at most 100 records. It passes that limit to the handler, which must use it in SQL.&lt;/li&gt;
&lt;li&gt;Over budget, the app answers &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429" rel="noopener noreferrer"&gt;429&lt;/a&gt; and writes a warning to the logs.&lt;/li&gt;
&lt;li&gt;With a budget of 250 records and pages of 100, two requests pass. The third gets a 429.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The handler receives the validated limit. It never reads &lt;code&gt;?limit=&lt;/code&gt; again. The SQL query uses that number without returning to the raw parameter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c1"&gt;// db is the application's *sql.DB; auth has already populated AccountID.&lt;/span&gt;
&lt;span class="n"&gt;handler&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;budget&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ResponseWriter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;QueryContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Context&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="sb"&gt;`SELECT id FROM records WHERE owner_id = $1 ORDER BY id LIMIT $2`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nc"&gt;AccountID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Context&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="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"read failed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;StatusInternalServerError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;defer&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;ids&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;make&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="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Next&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="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Scan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"read failed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;StatusInternalServerError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;ids&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;id&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="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Err&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="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"read failed"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;StatusInternalServerError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Header&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="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Content-Type"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"application/json"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NewEncoder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;slog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"write response"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&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="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reserve a page per call, even if the database returns fewer rows. This is a conservative bound, not an exact count. With a 250-record budget, three requests for 100,000 produce two 100-record pages, then a 429. Test both the returned row count and the charged budget. Full exports need a separate, authorized and logged path.&lt;/p&gt;

&lt;p&gt;The example has two known limits. The window is fixed, so an account can read up to twice the budget at the edge between two windows. And the counters live in memory. With several instances, keep them in &lt;a href="https://en.wikipedia.org/wiki/Redis" rel="noopener noreferrer"&gt;Redis&lt;/a&gt;, or each instance gets its own budget.&lt;/p&gt;

&lt;h2&gt;
  
  
  Alert first, block later
&lt;/h2&gt;

&lt;p&gt;A badly tuned block breaks your teams' work. So start by alerting. The same counter serves both, with two thresholds.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A low alert threshold. It warns the team without blocking anything.&lt;/li&gt;
&lt;li&gt;A higher block threshold. Depending on risk, it waits for the next window or requires human review. The latter needs a separate blocked state.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The delay matters as much as the threshold. According to Cyberattaque.org, several days reportedly passed between the extraction of the claimed records and the blocking of the access. A volume alert fires as soon as the counter runs over.&lt;/p&gt;

&lt;p&gt;A few simple signals already cover a lot of cases.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An account that reads far more than its usual volume over the last 30 days.&lt;/li&gt;
&lt;li&gt;An account created this week that already reads a lot.&lt;/li&gt;
&lt;li&gt;An account that creates other accounts, especially outside usual hours.&lt;/li&gt;
&lt;li&gt;An account that walks through records page after page, in ID order.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Send these alerts where someone reads them. A &lt;a href="https://en.wikipedia.org/wiki/Security_information_and_event_management" rel="noopener noreferrer"&gt;SIEM&lt;/a&gt; if you have one, otherwise a team channel. An alert nobody reads protects nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pick your thresholds from your own logs
&lt;/h2&gt;

&lt;p&gt;A good threshold is measured, not guessed. For two to four weeks, count the records read per account and per hour, without blocking anything.&lt;/p&gt;

&lt;p&gt;Then look at the heaviest readers of a normal week. Put the alert threshold just above them. Put the block threshold well above, where no normal use ever goes.&lt;/p&gt;

&lt;p&gt;One threshold per role works better than a single one. Customer support, a manager and a sync job do not have the same needs. Technical accounts get their own budget too.&lt;/p&gt;

&lt;p&gt;Finally, plan a clean way out. A real need for a bulk export does come up. It then goes through an approved, logged request, not a loop over the API.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;An account may read a record. Your code decides how many.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[ ] MFA everywhere, partner and contractor accounts included&lt;/li&gt;
&lt;li&gt;[ ] Every account limited to its scope, no human account that can read everything&lt;/li&gt;
&lt;li&gt;[ ] The right to create accounts kept separate, with an alert on each creation&lt;/li&gt;
&lt;li&gt;[ ] A capped page size on every list route&lt;/li&gt;
&lt;li&gt;[ ] Bulk export as a separate right, approved and logged&lt;/li&gt;
&lt;li&gt;[ ] A counter of records read per account and per hour&lt;/li&gt;
&lt;li&gt;[ ] Two thresholds measured on your logs, alert first, block second&lt;/li&gt;
&lt;li&gt;[ ] A budget per role, technical accounts included&lt;/li&gt;
&lt;li&gt;[ ] Alerts sent where someone reads them&lt;/li&gt;
&lt;li&gt;[ ] A test that reads past the budget and expects a 429&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What to remember
&lt;/h2&gt;

&lt;p&gt;MFA answers "who are you?". Your permissions answer "may you read this record?". A third question is missing. It sets the size of the leak: "how many have you read?".&lt;/p&gt;

&lt;p&gt;One day, a stolen account will get through the door. On that day, the gap between a few hundred records and 1.6 million is decided in your code. A counter and two thresholds are a good start.&lt;/p&gt;

&lt;p&gt;Want to know how many records a single account can pull out of your app? &lt;a href="https://jrobineau.com/en/contact.html" rel="noopener noreferrer"&gt;Let's talk&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://www.it-connect.fr/cyberattaque-france-travail-les-donnees-personnelles-de-340-000-personnes-exposees/" rel="noopener noreferrer"&gt;IT-Connect, France Travail and 340,000 job seekers (July 2025, in French)&lt;/a&gt; · &lt;a href="https://www.francetravail.org/files/live/sites/peorg/files/documents/Communiqu%c3%a9%20de%20presse/2025/20251201-%20CP%20-%20Le%20r%c3%a9seau%20des%20Missions%20locales%20et%20France%20Travail%20victimes%20dune%20cyberattaque.pdf" rel="noopener noreferrer"&gt;France Travail, press release of 1 December 2025 (in French)&lt;/a&gt; · &lt;a href="https://www.it-connect.fr/nouvelle-fuite-de-donnees-chez-france-travail-les-donnees-de-1-6-million-de-jeunes-en-peril/" rel="noopener noreferrer"&gt;IT-Connect, 1.6 million young people (December 2025, in French)&lt;/a&gt; · &lt;a href="https://www.it-connect.fr/sfr-fuite-donnees-abonnes-fibre-nova/" rel="noopener noreferrer"&gt;IT-Connect, SFR confirms a data leak (August 2026, in French)&lt;/a&gt; · &lt;a href="https://www.cyberattaque.org/france-travail-62-848-fiches-dagents-revendiquees-apres-une-nouvelle-cyberattaque/" rel="noopener noreferrer"&gt;Cyberattaque.org, 62,848 staff records claimed (October 2026, in French)&lt;/a&gt; · &lt;a href="https://www.journaldunet.com/cybersecurite/1553815-cyberattaque-de-la-dgfip-l-electrochoc-qui-accelere-la-securisation-des-administrations/" rel="noopener noreferrer"&gt;JDN, the state's plan after the tax administration attack (in French)&lt;/a&gt;&lt;/p&gt;

</description>
      <category>backend</category>
      <category>cybersecurity</category>
      <category>security</category>
    </item>
    <item>
      <title>Traefik: a ForwardAuth advisory exposed my unsupported version</title>
      <dc:creator>Jules Robineau</dc:creator>
      <pubDate>Tue, 10 Nov 2026 07:03:00 +0000</pubDate>
      <link>https://dev.to/julesrobineau/traefik-a-forwardauth-advisory-exposed-my-unsupported-version-4aj3</link>
      <guid>https://dev.to/julesrobineau/traefik-a-forwardauth-advisory-exposed-my-unsupported-version-4aj3</guid>
      <description>&lt;p&gt;On October 21, Traefik published a security advisory about its ForwardAuth middleware. It is rated "high", with a score of 7.0 out of 10. I went through all my Traefik configurations to see if I was exposed. I am not. But while checking, I found a wider problem: my version has not received a single fix since May 2025.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: the GHSA-hrpp-p4fc-wwf8 flaw only hits Traefik setups where ForwardAuth talks to an NTLM or Negotiate authentication server. A first fix shipped in versions 2.11.60 and 3.7.16. On November 12, Traefik declared it incomplete. So aim for 3.7.18 or 2.11.62 at least. Before you react to the score, read the advisory's conditions and compare them with your config. Then check the support status of your version. My setup does not use ForwardAuth. But my 3.3.7 is end of life. 48 advisories from 2026 list it without ever fixing it, and two describe a flaw already present in my binary.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Versions and source status: snapshot as of October 31, 2026, completed on November 14, 2026 after five new advisories. Check the latest fixes before deploying.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update, November 14.&lt;/strong&gt; On November 12, Traefik published five new advisories. One of them, &lt;a href="https://github.com/traefik/traefik/security/advisories/GHSA-p956-6gvv-mxqp" rel="noopener noreferrer"&gt;GHSA-p956-6gvv-mxqp&lt;/a&gt;, declares the ForwardAuth fix in 2.11.60 and 3.7.16 incomplete. The target is now 3.7.18 or 2.11.62, released on November 10. Versions 3.7.19 and 2.11.63 followed on November 13. None of the five advisories affects my config, and the table below details them.&lt;/p&gt;

&lt;p&gt;This article is for teams that run Traefik in Docker or Kubernetes. You do not need to know NTLM to follow it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the October 21 advisory says
&lt;/h2&gt;

&lt;p&gt;Traefik is a reverse proxy: it receives requests and forwards them to your services. ForwardAuth asks an external server whether a request is authorized. It can copy the returned identity into headers sent to the service.&lt;/p&gt;

&lt;p&gt;The flaw involves connection-bound authentication, such as NTLM or some Negotiate/Kerberos deployments. IIS Windows Authentication is one example.&lt;/p&gt;

&lt;p&gt;ForwardAuth shared connections to the authentication server across clients. A connection authenticated by a victim could serve another client. That client could then be accepted under the victim’s identity.&lt;/p&gt;

&lt;p&gt;The fixes shipped in Traefik 2.11.60 and 3.7.16 on October 20. The advisory followed the next day. That first fix was incomplete. A new advisory, published on November 12, completes it in 2.11.62 and 3.7.18. In 3.7, the same issue affects the Ingress NGINX provider’s &lt;code&gt;auth-url&lt;/code&gt; annotation. Versions 3.0 through 3.6 are affected and will receive no fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the conditions before the score
&lt;/h2&gt;

&lt;p&gt;A score tells you how bad a flaw is if you are exposed. It does not tell you whether you are. To find out, read the advisory's conditions and compare them with your config.&lt;/p&gt;

&lt;p&gt;For this flaw, three conditions must all be true at once:&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2F5jt7sye1or0ap2fs97ei.png" class="article-body-image-wrapper"&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%2Farticles%2F5jt7sye1or0ap2fs97ei.png" alt="Two questions to ask the Traefik ForwardAuth advisory" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read the conditions before the score, then check your version's support.&lt;/strong&gt; Without ForwardAuth, the flaw does not reach you. A frozen version, though, will get no fix.&lt;/p&gt;

&lt;p&gt;The score itself hints at it. Its &lt;a href="https://en.wikipedia.org/wiki/Common_Vulnerability_Scoring_System" rel="noopener noreferrer"&gt;CVSS&lt;/a&gt; vector contains &lt;code&gt;AT:P&lt;/code&gt;. That code means the attack depends on conditions present in your deployment. The vector is the string of codes that breaks the score down, criterion by criterion.&lt;/p&gt;

&lt;p&gt;Read the version range carefully too. It is the widest list of affected versions, not proof. One case surprised me during this lab.&lt;/p&gt;

&lt;p&gt;In March, Traefik published an advisory about a crash caused by HTTP/2 frames (CVE-2026-27141). It covers every version up to 3.6.9. But the bug comes from the Go library &lt;code&gt;golang.org/x/net&lt;/code&gt;, and only from its version 0.50.0. I read my binary's dependencies with &lt;code&gt;go version -m&lt;/code&gt;. It ships version 0.38.0, so that bug does not affect it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check your exposure with four commands
&lt;/h2&gt;

&lt;p&gt;Start with the version that really runs. The tag written in your file is not enough.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Docker&lt;/span&gt;
docker &lt;span class="nb"&gt;exec&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;traefik-container&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; traefik version

&lt;span class="c"&gt;# Kubernetes&lt;/span&gt;
kubectl get pods -A -o &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{range .items[*]}{.spec.containers[*].image}{"\n"}{end}'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; grep traefik
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then search your config for ForwardAuth. The same search covers Docker labels, YAML files and Kubernetes manifests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;grep -rniE &lt;span class="s1"&gt;'forwardauth|auth-url'&lt;/span&gt; .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read every match before you conclude. In my case, the only &lt;code&gt;auth-url&lt;/code&gt; line is read by ingress-nginx, not by Traefik.&lt;/p&gt;

&lt;p&gt;If the Traefik API is enabled, ask it for the config it really loaded:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s http://127.0.0.1:8080/api/http/middlewares \
  &lt;span class="o"&gt;|&lt;/span&gt; jq -r &lt;span class="s1"&gt;'.[] | select(.type == "forwardauth") | .name'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For each ForwardAuth you find, look at how its server asks for authentication:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -sI https://your-auth-server/ &lt;span class="o"&gt;|&lt;/span&gt; grep -i &lt;span class="s1"&gt;'^www-authenticate'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If that server advertises &lt;code&gt;NTLM&lt;/code&gt; or &lt;code&gt;Negotiate&lt;/code&gt;, also check your version. With ForwardAuth and an affected version, all three conditions are met. Upgrade now.&lt;/p&gt;

&lt;p&gt;Do not rely on your scanner alone. On October 31, the advisory still had no CVE number. The GitHub Advisory Database, the one Dependabot reads, did not list it yet. The critical digestAuth advisory from August was missing too. The project's own advisory page remains the reference.&lt;/p&gt;

&lt;h2&gt;
  
  
  My lab: no ForwardAuth
&lt;/h2&gt;

&lt;p&gt;The container on my machine runs Traefik 3.3.7, built with Go 1.23.8. Three Docker Compose files reference &lt;code&gt;traefik:v3.3&lt;/code&gt;. They serve local tools or development environments.&lt;/p&gt;

&lt;p&gt;My configurations use the file and Docker providers, with host-based or path-based routes. They use no middleware, so no ForwardAuth. Neither HTTP/3 nor mutual TLS authentication, known as mTLS, is enabled.&lt;/p&gt;

&lt;p&gt;I found an &lt;code&gt;auth-url&lt;/code&gt; annotation in Kubernetes. It is read by ingress-nginx, not Traefik. Its oauth2-proxy server uses neither NTLM nor Negotiate. That line therefore proves no exposure to the Traefik advisory.&lt;/p&gt;

&lt;p&gt;The local containers listen on &lt;code&gt;127.0.0.1&lt;/code&gt;. This local scope also limits network exposure. Their unsupported version remains a problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  My version, on the other hand, gets nothing
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;traefik:v3.3&lt;/code&gt; tag still points to 3.3.7. It has not changed since May 5, 2025. Another &lt;code&gt;docker pull&lt;/code&gt; therefore brings no fix.&lt;/p&gt;

&lt;p&gt;As of November 14, of 68 Traefik advisories published since January 2026, 48 include my version in their affected range. None provides a fix for 3.3. An affected version range alone does not prove exposure, though.&lt;/p&gt;

&lt;p&gt;The binary’s Go 1.23.8 compiler is also unsupported. The mechanism matches &lt;a href="https://jrobineau.com/en/blog/2026-11-02-go-emudhra-rebuild-binaries.html" rel="noopener noreferrer"&gt;my eMudhra patch test&lt;/a&gt;. It needs a new binary, not another pull of the same image.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 2026 advisories against my config
&lt;/h2&gt;

&lt;p&gt;I took the most severe advisories, plus those whose conditions look like my config. Version 3.3 will get none of these fixes.&lt;/p&gt;

&lt;p&gt;The other 35 advisories need a component I do not use. That means an authentication or rewrite middleware, a Kubernetes provider, HTTP/3, mTLS or an NTLM service. Others target TCP routers or FastProxy mode, an experimental proxy you turn on separately. Only one remains unclear to me. It comes from the gRPC-Go library, and I could not prove whether Traefik exposes it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two flaws, on the other hand, are already in my binary
&lt;/h2&gt;

&lt;p&gt;Two advisories from 2026 are not about a component I do not use. They describe a flaw present in 3.3.7 itself. I checked them on a copy of my binary, run away from my real container, which did not change. I explain here what they break and what that changes for a service behind the proxy. I do not give the exact request: the goal is to understand the risk, not to arm an attack.&lt;/p&gt;

&lt;h3&gt;
  
  
  Identity headers that disappear (CVE-2026-29054)
&lt;/h3&gt;

&lt;p&gt;Traefik adds X-Forwarded headers to every request. They tell the service who the real client is, and which protocol it came in on. A service reads &lt;code&gt;X-Real-Ip&lt;/code&gt; for its logs, for example, or &lt;code&gt;X-Forwarded-Proto&lt;/code&gt; to know whether the call came in over HTTP or HTTPS.&lt;/p&gt;

&lt;p&gt;Traefik protects those headers against client-requested removal. But before 3.6.9, that protection compares the names case-sensitively, while the deletion itself ignores case. So a client can ask to remove a header by spelling it in lowercase. The protection does not recognize it, and the header leaves anyway. With the name spelled normally, nothing disappears. So the flaw is really there in 3.3.7.&lt;/p&gt;

&lt;p&gt;The effect depends on what the service behind reads. On my side, my Go services look at &lt;code&gt;X-Forwarded-For&lt;/code&gt; first, and it stays in place: the impact is limited. But my Keycloak reads &lt;code&gt;X-Forwarded-Proto&lt;/code&gt;. An identity header a client can empty is no longer a source of trust, neither for an authorization nor for a routing decision.&lt;/p&gt;

&lt;h3&gt;
  
  
  A path rule that no longer protects (CVE-2026-88009)
&lt;/h3&gt;

&lt;p&gt;Traefik decides routing and applies its middlewares by reading the request path. A rule can say, for example, "deny &lt;code&gt;/admin&lt;/code&gt; to any address outside this list".&lt;/p&gt;

&lt;p&gt;Before 3.7.13, a malformed request can present its target in a misleading form. Traefik reads it as an empty path, so "/", but forwards the real target to the service. It then makes its decision on "/", not on &lt;code&gt;/admin&lt;/code&gt;. The rule does not apply. Worse, the access log records "/", so nothing looks wrong. The service, meanwhile, does receive &lt;code&gt;/admin&lt;/code&gt; and answers.&lt;/p&gt;

&lt;p&gt;In my configs, Traefik protects no path, so there is nothing to bypass today. But the day I add a path-based rule on this version, the flaw is already waiting for it. And the log would not show it happening.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to fix it
&lt;/h2&gt;

&lt;p&gt;The target is 3.7.18 at least, or 2.11.62 if you are still on v2. Both shipped on November 10. Use the latest versions instead, 3.7.19 and 2.11.63, released on November 13.&lt;/p&gt;

&lt;p&gt;Why not 3.7.17? On November 12, five advisories targeted it. Three of them also hit 2.11.61. One of the five shows that the ForwardAuth fix in 3.7.16 was incomplete. Before that, &lt;a href="https://github.com/traefik/traefik/security/advisories/GHSA-xv5x-242w-7hf7" rel="noopener noreferrer"&gt;another advisory rated high&lt;/a&gt;, published on November 2, already hit 3.7.16 and 2.11.60. A client with no credentials could exhaust Traefik's memory and connections there. Even with no NTLM or Negotiate server at all.&lt;/p&gt;

&lt;p&gt;If you come from a version between 3.0 and 3.6, do not jump straight to production. Read the v3 migration guide section by section, from your version up to 3.7. For a Docker or file config like mine, I noted these changes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Since 3.6.16, the Docker provider needs Docker API 1.40 or later, which means Docker Engine 19.03.&lt;/li&gt;
&lt;li&gt;Since 3.7.13, a request target without a slash gets a 400 error. That is the fix for the test above.&lt;/li&gt;
&lt;li&gt;Since 3.7.15, every &lt;code&gt;CONNECT&lt;/code&gt; request gets a 501 error.&lt;/li&gt;
&lt;li&gt;Since 3.7.17, a request carrying more than 500 header values gets a 431 error. The &lt;code&gt;maxHeaderValueCount&lt;/code&gt; option sets that limit.&lt;/li&gt;
&lt;li&gt;Since 3.7.18, BasicAuth password length is capped, and &lt;code&gt;..&lt;/code&gt; segments followed by path parameters are resolved. The 3.7.18 migration note details both changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On Kubernetes, also plan the CRD and RBAC updates. CRDs describe Traefik's own resources, and RBAC sets its permissions. The guide asks for some on the moves to 3.4, 3.5, 3.6 and 3.7.&lt;/p&gt;

&lt;p&gt;Then pin an exact version in your file, for example &lt;code&gt;traefik:v3.7.19&lt;/code&gt;. Have a tool like Renovate watch that line, so it opens a pull request for each new release. Write down the old tag too, so you can roll back if a test breaks.&lt;/p&gt;

&lt;p&gt;And read the advisories page again right before you deploy. The target in this article changed twice in four days.&lt;/p&gt;

&lt;p&gt;Finally, write down the end-of-support date of your new version. Traefik's current rule gives each minor version six months of support from its release. Version 3.7 shipped on May 5, 2026, and 3.8 has been a release candidate since October 30. The official table does not show an end date for 3.7 yet. Read it again when 3.8 ships.&lt;/p&gt;

&lt;p&gt;And do not trust the table alone. It says 2.11 security support ends on September 7, 2026. Yet Traefik still shipped 2.11.60 on October 20, 2.11.61 on October 30, then 2.11.62 and 2.11.63 in November. The advisories and release notes are what tell you what is really fixed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;A flaw that does not affect you can still tell you that your version has been abandoned.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Run &lt;code&gt;traefik version&lt;/code&gt; in every Traefik container or pod&lt;/li&gt;
&lt;li&gt;[ ] Compare that version with Traefik's official support table&lt;/li&gt;
&lt;li&gt;[ ] Search your whole config for &lt;code&gt;forwardauth&lt;/code&gt; and &lt;code&gt;auth-url&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] Check the &lt;code&gt;WWW-Authenticate&lt;/code&gt; header of every authentication server&lt;/li&gt;
&lt;li&gt;[ ] Read each advisory's conditions before its score&lt;/li&gt;
&lt;li&gt;[ ] Check a version range against the dependency at fault, with &lt;code&gt;go version -m&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] Move to 3.7.18 or later, or to 2.11.62 or later&lt;/li&gt;
&lt;li&gt;[ ] Read the migration guide for every minor version you skip&lt;/li&gt;
&lt;li&gt;[ ] Pin an exact version and have Renovate or a similar tool watch it&lt;/li&gt;
&lt;li&gt;[ ] Put the next end-of-support date in your calendar&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;A security advisory asks two questions. The first is simple: does my config meet its conditions? The second often matters more: will my version get the fix?&lt;/p&gt;

&lt;p&gt;For the ForwardAuth flaw, my answer is no to both. The flaw does not affect me. But if a flaw affects me tomorrow, my 3.3 will not get fixed either. PostgreSQL 14 reaches the same point on November 12, and I tested &lt;a href="https://jrobineau.com/en/blog/2026-11-06-postgresql-14-end-of-support-test-old-dumps.html" rel="noopener noreferrer"&gt;what happens to its old dumps&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One last lesson comes from this article itself. On November 10, I recommended 3.7.17. Two days later, it was no longer enough. A target version goes stale fast. Read the advisories on the day you deploy.&lt;/p&gt;

&lt;p&gt;Want a review of your proxies, your images and their end-of-support dates? See my &lt;a href="https://jrobineau.com/en/services/devsecops-forfait.html" rel="noopener noreferrer"&gt;DevSecOps hardening offer&lt;/a&gt;, or &lt;a href="https://jrobineau.com/en/contact.html" rel="noopener noreferrer"&gt;let's talk&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Dossier DevSecOps et IA&lt;/p&gt;

&lt;h2&gt;
  
  
  Continuer sur ce sujet
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://jrobineau.com/en/blog/devsecops-ai/" rel="noopener noreferrer"&gt;Voir le dossier complet&lt;/a&gt;, puis deux retours directement liés et le service associé.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://github.com/traefik/traefik/security/advisories/GHSA-hrpp-p4fc-wwf8" rel="noopener noreferrer"&gt;Traefik advisory GHSA-hrpp-p4fc-wwf8&lt;/a&gt; · &lt;a href="https://github.com/traefik/traefik/security/advisories/GHSA-xv5x-242w-7hf7" rel="noopener noreferrer"&gt;Traefik advisory GHSA-xv5x-242w-7hf7, November 2&lt;/a&gt; · &lt;a href="https://github.com/traefik/traefik/security/advisories/GHSA-p956-6gvv-mxqp" rel="noopener noreferrer"&gt;Traefik advisory GHSA-p956-6gvv-mxqp, November 12&lt;/a&gt; · &lt;a href="https://github.com/traefik/traefik/releases/tag/v3.7.18" rel="noopener noreferrer"&gt;3.7.18 release notes&lt;/a&gt; · &lt;a href="https://github.com/traefik/traefik/releases/tag/v3.7.19" rel="noopener noreferrer"&gt;3.7.19 release notes&lt;/a&gt; · &lt;a href="https://community.traefik.io/t/new-security-update-for-traefik-2-11-2-11-60-and-3-7-3-7-16/30291" rel="noopener noreferrer"&gt;Traefik forum announcement, 2.11.60 and 3.7.16&lt;/a&gt; · &lt;a href="https://github.com/traefik/traefik/releases/tag/v3.7.16" rel="noopener noreferrer"&gt;3.7.16 release notes&lt;/a&gt; · &lt;a href="https://github.com/traefik/traefik/releases/tag/v2.11.60" rel="noopener noreferrer"&gt;2.11.60 release notes&lt;/a&gt; · &lt;a href="https://github.com/traefik/traefik/security/advisories" rel="noopener noreferrer"&gt;Traefik security advisories&lt;/a&gt; · &lt;a href="https://doc.traefik.io/traefik/deprecation/releases/" rel="noopener noreferrer"&gt;Traefik support policy&lt;/a&gt; · &lt;a href="https://doc.traefik.io/traefik/migrate/v3/" rel="noopener noreferrer"&gt;Traefik v3 migration guide&lt;/a&gt; · &lt;a href="https://doc.traefik.io/traefik/reference/routing-configuration/http/middlewares/forwardauth/" rel="noopener noreferrer"&gt;ForwardAuth documentation&lt;/a&gt; · &lt;a href="https://pkg.go.dev/vuln/GO-2026-4559" rel="noopener noreferrer"&gt;Go vulnerability database, GO-2026-4559&lt;/a&gt; · &lt;a href="https://hub.docker.com/_/traefik" rel="noopener noreferrer"&gt;Docker Hub, traefik image&lt;/a&gt; · &lt;a href="https://www.first.org/cvss/v4-0/specification-document" rel="noopener noreferrer"&gt;CVSS 4.0 specification&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>infrastructure</category>
      <category>security</category>
    </item>
    <item>
      <title>BOLA: your API checks the URL but misses IDs in the JSON body</title>
      <dc:creator>Jules Robineau</dc:creator>
      <pubDate>Mon, 09 Nov 2026 07:03:00 +0000</pubDate>
      <link>https://dev.to/julesrobineau/bola-your-api-checks-the-url-but-misses-ids-in-the-json-body-2f5i</link>
      <guid>https://dev.to/julesrobineau/bola-your-api-checks-the-url-but-misses-ids-in-the-json-body-2f5i</guid>
      <description>&lt;p&gt;Your access control test is green. Account A asks for a document that belongs to account B, and the API answers 404. That’s the right check.&lt;/p&gt;

&lt;p&gt;Now A edits its own document. In the request body, it slips in the ID of one of B's projects. The API accepts it, and the response shows B's project.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: access control often checks the object in the URL. It forgets the IDs in the request body. One account then attaches another account's object to its own, and the response hands over that data. This is BOLA, number one in the OWASP API Top 10. Check the owner of every ID you receive, not just that it exists.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This article is for backend developers who write &lt;code&gt;PUT&lt;/code&gt; or &lt;code&gt;PATCH&lt;/code&gt; routes, or who test access rights. The examples are in Go, but the flaw exists in every language.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup: four routes, one flaw
&lt;/h2&gt;

&lt;p&gt;I audited an API as a &lt;a href="https://en.wikipedia.org/wiki/White-box_testing" rel="noopener noreferrer"&gt;white-box&lt;/a&gt; review. Its backend is written in Laravel, a PHP framework.&lt;/p&gt;

&lt;p&gt;Four write routes had the same defect. One &lt;code&gt;PUT&lt;/code&gt;, three &lt;code&gt;PATCH&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Each time, the route did check that the object in the URL belonged to the logged-in account. But the request carried another ID, in its body.&lt;/p&gt;

&lt;p&gt;For that second ID, the API checked one thing only: that it exists. It never asked who owned it.&lt;/p&gt;

&lt;p&gt;In three cases, the response then returned the other account's data. Names, contact details, more IDs. In the fourth, the object moved into the other account, which then saw it appear in its own data.&lt;/p&gt;

&lt;p&gt;The list routes I reviewed were correctly scoped to the account. The hole was in the writes. I proved each case with an HTTP test, on an isolated database with fake accounts. Production never received a single request. The method will get its own article.&lt;/p&gt;

&lt;h2&gt;
  
  
  The flaw in one request
&lt;/h2&gt;

&lt;p&gt;Here is the scenario with generic objects. Account A owns a document. Account B owns a project. The IDs are made up for the example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="no"&gt;PATCH&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;documents&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;123&lt;/span&gt;
&lt;span class="nc"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Bearer&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="no"&gt;A&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nc"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;application&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"project_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"p-999"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The server asks two questions. Does document &lt;code&gt;d-123&lt;/code&gt; belong to A? Yes. Does project &lt;code&gt;p-999&lt;/code&gt; exist? Yes. The third question is missing: does that project belong to A?&lt;/p&gt;

&lt;p&gt;The update goes through. Then the API returns the updated document, with its project. Handy for the frontend, which shows everything at once.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="mi"&gt;200&lt;/span&gt; &lt;span class="no"&gt;OK&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"d-123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Meeting notes"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"project"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"p-999"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Account B project"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"owner_email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"b@example.com"&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 never called &lt;code&gt;GET /projects/p-999&lt;/code&gt;. It read B's data by writing to its own document.&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fz3v0sy5yzquox5mqfjwq.png" class="article-body-image-wrapper"&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%2Farticles%2Fz3v0sy5yzquox5mqfjwq.png" alt="One PATCH request with two IDs and a single owner check" width="799" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Exists" does not mean "belongs to you".&lt;/strong&gt; The API checks the owner of d-123, in the URL. For p-999, in the body, it only checks that it exists. B's project gets attached, and its data comes back to A.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why your access test misses it
&lt;/h2&gt;

&lt;p&gt;The classic &lt;a href="https://en.wikipedia.org/wiki/Insecure_direct_object_reference" rel="noopener noreferrer"&gt;IDOR&lt;/a&gt; test swaps the ID in the URL. I already recommended it in &lt;a href="https://jrobineau.com/en/blog/2026-09-03-tax-leak-started-with-a-password.html" rel="noopener noreferrer"&gt;the article on the French tax leak&lt;/a&gt;. That test is still useful, but it never looks at the request body.&lt;/p&gt;

&lt;p&gt;Here, the URL is fine. A points at its own document. The URL check does its job, and the test passes.&lt;/p&gt;

&lt;p&gt;Body validation gives a false sense of safety. In Laravel, the rule &lt;code&gt;exists:projects,id&lt;/code&gt; checks that the row exists in the table. It says nothing about the owner. Read too fast, it still looks like an access check.&lt;/p&gt;

&lt;p&gt;A foreign key does the same thing in the database. It is a column that points to a row in another table. It guarantees that the project exists, and it accepts any account's project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Even Postgres RLS lets the link through
&lt;/h2&gt;

&lt;p&gt;Maybe you filter rows in Postgres with RLS, Row-Level Security. It hides other accounts' rows from each account. I described it in &lt;a href="https://jrobineau.com/en/blog/2026-07-22-tenant-isolation-postgres-rls-go.html" rel="noopener noreferrer"&gt;the article on RLS in Go&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But the Postgres documentation is explicit. Integrity checks, foreign keys included, always bypass RLS. Otherwise the database could not guarantee its own links.&lt;/p&gt;

&lt;p&gt;You can reproduce it in a few lines on Postgres 18. Under RLS, account A cannot see B's project. It can still attach a document to it, and the database accepts.&lt;/p&gt;

&lt;p&gt;If the next read goes through RLS, the project stays hidden. But the link between the two accounts is written. So your barrier must cover writes, not only reads.&lt;/p&gt;

&lt;h2&gt;
  
  
  The right name: BOLA, and sometimes mass assignment
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/OWASP" rel="noopener noreferrer"&gt;OWASP&lt;/a&gt; ranks API flaws in a top 10. The latest edition is from 2023. Number one is BOLA, for Broken Object Level Authorization.&lt;/p&gt;

&lt;p&gt;Put simply, the API does not check that you have rights on the object you point at. OWASP says the ID can sit in the path, in the query string or in the payload. So this is BOLA on the project, not on the document.&lt;/p&gt;

&lt;p&gt;Another name comes up often: mass assignment. That is when the API lets the client change a field it should not touch. Since 2023, OWASP files it at number three, under BOPLA, for Broken Object Property Level Authorization.&lt;/p&gt;

&lt;p&gt;The difference comes down to one question. Does the product need to move a document to another project? If not, accepting &lt;code&gt;project_id&lt;/code&gt; on &lt;code&gt;PATCH&lt;/code&gt; is already the mistake. That is mass assignment, and the fix is to drop the field.&lt;/p&gt;

&lt;p&gt;If yes, the field is legitimate, and its value is what you must check. In the audit, I recommended refusing these moves wherever the product does not need them.&lt;/p&gt;

&lt;h2&gt;
  
  
  A UUID is not a password
&lt;/h2&gt;

&lt;p&gt;OWASP also advises random IDs, such as &lt;a href="https://en.wikipedia.org/wiki/Universally_unique_identifier" rel="noopener noreferrer"&gt;UUIDs&lt;/a&gt;. That helps against guessing. But a UUID shows up in responses, links and logs.&lt;/p&gt;

&lt;p&gt;In the audit, one rigged response leaked more IDs from the other account. Those IDs then opened a second route. All it took was a first foreign ID to start the chain.&lt;/p&gt;

&lt;p&gt;A hard-to-guess ID slows the attack down. The owner check stops it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: check the owner in the same query
&lt;/h2&gt;

&lt;p&gt;The rule is simple. Every ID you receive gets the same check as the one in the URL. It must exist and belong to the logged-in account.&lt;/p&gt;

&lt;p&gt;Here is a generic example in Go, with Postgres. It is not the audited API's code. It only shows the shape of the check.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ErrNotFound covers three cases: no such document, no such project,&lt;/span&gt;
&lt;span class="c1"&gt;// or one of them belongs to another account. The caller cannot tell which.&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nc"&gt;ErrNotFound&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"not found"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;// The owner is checked on both IDs, in the same statement as the write.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;moveDocument&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sb"&gt;`
UPDATE documents d
SET project_id = p.id
FROM projects p
WHERE d.id = $1 AND d.owner_id = $3
  AND p.id = $2 AND p.owner_id = $3`&lt;/span&gt;

&lt;span class="c1"&gt;// MoveDocument handles PATCH /documents/{id} with {"project_id": "..."}.&lt;/span&gt;
&lt;span class="c1"&gt;// userID comes from the verified session, never from the request body.&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="nc"&gt;MoveDocument&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;sql&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;DB&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;userID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;docID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;projectID&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ExecContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;moveDocument&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;docID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;projectID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;userID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RowsAffected&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="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;ErrNotFound&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;nil&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code does three things.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It checks the owner of both IDs in the same SQL statement as the write. This avoids two separate calls. The composite constraint below also protects against concurrent ownership changes.&lt;/li&gt;
&lt;li&gt;It takes &lt;code&gt;userID&lt;/code&gt; from the verified session. That value never comes from the request body.&lt;/li&gt;
&lt;li&gt;It returns &lt;code&gt;ErrNotFound&lt;/code&gt; when no row moves, whether the object is missing or belongs to another account.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last point matters. A "forbidden" answer would confirm that the project exists. I explain the "not found" choice in &lt;a href="https://jrobineau.com/en/blog/mcp-secure-go.html" rel="noopener noreferrer"&gt;the article on the LLM agent in Go&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In Laravel, the same idea fits in the validation rule. &lt;code&gt;Rule::exists('projects', 'id')-&amp;gt;where('owner_id', $userId)&lt;/code&gt; adds the owner to the check. In the audited API, the fix took the form of a single rule, reused on every field concerned.&lt;/p&gt;

&lt;h2&gt;
  
  
  Put the rule in the database too
&lt;/h2&gt;

&lt;p&gt;Code can forget a field. A database constraint applies to every write. When both tables carry the owner column, a composite foreign key shuts the door.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt;
    &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="k"&gt;CONSTRAINT&lt;/span&gt; &lt;span class="n"&gt;projects_id_owner&lt;/span&gt; &lt;span class="k"&gt;UNIQUE&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;owner_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt;
    &lt;span class="k"&gt;ADD&lt;/span&gt; &lt;span class="k"&gt;CONSTRAINT&lt;/span&gt; &lt;span class="n"&gt;documents_project_same_owner&lt;/span&gt;
    &lt;span class="k"&gt;FOREIGN&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;project_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;owner_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;owner_id&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 key no longer points to any project. It points to a project with the same owner as the document. Postgres then rejects the link to B's project, even if the code let it through.&lt;/p&gt;

&lt;p&gt;Postgres requires a unique constraint on the referenced columns, hence the first command. And this guard does not work when ownership goes through a parent. The check in code stays essential there.&lt;/p&gt;

&lt;h2&gt;
  
  
  Look for links already written
&lt;/h2&gt;

&lt;p&gt;Fixing the code does not clean the database. If the flaw was already used, cross-account links exist. In the audit, I recommended finding them before calling the problem solved.&lt;/p&gt;

&lt;p&gt;One join is enough to find them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;project_id&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;owner_id&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;owner_id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each row returned is a document attached to another account's project. Decide case by case: repair the link or set the row aside.&lt;/p&gt;

&lt;p&gt;Do this cleanup before adding the composite key. Postgres checks existing rows when you create the constraint. If it finds a bad one, it refuses to create it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The test: two accounts, and the ID in the body
&lt;/h2&gt;

&lt;p&gt;This generic Laravel example is separate from the audited code. Adapt its factories, route and message to your API contract.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Generic Laravel example: adapt the factories and route to your API.&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;test_cannot_attach_another_accounts_project&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="kt"&gt;void&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$alice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&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="nv"&gt;$bob&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&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="nv"&gt;$own&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Project&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'owner_id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$alice&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;id&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="nv"&gt;$foreign&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Project&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'owner_id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$bob&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;id&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="nv"&gt;$document&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Document&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'owner_id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$alice&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'project_id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$own&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;id&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="p"&gt;;&lt;/span&gt;

    &lt;span class="nv"&gt;$response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;actingAs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$alice&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;patchJson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s2"&gt;"/documents/{$document-&amp;gt;id}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'project_id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$foreign&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;id&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="nv"&gt;$response&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;assertStatus&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;assertExactJson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Not found'&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="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;assertDatabaseHas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'documents'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="s1"&gt;'id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$document&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'project_id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$own&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;id&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="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;For every route that accepts an ID in its body, write a test with two accounts. A owns the document, B owns the project. A sends its &lt;code&gt;PATCH&lt;/code&gt; with B's project.&lt;/p&gt;

&lt;p&gt;The test checks three things.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The response is a 404, the same as for a project that does not exist.&lt;/li&gt;
&lt;li&gt;A's document did not change in the database.&lt;/li&gt;
&lt;li&gt;No data from B shows up in the response.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To find these routes, look for fields ending in &lt;code&gt;_id&lt;/code&gt; in the inputs of your write routes. In Laravel, also look for every &lt;code&gt;exists:&lt;/code&gt; rule. Do it for &lt;code&gt;POST&lt;/code&gt; creations too, not only for updates.&lt;/p&gt;

&lt;p&gt;Some fields accept a type and an ID, for example an attachment that can target several kinds of objects. Check the owner for every accepted type. Those are the easiest cases to forget.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"Exists" does not mean "belongs to you".&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[ ] List the &lt;code&gt;POST&lt;/code&gt;, &lt;code&gt;PUT&lt;/code&gt; and &lt;code&gt;PATCH&lt;/code&gt; routes that receive an ID in the body&lt;/li&gt;
&lt;li&gt;[ ] For each field, decide whether the client may change it&lt;/li&gt;
&lt;li&gt;[ ] Drop the fields the product does not need to change&lt;/li&gt;
&lt;li&gt;[ ] Check the owner of every ID you receive, not just that it exists&lt;/li&gt;
&lt;li&gt;[ ] Take the account from the session, never from the body&lt;/li&gt;
&lt;li&gt;[ ] Answer 404 for a missing object and for a foreign object alike&lt;/li&gt;
&lt;li&gt;[ ] Add a composite foreign key when both tables carry the owner&lt;/li&gt;
&lt;li&gt;[ ] Look for cross-account links already in the database before calling the flaw fixed&lt;/li&gt;
&lt;li&gt;[ ] Write one two-account test per route, with the foreign ID in the body&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;An ID in a request body points at an object, just like the one in the URL. So it needs the same check.&lt;/p&gt;

&lt;p&gt;Neither validation, nor the foreign key, nor RLS checks the owner for you. That is the job of your code, or of a constraint written for it.&lt;/p&gt;

&lt;p&gt;Want to know whether your API lets these IDs through? &lt;a href="https://jrobineau.com/en/contact.html" rel="noopener noreferrer"&gt;Let's talk&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://api-security.owasp.org/editions/2023/en/0xa1-broken-object-level-authorization" rel="noopener noreferrer"&gt;OWASP, API1:2023 Broken Object Level Authorization&lt;/a&gt; · &lt;a href="https://api-security.owasp.org/editions/2023/en/0xa3-broken-object-property-level-authorization" rel="noopener noreferrer"&gt;OWASP, API3:2023 Broken Object Property Level Authorization&lt;/a&gt; · &lt;a href="https://api-security.owasp.org/editions/2023/en/0x11-t10" rel="noopener noreferrer"&gt;OWASP API Security Top 10, 2023 edition&lt;/a&gt; · &lt;a href="https://www.postgresql.org/docs/current/ddl-rowsecurity.html" rel="noopener noreferrer"&gt;PostgreSQL 18, Row Security Policies&lt;/a&gt; · &lt;a href="https://www.postgresql.org/docs/current/ddl-constraints.html" rel="noopener noreferrer"&gt;PostgreSQL 18, constraints and foreign keys&lt;/a&gt; · &lt;a href="https://laravel.com/docs/12.x/validation#rule-exists" rel="noopener noreferrer"&gt;Laravel 12, exists validation rule&lt;/a&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>backend</category>
      <category>cybersecurity</category>
      <category>security</category>
    </item>
    <item>
      <title>PostgreSQL 14 stops on November 12: test your old dumps first</title>
      <dc:creator>Jules Robineau</dc:creator>
      <pubDate>Fri, 06 Nov 2026 07:03:00 +0000</pubDate>
      <link>https://dev.to/julesrobineau/postgresql-14-stops-on-november-12-test-your-old-dumps-first-2fpn</link>
      <guid>https://dev.to/julesrobineau/postgresql-14-stops-on-november-12-test-your-old-dumps-first-2fpn</guid>
      <description>&lt;p&gt;On 12 November 2026, PostgreSQL 14 gets its final release. After that date, no more fixes, not even for a security flaw. One week later, PostgreSQL 19 is due to ship as a final release.&lt;/p&gt;

&lt;p&gt;Prepare your upgrade before support ends. Before you pick 18 or 19, ask yourself a simple question. Do your dumps restore on the new version?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: I backed up the real schema of one of my projects on PostgreSQL 14. Then I restored it on 18 and on 19 RC1. The data comes through unchanged. But without the roles, application privileges disappear, and psql still reports success. And when my 14 server had &lt;code&gt;standard_conforming_strings&lt;/code&gt; set to &lt;code&gt;off&lt;/code&gt;, 19 left a table empty. Test your restores on the target version, and take your dumps with its &lt;code&gt;pg_dump&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Versions and source status: snapshot as of October 31, 2026. Check the latest fixes before deploying.&lt;/p&gt;

&lt;p&gt;This article is for developers and teams running PostgreSQL 14 in production. It also helps if you keep PostgreSQL 14 dumps in an archive. No deep PostgreSQL knowledge needed.&lt;/p&gt;

&lt;p&gt;The key lab result is simple: data can come back while permissions are lost. &lt;code&gt;psql&lt;/code&gt; can even return 0. Check errors, data and permissions together.&lt;/p&gt;

&lt;h2&gt;
  
  
  The calendar: 14 stops, 19 arrives
&lt;/h2&gt;

&lt;p&gt;PostgreSQL supports each major version for five years. The major version is the first number: 14, 18 or 19. Minor versions, like 14.24, only bring fixes.&lt;/p&gt;

&lt;p&gt;Version 14 came out on 30 September 2021. The official table sets its final release on 12 November 2026. After that, a flaw found in 14 will not be fixed.&lt;/p&gt;

&lt;p&gt;Version 18 is the current stable release, at 18.6. It is supported until 14 November 2030. Version 19 has been a &lt;a href="https://en.wikipedia.org/wiki/Software_release_life_cycle" rel="noopener noreferrer"&gt;release candidate&lt;/a&gt; since 15 October. Its final release is planned for 19 November, unless a problem delays it.&lt;/p&gt;

&lt;p&gt;To move from one major version to another, you need a dump and a restore, or the &lt;code&gt;pg_upgrade&lt;/code&gt; tool. The documentation explains why. The internal data format can change between two major versions.&lt;/p&gt;

&lt;p&gt;A physical backup copies exactly those internal files. It gives you back a 14, not an 18. To change versions from a backup, you need a dump.&lt;/p&gt;

&lt;h2&gt;
  
  
  My test: a real schema, three PostgreSQL versions
&lt;/h2&gt;

&lt;p&gt;PostgreSQL is in the stack of every one of my freelance projects. So before writing about this date, I wanted to test it for real.&lt;/p&gt;

&lt;p&gt;I took the schema of one of my projects: 11 databases, one per service, and 129 SQL migrations. That makes 58 tables, triggers, functions and 72 &lt;a href="https://www.postgresql.org/docs/18/ddl-rowsecurity.html" rel="noopener noreferrer"&gt;RLS&lt;/a&gt; policies. I described them in &lt;a href="https://jrobineau.com/en/blog/2026-07-22-tenant-isolation-postgres-rls-go.html" rel="noopener noreferrer"&gt;my article on tenant isolation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I added a few made-up rows, with no real data at all. Some of them hold traps: backslashes (the &lt;code&gt;\&lt;/code&gt; character), apostrophes, emoji and JSON.&lt;/p&gt;

&lt;p&gt;Then I exported each database with &lt;a href="https://www.postgresql.org/docs/18/app-pgdump.html" rel="noopener noreferrer"&gt;pg_dump&lt;/a&gt; 14.24, in two formats:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the plain format, an SQL script you replay with &lt;code&gt;psql&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;the custom format, a binary file you read back with &lt;code&gt;pg_restore&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I restored each dump on PostgreSQL 18.6 and on 19 RC1, with the tools of each version. Everything ran in Docker, with the official images.&lt;/p&gt;

&lt;p&gt;To compare, I computed a fingerprint per table: the row count and a hash of the content. I also counted indexes, constraints, policies and privileges. Same fingerprint, same data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Good news: the data comes through unchanged
&lt;/h2&gt;

&lt;p&gt;With the default settings, my 14 dumps restore on 18 and on 19. All 58 tables keep the same fingerprint as the source.&lt;/p&gt;

&lt;p&gt;Indexes, triggers, functions and RLS policies are there too. That holds for both formats and both versions.&lt;/p&gt;

&lt;p&gt;But I had recreated the roles on the target server before restoring. Without them, the result is very different.&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Ftrfrfdqat25rbkfdgizn.png" class="article-body-image-wrapper"&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%2Farticles%2Ftrfrfdqat25rbkfdgizn.png" alt="Three restores of the same PostgreSQL 14 schema" width="800" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The data comes back, the privileges do not, and psql says success.&lt;/strong&gt; Three restores of my 14 schema on 18 and 19. Without the roles, 393 privileges disappear. With an old setting, 19 leaves a table empty.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trap 1: your dump does not contain your roles
&lt;/h2&gt;

&lt;p&gt;A role is a PostgreSQL account. Your services connect with it, and table privileges are granted to these roles.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pg_dump&lt;/code&gt; exports a single database. Roles belong to the whole server, so they are not in the dump. The documentation points to &lt;code&gt;pg_dumpall&lt;/code&gt; to export them.&lt;/p&gt;

&lt;p&gt;My schema grants privileges to 24 application roles. I restored the dumps on a fresh server, without those roles. psql printed this kind of line 126 times:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;ERROR&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="s"&gt;role "app_identity_app" does not exist&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All the data is there. But three things changed, on 18 as on 19:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The 393 table privileges granted to the application roles are gone.&lt;/li&gt;
&lt;li&gt;5 of the 72 RLS policies no longer exist. They targeted a specific role, so creating them failed.&lt;/li&gt;
&lt;li&gt;In custom format, two functions restricted to my application roles became executable by any role again.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last point is the sneakiest. In a custom dump, revoking the public privilege and granting the role's privilege travel in the same command. When the grant fails, the revoke is rolled back with it.&lt;/p&gt;

&lt;p&gt;And psql? On a single database, it printed 35 errors, then returned exit code 0, the success code. A CI job reading that code would show green. &lt;code&gt;pg_restore&lt;/code&gt; returns 1.&lt;/p&gt;

&lt;p&gt;The fix takes two steps. Export the roles separately, then recreate them on the target server before the databases:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# On the source: roles and tablespaces, including password hashes.&lt;/span&gt;
pg_dumpall -U postgres --globals-only &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; globals.sql

&lt;span class="c"&gt;# On the target: review duplicate CREATE ROLE statements first.&lt;/span&gt;
psql -X -v &lt;span class="nv"&gt;ON_ERROR_STOP&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 -U postgres -f globals.reviewed.sql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my trial, one error came from the &lt;code&gt;postgres&lt;/code&gt; role already present on the new server. Prepare a copy named &lt;code&gt;globals.reviewed.sql&lt;/code&gt; before a strict restore. Check existing roles. Remove only reviewed duplicate &lt;code&gt;CREATE ROLE&lt;/code&gt; statements. Keep the intended attributes and memberships. Any other error must stop the restore.&lt;/p&gt;

&lt;p&gt;This file holds the password hashes of your roles. Store it like a secret.&lt;/p&gt;

&lt;p&gt;Also add &lt;code&gt;-v ON_ERROR_STOP=1&lt;/code&gt; to psql, or &lt;code&gt;--exit-on-error&lt;/code&gt; to pg_restore. The first error then stops the restore, with a failure exit code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trap 2: an old setting that 19 refuses
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;standard_conforming_strings&lt;/code&gt; decides how PostgreSQL reads a backslash in a string. With &lt;code&gt;on&lt;/code&gt;, a backslash is a normal character. With &lt;code&gt;off&lt;/code&gt;, it escapes the next character.&lt;/p&gt;

&lt;p&gt;The default has been &lt;code&gt;on&lt;/code&gt; since PostgreSQL 9.1. But if your server has it &lt;code&gt;off&lt;/code&gt;, every dump records it in its first lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;standard_conforming_strings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The PostgreSQL 19 release notes are clear. This setting is now forced to &lt;code&gt;on&lt;/code&gt;. A dump made by an older &lt;code&gt;pg_dump&lt;/code&gt;, on a server set to &lt;code&gt;off&lt;/code&gt;, will not load properly.&lt;/p&gt;

&lt;p&gt;I wanted to see what "not properly" means. I switched my 14 server to &lt;code&gt;off&lt;/code&gt;, then dumped three databases again. On 18, everything restores without an error. On 19, the restore prints these errors at the start, then carries on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;ERROR&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="s"&gt;non-standard string literals are not supported&lt;/span&gt;
&lt;span class="na"&gt;ERROR&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="s"&gt;unrecognized configuration parameter "escape_string_warning"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Further down, one of my tables stays empty. It has a &lt;a href="https://www.postgresql.org/docs/18/ddl-constraints.html" rel="noopener noreferrer"&gt;CHECK&lt;/a&gt; constraint that validates emails with a regular expression:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CHECK&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="o"&gt;~*&lt;/span&gt; &lt;span class="s1"&gt;'^[^@\s]+@[^@\s]+\.[^@\s]+$'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On a server set to &lt;code&gt;off&lt;/code&gt;, &lt;code&gt;pg_dump&lt;/code&gt; writes the backslashes of this constraint twice. Version 19 now reads those two backslashes as two characters. The regular expression changes meaning, and my test emails no longer pass. Loading the whole table fails.&lt;/p&gt;

&lt;p&gt;With the &lt;code&gt;--inserts&lt;/code&gt; option of pg_dump, it gets worse. Rows are written as &lt;code&gt;INSERT&lt;/code&gt; statements, and every backslash comes back doubled in your data. No error reports it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;on 14: Le fichier est dans C:\Partage\Docs
on 19: Le fichier est dans C:\\Partage\\Docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here again, psql returned exit code 0.&lt;/p&gt;

&lt;p&gt;I tested two fixes, and both work. If your 14 server is still running, take the dump with the &lt;code&gt;pg_dump&lt;/code&gt; of 19. It writes &lt;code&gt;SET standard_conforming_strings = on&lt;/code&gt;, and the restore is clean.&lt;/p&gt;

&lt;p&gt;If all you have left is the file, restore it on an 18 first. Then take a new dump from that 18, with the &lt;code&gt;pg_dump&lt;/code&gt; of 19. My values came back intact.&lt;/p&gt;

&lt;p&gt;To find out whether your dumps are affected, one line is enough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# plain format&lt;/span&gt;
grep -m1 standard_conforming_strings base.sql

&lt;span class="c"&gt;# custom format&lt;/span&gt;
pg_restore -f - base.dump &lt;span class="o"&gt;|&lt;/span&gt; grep -m1 standard_conforming_strings
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Take your dumps with the pg_dump of the target version
&lt;/h2&gt;

&lt;p&gt;In the other direction, everything went fine. The &lt;code&gt;pg_dump&lt;/code&gt; of 18 and of 19 read my 14 server without a single warning. Their dumps restored without an error, with the same fingerprints.&lt;/p&gt;

&lt;p&gt;It is also the official advice. For a major upgrade, use &lt;code&gt;pg_dump&lt;/code&gt; and &lt;code&gt;pg_dumpall&lt;/code&gt; from the new version. With Docker, you do not even need to install them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run --rm -e PGPASSWORD postgres:18.6 \
  pg_dump -h old-server -U postgres -Fc -d my_db &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; my_db.dump
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Plan the rollback before you migrate
&lt;/h2&gt;

&lt;p&gt;I also tested the reverse path. The &lt;code&gt;pg_restore&lt;/code&gt; of 14 refuses a custom dump made by the &lt;code&gt;pg_dump&lt;/code&gt; of 18 or 19:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;pg_restore&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;error: unsupported version (1.16) in file header&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the &lt;code&gt;pg_dump&lt;/code&gt; of 14 refuses to read a 19 server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;pg_dump&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;error: aborting because of server version mismatch&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The documentation confirms it. Nothing guarantees that a dump loads into an older major version. So keep the old server and its tools as long as a rollback is still possible. Keep a dump made with those tools too.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;A backup counts if it restores on the version where you will use it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[ ] List your PostgreSQL 14 servers and their migration date&lt;/li&gt;
&lt;li&gt;[ ] Run &lt;code&gt;SHOW standard_conforming_strings;&lt;/code&gt; on each one&lt;/li&gt;
&lt;li&gt;[ ] Look for that line in the dumps you keep in your archive&lt;/li&gt;
&lt;li&gt;[ ] Export the roles with &lt;code&gt;pg_dumpall --globals-only&lt;/code&gt;, and store the file like a secret&lt;/li&gt;
&lt;li&gt;[ ] Restore a real dump on the target version, in a throwaway container&lt;/li&gt;
&lt;li&gt;[ ] Add &lt;code&gt;-v ON_ERROR_STOP=1&lt;/code&gt; to psql and &lt;code&gt;--exit-on-error&lt;/code&gt; to pg_restore&lt;/li&gt;
&lt;li&gt;[ ] Compare rows, privileges and RLS policies before and after&lt;/li&gt;
&lt;li&gt;[ ] Take the migration dumps with the &lt;code&gt;pg_dump&lt;/code&gt; of the target version&lt;/li&gt;
&lt;li&gt;[ ] Keep the old server and its tools until a rollback is no longer possible&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What to remember
&lt;/h2&gt;

&lt;p&gt;In &lt;a href="https://jrobineau.com/en/blog/2026-10-28-ai-agent-or-human-did-your-backup-hold.html" rel="noopener noreferrer"&gt;my article on backups&lt;/a&gt;, I wrote that a backup never restored is only a hope. A major upgrade adds a question: restored on which version?&lt;/p&gt;

&lt;p&gt;In my test, with the default settings, the data from 14 came through unchanged. What broke came from the side: roles missing from the dump, and an old server setting. And psql returned the success code in both cases.&lt;/p&gt;

&lt;p&gt;You need to migrate a PostgreSQL 14 and want to test your restores before 12 November? &lt;a href="https://jrobineau.com/en/contact.html" rel="noopener noreferrer"&gt;Let's talk&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://www.postgresql.org/support/versioning/" rel="noopener noreferrer"&gt;PostgreSQL, versioning policy&lt;/a&gt; · &lt;a href="https://www.postgresql.org/about/news/postgresql-19-rc-1-released-3409/" rel="noopener noreferrer"&gt;PostgreSQL 19 RC 1, announcement of 15 October 2026&lt;/a&gt; · &lt;a href="https://www.postgresql.org/docs/19/release-19.html" rel="noopener noreferrer"&gt;PostgreSQL 19 release notes&lt;/a&gt; · &lt;a href="https://www.postgresql.org/docs/18/upgrading.html" rel="noopener noreferrer"&gt;PostgreSQL, upgrading a cluster&lt;/a&gt; · &lt;a href="https://www.postgresql.org/docs/18/app-pgdump.html" rel="noopener noreferrer"&gt;pg_dump&lt;/a&gt; · &lt;a href="https://www.postgresql.org/docs/18/app-pg-dumpall.html" rel="noopener noreferrer"&gt;pg_dumpall&lt;/a&gt; · &lt;a href="https://www.postgresql.org/docs/18/app-pgrestore.html" rel="noopener noreferrer"&gt;pg_restore&lt;/a&gt; · &lt;a href="https://www.postgresql.org/docs/18/app-psql.html" rel="noopener noreferrer"&gt;psql, exit status&lt;/a&gt; · &lt;a href="https://www.postgresql.org/docs/18/runtime-config-compatible.html" rel="noopener noreferrer"&gt;standard_conforming_strings&lt;/a&gt; · &lt;a href="https://hub.docker.com/_/postgres" rel="noopener noreferrer"&gt;Official postgres Docker images&lt;/a&gt;&lt;/p&gt;

</description>
      <category>backend</category>
      <category>database</category>
      <category>postgres</category>
    </item>
    <item>
      <title>Keycloak 26.8.1 fixes 19 flaws: sort them by your config, not by their score</title>
      <dc:creator>Jules Robineau</dc:creator>
      <pubDate>Thu, 05 Nov 2026 07:03:00 +0000</pubDate>
      <link>https://dev.to/julesrobineau/keycloak-2681-fixes-19-flaws-sort-them-by-your-config-not-by-their-score-3pom</link>
      <guid>https://dev.to/julesrobineau/keycloak-2681-fixes-19-flaws-sort-them-by-your-config-not-by-their-score-3pom</guid>
      <description>&lt;p&gt;On October 13, Keycloak shipped version 26.8.1. It fixes 19 flaws that carry a CVE number. Keycloak's ticket for the only flaw rated "high" points at a test module. A flaw rated "medium", on the other hand, hands over full control of a realm.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: A CVSS score does not establish whether a flaw affects your setup. Compare enabled features with each advisory’s conditions. My development export leaves three checks open, with no exposure confirmed so far. I am preparing an upgrade to 26.8.1 because my 26.5 no longer receives fixes. Rolling back requires restoring the backup, not just restarting the old image.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Versions and source status: snapshot as of October 31, 2026. Check the latest fixes before deploying.&lt;/p&gt;

&lt;p&gt;This article is for teams that run Keycloak themselves. Use the detailed table as a reference after the quick assessment.&lt;/p&gt;

&lt;p&gt;Two decisions matter: your current exposure and how to prepare the upgrade.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Compare enabled features with each flaw’s conditions. An unchecked case remains open.&lt;/li&gt;
&lt;li&gt;Prepare a restorable backup before changing versions.&lt;/li&gt;
&lt;li&gt;Test login flows and rollback on a database copy.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What 26.8.1 fixes, and where these fixes do not exist
&lt;/h2&gt;

&lt;p&gt;Keycloak manages application logins and permissions. A realm groups its own users, applications and rules.&lt;/p&gt;

&lt;p&gt;Version 26.8.1 fixes the 19 CVEs detailed below. Two other release-note entries group flaws in Jackson 3 and simple-git. This table therefore does not replace the complete release notes.&lt;/p&gt;

&lt;p&gt;As of October 31, no published 26.7 or 26.6 includes all these fixes. The 26.6 branch received some, but the announced 26.6.8 is unavailable. The published target is 26.8.1.&lt;/p&gt;

&lt;p&gt;The scores cited come from GitHub Advisory. They describe general severity. Your configuration determines whether the vulnerable path is used.&lt;/p&gt;

&lt;h2&gt;
  
  
  The score does not say what the flaw does to you
&lt;/h2&gt;

&lt;p&gt;CVE-2026-91777, scored 7.5, affects jackson-databind, the JSON-reading library. The flaw requires &lt;code&gt;@JsonIdentityInfo&lt;/code&gt;. I found no use in Keycloak or my extension. Yet the vulnerable library is present in my 26.5.7 image.&lt;/p&gt;

&lt;p&gt;CVE-2026-94000, scored 6.6, allows privilege escalation. An account with &lt;code&gt;manage-users&lt;/code&gt; joins a group carrying &lt;code&gt;realm-admin&lt;/code&gt;. It gains full control even though direct role assignment was refused.&lt;/p&gt;

&lt;p&gt;CVE-2026-94218 scores only 3.1. It bypasses a login policy that requires 2FA setup. Two-factor authentication requires a second proof of identity. A user who has not configured it can get in with only a password.&lt;/p&gt;

&lt;p&gt;These scores cannot determine your response order alone. First check the features and accounts that make each case possible.&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fv26ntq3ddp5jzkqdvarb.png" class="article-body-image-wrapper"&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%2Farticles%2Fv26ntq3ddp5jzkqdvarb.png" alt="From the CVSS score to sorting by config" width="799" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A flaw affects you if your config turns on the option it targets.&lt;/strong&gt; The score ranks the 19 flaws for everyone. The conditions of each advisory, checked against your export, give the real sort.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sort by feature, in six families
&lt;/h2&gt;

&lt;p&gt;Each flaw on the list needs a specific option. I sort them into six families, by where you have to look. There are external identity providers, delegated admins and login flows. Then advanced OAuth options, server settings and dependencies. The table from my lab, further down, follows that order.&lt;/p&gt;

&lt;p&gt;Delegated admins often rely on &lt;a href="https://www.keycloak.org/docs/latest/server_admin/index.html" rel="noopener noreferrer"&gt;FGAP&lt;/a&gt;. One point in this family surprised me. Two flaws, CVE-2026-94001 and CVE-2026-97177, bypass an explicit denial of the &lt;code&gt;reset-password&lt;/code&gt; right. That denial only exists in FGAP v2.&lt;/p&gt;

&lt;p&gt;In v1, according to the code, managing a user is enough to change their password. So there is nothing to bypass. Conversely, CVE-2026-97311 only hits realms without FGAP v2, which is the default.&lt;/p&gt;

&lt;p&gt;For most families, a realm export is enough. This &lt;code&gt;jq&lt;/code&gt; filter pulls out the options that matter here:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;jq '{
  identityProviders: [.identityProviders[]?.providerId],
  uma: .userManagedAccessAllowed,
  clientPolicies: [.clientPolicies.policies[]?.name],
  userFederation: [.components["org.keycloak.storage.UserStorageProvider"][]?.providerId],
  riskyAuthenticators: [.authenticationFlows[].authenticationExecutions[].authenticator // empty
    | select(. == "auth-conditional-otp-form" or test("^(auth|direct-grant-auth)-x509"))] | unique,
  smtpStartTls: .smtpServer.starttls,
  mtlsBoundClients: [.clients[]
    | select(.attributes["tls.client.certificate.bound.access.tokens"] == "true") | .clientId],
  adminRolesOnServiceAccounts: [.users[]? | select(.serviceAccountClientId)
    | select(.clientRoles["realm-management"])
    | {(.serviceAccountClientId): .clientRoles["realm-management"]}],
  groupsWithAdminRoles: [.. | objects
    | select(.path? and .clientRoles?["realm-management"]?) | .path]
}' my-realm-realm.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Service account roles need an export that includes users. The command &lt;code&gt;kc.sh export --dir export --realm my-realm --users realm_file&lt;/code&gt; puts everything in one file.&lt;/p&gt;

&lt;p&gt;Three settings do not show up in the export. Enabled features are printed at startup, in the &lt;code&gt;Preview features enabled&lt;/code&gt; and &lt;code&gt;Deprecated features enabled&lt;/code&gt; lines. Metrics depend on the &lt;code&gt;--metrics-enabled&lt;/code&gt;, &lt;code&gt;--event-metrics-user-enabled&lt;/code&gt; and &lt;code&gt;--event-metrics-user-tags&lt;/code&gt; options. The last one only contains &lt;code&gt;realm&lt;/code&gt; by default.&lt;/p&gt;

&lt;p&gt;For &lt;a href="https://datatracker.ietf.org/doc/html/rfc9126" rel="noopener noreferrer"&gt;PAR&lt;/a&gt;, the code of your apps holds the answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  My lab: the 19 flaws against my config
&lt;/h2&gt;

&lt;p&gt;One of my projects runs on an image built from &lt;code&gt;quay.io/keycloak/keycloak:26.5&lt;/code&gt;. That tag points to 26.5.7, released on April 2. The image adds a custom consent &lt;a href="https://www.keycloak.org/docs/latest/server_development/index.html" rel="noopener noreferrer"&gt;SPI&lt;/a&gt; and a custom theme.&lt;/p&gt;

&lt;p&gt;It also turns on two deprecated features, &lt;code&gt;token-exchange&lt;/code&gt; and &lt;code&gt;admin-fine-grained-authz:v1&lt;/code&gt;. My backend uses them for magic link login. It asks Keycloak for a token on behalf of the user. That is &lt;a href="https://www.keycloak.org/securing-apps/token-exchange" rel="noopener noreferrer"&gt;token exchange&lt;/a&gt;, here in its old version 1. This magic link also shows up in &lt;a href="https://jrobineau.com/en/blog/2026-09-02-keycloak-database-identity-drift.html" rel="noopener noreferrer"&gt;my article on drift between Keycloak and the database&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I ran my development realm export and my Terraform config through the grid. Here is the result, flaw by flaw.&lt;/p&gt;

&lt;p&gt;I confirmed no exposure in this development export. Three cases remain open. They require an admin account with limited permissions. This result does not cover the master realm or the whole production setup.&lt;/p&gt;

&lt;p&gt;I found two accounts of that kind in my realm. My backend has the &lt;code&gt;impersonation&lt;/code&gt; role, which its token exchange needs. A cleanup tool has &lt;code&gt;manage-users&lt;/code&gt;, only in the test environment. No group carries an admin role today. The day I create one, CVE-2026-94000 becomes real for that test account.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three open checks and an upgrade to prepare
&lt;/h2&gt;

&lt;p&gt;My 26.5 has received nothing since 26.5.7 on April 2. Its branch is archived on GitHub. Dependabot offered me 26.6 on April 13. The pull request is still open.&lt;/p&gt;

&lt;p&gt;Sorting by config tells you what is urgent today. It says nothing about the next flaw. I would rather do this upgrade calmly, before a flaw hits an option I use. And a fix only counts once it is deployed, as with &lt;a href="https://jrobineau.com/en/blog/2026-11-02-go-emudhra-rebuild-binaries.html" rel="noopener noreferrer"&gt;the eMudhra fix in Go binaries&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The database migration cannot be undone
&lt;/h2&gt;

&lt;p&gt;Then I tested the database. I started 26.5.7 on an empty PostgreSQL 16 and created a test realm. I backed up the database with &lt;code&gt;pg_dump&lt;/code&gt;. Then I started 26.8.1 on the same database.&lt;/p&gt;

&lt;p&gt;Keycloak migrates the schema by itself, on first startup. It uses &lt;a href="https://en.wikipedia.org/wiki/Liquibase" rel="noopener noreferrer"&gt;Liquibase&lt;/a&gt;, which records each applied change in a table. The count went from 179 to 237 changes.&lt;/p&gt;

&lt;p&gt;The logs show the data being migrated to 26.6.1, 26.6.2, 26.7.0, then 26.8.0. It all happened in a single startup, in 13 seconds, on an almost empty database.&lt;/p&gt;

&lt;p&gt;On a real database, it will take longer. The documentation sets a 30-minute timeout by default, which &lt;code&gt;--transaction-setup-timeout&lt;/code&gt; can change. Above 300,000 rows in a table, Keycloak skips some indexes during the migration. On PostgreSQL, 26.8 then creates them in the background.&lt;/p&gt;

&lt;p&gt;Then I simulated the classic mistake. I restarted the old 26.5.7 image on the migrated database. It started and answered 200. A single warning in the logs points at the problem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WARN [org.keycloak.storage.datastore.DefaultMigrationManager] Possibly incorrect
state of migration. You are trying to run server version '26.5.7' against
database, which was already migrated to newer version '26.8.1'.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The documentation is clear. Keycloak cannot roll back a database migration. To go back, you restore the old installation and the database backup. Your rollback is your dump, not your old tag.&lt;/p&gt;

&lt;h2&gt;
  
  
  From 26.5 to 26.8.1: what I tested
&lt;/h2&gt;

&lt;p&gt;I changed both &lt;code&gt;FROM&lt;/code&gt; lines in a build copy to 26.8.1. My Java extension and theme load. The login page renders. The two templates overridden by my theme are unchanged.&lt;/p&gt;

&lt;p&gt;Token exchange v1 still works in this test with FGAP v1. Both features remain deprecated. Here, token exchange lets the backend obtain a token on behalf of a user.&lt;/p&gt;

&lt;p&gt;The new delegation preview needs FGAP v2 and user consent. Moving off v1 is therefore a separate project. For the upgrade, also align Java dependencies with the target version. My trial build kept the 26.5.6 dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the patch itself can break
&lt;/h2&gt;

&lt;p&gt;26.8.1 is not only a security patch. Its migration notes list changes that can break an existing setup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With StartTLS ticked, sending email fails if the SMTP server does not offer STARTTLS. Before, Keycloak carried on in plaintext.&lt;/li&gt;
&lt;li&gt;Logout tokens sent by an OIDC IdP are always verified, even if signature validation is turned off on that IdP. You then need to configure its public key or its JWKS URL.&lt;/li&gt;
&lt;li&gt;Changing an IdP's token URL requires entering its secret again. A &lt;code&gt;kcadm.sh&lt;/code&gt; script that edits those fields must also send &lt;code&gt;clientSecret&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;X.509 CRL files are only read from the &lt;code&gt;conf&lt;/code&gt; folder.&lt;/li&gt;
&lt;li&gt;The "Skip OTP for Header" rule only works behind a trusted proxy, with &lt;code&gt;--proxy-headers&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The semicolon no longer separates URL parameters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you skip versions, also read the notes of each minor version. For me, that means 26.6.0, 26.7.0 and 26.8.0. For example, 26.7.0 moves FreeMarker, the theme engine, to newer and stricter defaults. And 26.8.0 stores login failures in the database, which adds load to your database.&lt;/p&gt;

&lt;h2&gt;
  
  
  The upgrade plan
&lt;/h2&gt;

&lt;p&gt;Once you are on 26.8, the next patches get easier. Since 26.6, Keycloak supports rolling updates between patch versions of the same line. Its rolling updates guide tells you whether your setup allows it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;A flaw affects you when your config turns on the feature it targets. Its score does not tell you that.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Write down your exact version, since a tag like &lt;code&gt;26.5&lt;/code&gt; does not say which patch runs&lt;/li&gt;
&lt;li&gt;[ ] Sort the 19 flaws by family and run your realm export through the &lt;code&gt;jq&lt;/code&gt; filter&lt;/li&gt;
&lt;li&gt;[ ] List the service accounts that hold a &lt;code&gt;realm-management&lt;/code&gt; role&lt;/li&gt;
&lt;li&gt;[ ] Check that no group carries &lt;code&gt;realm-admin&lt;/code&gt; or another admin role&lt;/li&gt;
&lt;li&gt;[ ] Reread the enabled features in the startup logs&lt;/li&gt;
&lt;li&gt;[ ] Test the migration on a copy of your production database&lt;/li&gt;
&lt;li&gt;[ ] Back up the database before migrating and keep the old image with the dump&lt;/li&gt;
&lt;li&gt;[ ] Treat moving off token exchange v1 and FGAP v1 as a separate project&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;A CVSS score ranks flaws for everyone. Your realm is not everyone. A "low" flaw can cancel your mandatory 2FA, and a "high" one can touch nothing in your setup.&lt;/p&gt;

&lt;p&gt;But sorting does not replace upgrading. My review remains incomplete until those three checks are closed. It does not change the fact that my 26.5 gets no more fixes.&lt;/p&gt;

&lt;p&gt;Want to run this sort on your Keycloak, or prepare the upgrade? See my &lt;a href="https://jrobineau.com/en/services/sso-authentication.html" rel="noopener noreferrer"&gt;identity and SSO architecture offer&lt;/a&gt;, or &lt;a href="https://jrobineau.com/en/contact.html" rel="noopener noreferrer"&gt;let's talk&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://www.keycloak.org/2026/10/keycloak-2681-released" rel="noopener noreferrer"&gt;Keycloak, 26.8.1 release post&lt;/a&gt; · &lt;a href="https://github.com/keycloak/keycloak/releases" rel="noopener noreferrer"&gt;Keycloak, releases on GitHub&lt;/a&gt; · &lt;a href="https://www.keycloak.org/docs/latest/upgrading/index.html" rel="noopener noreferrer"&gt;Keycloak upgrading guide&lt;/a&gt; · &lt;a href="https://github.com/advisories/GHSA-3g7j-6fqv-v2q4" rel="noopener noreferrer"&gt;GitHub advisory, CVE-2026-94000&lt;/a&gt; · &lt;a href="https://github.com/advisories/GHSA-rm49-qjx7-5qm5" rel="noopener noreferrer"&gt;GitHub advisory, CVE-2026-94218&lt;/a&gt; · &lt;a href="https://github.com/advisories/GHSA-jj9w-64w4-2wcx" rel="noopener noreferrer"&gt;GitHub advisory, CVE-2026-96445&lt;/a&gt; · &lt;a href="https://github.com/advisories/GHSA-pgx8-hgcr-q6rq" rel="noopener noreferrer"&gt;GitHub advisory, CVE-2026-97177&lt;/a&gt; · &lt;a href="https://github.com/advisories/GHSA-cxp5-3px4-pw24" rel="noopener noreferrer"&gt;GitHub advisory, CVE-2026-91777 (jackson-databind)&lt;/a&gt; · &lt;a href="https://github.com/keycloak/keycloak/issues/53388" rel="noopener noreferrer"&gt;Keycloak, issue 53388&lt;/a&gt; · &lt;a href="https://nvd.nist.gov/vuln/detail/CVE-2026-94000" rel="noopener noreferrer"&gt;NVD, CVE-2026-94000&lt;/a&gt; · &lt;a href="https://www.keycloak.org/securing-apps/token-exchange" rel="noopener noreferrer"&gt;Keycloak, token exchange&lt;/a&gt; · &lt;a href="https://www.keycloak.org/observability/event-metrics" rel="noopener noreferrer"&gt;Keycloak, event metrics&lt;/a&gt; · &lt;a href="https://www.keycloak.org/downloads" rel="noopener noreferrer"&gt;Keycloak, downloads&lt;/a&gt;&lt;/p&gt;

</description>
      <category>infrastructure</category>
      <category>opensource</category>
      <category>security</category>
    </item>
    <item>
      <title>My AI agent guardrail let rm -rf ~ through</title>
      <dc:creator>Jules Robineau</dc:creator>
      <pubDate>Wed, 04 Nov 2026 07:03:00 +0000</pubDate>
      <link>https://dev.to/julesrobineau/my-ai-agent-guardrail-let-rm-rf-through-j36</link>
      <guid>https://dev.to/julesrobineau/my-ai-agent-guardrail-let-rm-rf-through-j36</guid>
      <description>&lt;p&gt;In early October, I gave 33 commands to the guardrail of my coding agent. 17 could destroy my code or my machine. The other 16 were normal work.&lt;/p&gt;

&lt;p&gt;It let 13 of the 17 destructive commands through. One of them was &lt;code&gt;rm -rf ~&lt;/code&gt;, which wipes the whole home directory.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: an AI agent guardrail is code. Test it like code, with a list of commands to block, a list to let through, and a score. My old hook blocked 4 destructive commands out of 17. It also held up 5 normal commands out of 16. Its replacement parses shell syntax and applies command-specific rules. It scored 17 out of 17 and 16 out of 16. The Claude Code sandbox did not hold up on my Ubuntu. And I know the holes that remain.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This article is for developers who let a coding agent run commands on its own. Claude Code, Cursor or Codex, it does not matter. You do not need to know hooks before reading.&lt;/p&gt;

&lt;h2&gt;
  
  
  The context: an agent with no confirmation, held back by a hook
&lt;/h2&gt;

&lt;p&gt;I run my coding agents without confirmation prompts. In Claude Code, this mode is called &lt;code&gt;bypassPermissions&lt;/code&gt;. The agent runs its commands without waiting for my approval.&lt;/p&gt;

&lt;p&gt;My only brake was a hook. A hook is a script the tool runs before each action of the agent. It reads the planned command and answers: let it through, refuse, or ask the human.&lt;/p&gt;

&lt;p&gt;Mine looked for dangerous patterns with regular expressions. A regular expression, or regex, is a text pattern. It looks for a sequence of characters in a string.&lt;/p&gt;

&lt;p&gt;When a pattern matched, the hook did not refuse. It asked for my approval, even in bypass mode. In July, I showed a hook of this kind in &lt;a href="https://jrobineau.com/en/blog/2026-07-23-ai-agent-permissions-dev-vs-prod.html" rel="noopener noreferrer"&gt;the article on agent permissions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;At first, I mostly wanted it to stop bothering me. It stopped me on ordinary commands like &lt;code&gt;chmod +x&lt;/code&gt;, &lt;code&gt;pkill&lt;/code&gt; or a &lt;code&gt;while true&lt;/code&gt; loop. Before replacing it, I measured it.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://jrobineau.com/en/blog/2026-10-21-what-is-an-agent-harness.html" rel="noopener noreferrer"&gt;the article on the harness&lt;/a&gt;, I advised testing your guardrails on legitimate and dangerous commands. Here is how I did it, and what I found.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bench: two lists and a score
&lt;/h2&gt;

&lt;p&gt;To replay a benchmark, save the tool version, rule level and each expected verdict. Also keep the working directory and relevant variables. A command containing a variable has no single meaning outside that context.&lt;/p&gt;

&lt;p&gt;A test bench is a list of cases, with the expected answer for each one. Mine fits in two lists.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;17 destructive commands, which the guardrail must block. For example &lt;code&gt;rm -rf ~&lt;/code&gt;, &lt;code&gt;rm -fr /&lt;/code&gt; or &lt;code&gt;find ~ -delete&lt;/code&gt;. Or &lt;code&gt;git reset --hard&lt;/code&gt;, &lt;code&gt;git push --force&lt;/code&gt; and &lt;code&gt;bash -c "rm -rf ~"&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;16 legitimate commands, which my agents run to do their work. For example &lt;code&gt;rm -rf $W&lt;/code&gt; on a work folder in &lt;code&gt;/tmp&lt;/code&gt;, &lt;code&gt;chmod +x&lt;/code&gt;, &lt;code&gt;pkill&lt;/code&gt; or a &lt;code&gt;while true&lt;/code&gt; loop.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the score has two numbers. How many destructive commands are blocked. How many legitimate commands get through.&lt;/p&gt;

&lt;p&gt;The second number matters as much as the first. A guardrail that blocks everything scores 17 out of 17. It is also unusable, and you will end up switching it off.&lt;/p&gt;

&lt;p&gt;You do not need to run a dangerous command to test it. The hook receives the command as text, before anything runs. You send it &lt;code&gt;rm -rf ~&lt;/code&gt; and you read its answer. Nothing gets deleted.&lt;/p&gt;

&lt;p&gt;Here are the scores on my bench:&lt;/p&gt;

&lt;p&gt;My old hook bothered me often, and it protected little.&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fu1c64n91m9r81upibt1c.png" class="article-body-image-wrapper"&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%2Farticles%2Fu1c64n91m9r81upibt1c.png" alt="Scores of two guardrails on my 33-command bench" width="799" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A guardrail is measured with two numbers.&lt;/strong&gt; The destructive commands it blocks, and the legitimate commands it lets through. My old hook failed both.&lt;/p&gt;

&lt;p&gt;I also tested dcg, a tool of the same kind. I set it aside for a reason that deserves its own article.&lt;/p&gt;

&lt;p&gt;cc-safety-net got a perfect score. That is a result on these 33 cases, not a general guarantee.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the regex let rm -rf ~ through
&lt;/h2&gt;

&lt;p&gt;I read the code of the old hook again. I found three flaws.&lt;/p&gt;

&lt;p&gt;The first one is about the tilde. For an &lt;code&gt;rm -rf&lt;/code&gt;, the hook looked at the target path. If it did not start with &lt;code&gt;/&lt;/code&gt;, the hook treated it as relative, so harmless.&lt;/p&gt;

&lt;p&gt;But &lt;code&gt;~&lt;/code&gt; does not start with &lt;code&gt;/&lt;/code&gt;. The shell replaces &lt;code&gt;~&lt;/code&gt; with your home directory before running &lt;code&gt;rm&lt;/code&gt;. The hook read the text before the shell did.&lt;/p&gt;

&lt;p&gt;The second one is about option order. Every rule looked for &lt;code&gt;-rf&lt;/code&gt;, in that order. &lt;code&gt;rm -fr /&lt;/code&gt; does exactly the same thing. But for a regex, it is not the same string.&lt;/p&gt;

&lt;p&gt;The third one is the hardest to spot. This line was meant to skip the &lt;code&gt;rm -rf&lt;/code&gt; rules, which were handled elsewhere:&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="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strippedCommand&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="o"&gt;!/&lt;/span&gt;&lt;span class="n"&gt;rm&lt;/span&gt;\&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*-&lt;/span&gt;&lt;span class="n"&gt;rf&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;source&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It tests the source text of each regex. In that text, &lt;code&gt;\s&lt;/code&gt; is written with two characters: a backslash and an &lt;code&gt;s&lt;/code&gt;. It is not a space. So the test never matches, and no rule is ever skipped.&lt;/p&gt;

&lt;p&gt;As a result, the rule on &lt;code&gt;rm -rf $VARIABLE&lt;/code&gt; always applied. Every &lt;code&gt;rm -rf $W&lt;/code&gt; from my agents triggered a prompt, even in &lt;code&gt;/tmp&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A regex reads characters. The shell reads a command. In between, you find options in another order, the &lt;code&gt;~&lt;/code&gt;, variables and commands hidden inside &lt;code&gt;bash -c&lt;/code&gt;. A list of patterns has to predict every variant. Sooner or later, it misses one.&lt;/p&gt;

&lt;p&gt;The bench tells you where to look. The code tells you why.&lt;/p&gt;

&lt;h2&gt;
  
  
  A tool that reads the command like the shell
&lt;/h2&gt;

&lt;p&gt;I replaced the old hook with cc-safety-net, an open source tool under the MIT license. It does not look for patterns in the text. It analyzes the command.&lt;/p&gt;

&lt;p&gt;The tool parses shell syntax to identify: the program, its options, its arguments, the nested commands. Its rules for &lt;code&gt;rm&lt;/code&gt; recognize both &lt;code&gt;-fr&lt;/code&gt; and &lt;code&gt;-rf&lt;/code&gt;. And the content of &lt;code&gt;bash -c "..."&lt;/code&gt; is read again as a command.&lt;/p&gt;

&lt;p&gt;Here is the entry in my &lt;code&gt;~/.claude/settings.json&lt;/code&gt;, with the path shortened:&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="nl"&gt;"PreToolUse"&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="nl"&gt;"matcher"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"hooks"&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="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"node $HOME/.claude/scripts/cc-safety-net/.../cc-safety-net.js hook --coding-cli"&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="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three choices matter in this setup.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The matcher says which tools the hook applies to. Empty, it takes all of them, not only the shell. Reading a &lt;code&gt;.env&lt;/code&gt; file or &lt;code&gt;~/.ssh&lt;/code&gt; is checked too.&lt;/li&gt;
&lt;li&gt;The hook refuses with a reason instead of asking. The agent reads the reason and changes its approach on its own. I no longer get interrupted.&lt;/li&gt;
&lt;li&gt;The version is pinned and installed in a separate folder. An update can change the rules. Run the bench again before changing versions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tool offers several rule levels. I tried the Strict level. It blocked my agents' &lt;code&gt;rm -rf $W&lt;/code&gt; again, so I stayed on Standard.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Claude Code sandbox: tested, then set aside on Ubuntu
&lt;/h2&gt;

&lt;p&gt;A sandbox locks the agent's commands in. They only see part of the disk and the network. On Linux, Claude Code relies on &lt;a href="https://github.com/containers/bubblewrap" rel="noopener noreferrer"&gt;bubblewrap&lt;/a&gt; for this.&lt;/p&gt;

&lt;p&gt;I tested it in a separate session, without turning it on for everything else. On the first try, every command failed. Here is the error message, shortened:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apply-seccomp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write /proc/self/setgroups ... Permission denied&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On my Ubuntu installation, &lt;a href="https://en.wikipedia.org/wiki/AppArmor" rel="noopener noreferrer"&gt;AppArmor&lt;/a&gt; stops unprivileged programs from creating the isolated spaces bubblewrap needs. You can check it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sysctl kernel.apparmor_restrict_unprivileged_userns
# kernel.apparmor_restrict_unprivileged_userns = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Claude Code documentation offers an AppArmor profile for bubblewrap, installed with sudo. I used a workaround without sudo: &lt;code&gt;sandbox.network.allowAllUnixSockets: true&lt;/code&gt;. This setting turns off the filter that blocks Unix sockets. That is one protection less.&lt;/p&gt;

&lt;p&gt;With this setting and a few folders allowed for writing, almost everything worked. Go builds and tests, a signed commit, git over SSH, docker. Writes to my home directory were refused, even from Python.&lt;/p&gt;

&lt;p&gt;Three problems made me give up.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git add -A&lt;/code&gt; failed. Inside the sandbox, protected files like &lt;code&gt;.bashrc&lt;/code&gt; or &lt;code&gt;.gitconfig&lt;/code&gt; show up as special files. Git then stops on an error.&lt;/li&gt;
&lt;li&gt;During each command, about 25 empty files appeared in the repository, on the real disk. The documentation describes them: they hold the place of protected files that do not exist yet. They disappear after the command.&lt;/li&gt;
&lt;li&gt;In bypass mode, a command that fails in the sandbox can be run again outside it, without any prompt. The documentation confirms it. The setting &lt;code&gt;allowUnsandboxedCommands: false&lt;/code&gt; closes that door, but it does not fix the first two problems.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those empty files are a real risk. Another agent or the IDE could run &lt;code&gt;git add -A&lt;/code&gt; at the same moment. It would add them to the commit. And a killed session leaves them behind.&lt;/p&gt;

&lt;p&gt;The sandbox is still a good idea. On my machine, it broke git. I will look at it again if this mechanism changes, or for sessions that do not touch git.&lt;/p&gt;

&lt;h2&gt;
  
  
  The holes I keep
&lt;/h2&gt;

&lt;p&gt;17 out of 17 does not mean zero holes. Two commands still get past my current guardrail:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;W&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/home/dev/projects&lt;span class="o"&gt;;&lt;/span&gt; rm -rf &lt;span class="nv"&gt;$W&lt;/span&gt;
python3 -c &lt;span class="s2"&gt;"import shutil; shutil.rmtree(...)"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first one gets through because the tool does not know the value of &lt;code&gt;$W&lt;/code&gt;. The shell fills it in later. And &lt;code&gt;rm -rf $W&lt;/code&gt; on a folder in &lt;code&gt;/tmp&lt;/code&gt; is one of my legitimate commands. Blocking it means going back to the Strict level.&lt;/p&gt;

&lt;p&gt;The second one gets through because Python deletes the files itself. The tool looks for shell commands, and there are none here.&lt;/p&gt;

&lt;p&gt;I keep these two holes on purpose. My safety net is git, where I push often, and an automatic backup. That backup had itself stopped running, without a sound. I tell that story in &lt;a href="https://jrobineau.com/en/blog/2026-10-28-ai-agent-or-human-did-your-backup-hold.html" rel="noopener noreferrer"&gt;the article on backups&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the tests with the script
&lt;/h2&gt;

&lt;p&gt;My second hook blocks shutdown commands: &lt;code&gt;shutdown&lt;/code&gt;, &lt;code&gt;reboot&lt;/code&gt;, &lt;code&gt;poweroff&lt;/code&gt; and &lt;code&gt;halt&lt;/code&gt;. It includes its own test suite: 31 cases run with &lt;code&gt;--test&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Before, a filter blocked any command that contained the word. A commit with the message "fix graceful shutdown" would have been refused. Now, the word has to be in command position.&lt;/p&gt;

&lt;p&gt;Here is an excerpt from the script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$1&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; --test &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
  &lt;span class="nv"&gt;fail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0
  &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="nv"&gt;IFS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'|'&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; -r want cmd&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; is_power_command &lt;span class="s2"&gt;"$cmd"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt; &lt;span class="nv"&gt;got&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;deny&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nv"&gt;got&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;allow&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="k"&gt;fi&lt;/span&gt;
    &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$got&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"$want"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"FAIL want=$want got=$got: $cmd"&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nv"&gt;fail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;done&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'CASES'&lt;/span&gt;
deny&lt;span class="o"&gt;|&lt;/span&gt;sudo shutdown -h now
deny&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /tmp &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; reboot
deny&lt;span class="o"&gt;|&lt;/span&gt;bash -c &lt;span class="s2"&gt;"reboot"&lt;/span&gt;
allow&lt;span class="o"&gt;|&lt;/span&gt;git commit -m &lt;span class="s2"&gt;"fix graceful shutdown"&lt;/span&gt;
allow&lt;span class="o"&gt;|&lt;/span&gt;grep -rn shutdown .
allow&lt;span class="o"&gt;|&lt;/span&gt;go &lt;span class="nb"&gt;test&lt;/span&gt; ./... -run TestShutdown
CASES
  &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nv"&gt;$fail&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; 0 &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"all cases pass"&lt;/span&gt;
  &lt;span class="nb"&gt;exit&lt;/span&gt; &lt;span class="nv"&gt;$fail&lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You change the pattern? You run the test again. A broken case shows up as &lt;code&gt;FAIL&lt;/code&gt;, with the command at fault.&lt;/p&gt;

&lt;p&gt;Do the same for your main hook. You need a file of cases, one command to replay them, and a readable result. Run that command again with every update of the tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;A guardrail you have never measured is a feeling.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Write the list of destructive commands your agent must never run&lt;/li&gt;
&lt;li&gt;[ ] Write the list of normal commands it runs every day&lt;/li&gt;
&lt;li&gt;[ ] Add the variants: swapped options, &lt;code&gt;~&lt;/code&gt;, variables, &lt;code&gt;bash -c&lt;/code&gt;, &lt;code&gt;find -delete&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] Send each command to the hook as text, without ever running it&lt;/li&gt;
&lt;li&gt;[ ] Write down two numbers: destructive blocked, legitimate allowed&lt;/li&gt;
&lt;li&gt;[ ] Prefer a hook that refuses with a reason over a hook that asks&lt;/li&gt;
&lt;li&gt;[ ] Pin the guardrail version, and run the bench again before each update&lt;/li&gt;
&lt;li&gt;[ ] Write down your known holes, and keep a backup out of the agent's reach&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What to remember
&lt;/h2&gt;

&lt;p&gt;My guardrail let &lt;code&gt;rm -rf ~&lt;/code&gt; through. I learned it with 33 lines of tests.&lt;/p&gt;

&lt;p&gt;The score does not prove that everything is covered. It tells you what is. Run again with every update, it warns you when that changes. For the rest, there is the backup.&lt;/p&gt;

&lt;p&gt;Do you want to measure the guardrails of your team's agents before one of them runs the wrong command? &lt;a href="https://jrobineau.com/en/contact.html" rel="noopener noreferrer"&gt;Let's talk&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Dossier DevSecOps et IA&lt;/p&gt;

&lt;h2&gt;
  
  
  Continuer sur ce sujet
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://jrobineau.com/en/blog/devsecops-ai/" rel="noopener noreferrer"&gt;Voir le dossier complet&lt;/a&gt;, puis deux retours directement liés et le service associé.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://code.claude.com/docs/en/sandboxing" rel="noopener noreferrer"&gt;Claude Code, sandboxing documentation&lt;/a&gt; · &lt;a href="https://code.claude.com/docs/en/hooks" rel="noopener noreferrer"&gt;Claude Code, hooks documentation&lt;/a&gt; · &lt;a href="https://github.com/kenryu42/cc-safety-net" rel="noopener noreferrer"&gt;cc-safety-net on GitHub&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>security</category>
      <category>testing</category>
    </item>
    <item>
      <title>The Node.js Brotli flaw: your server decompresses whatever APIs send back</title>
      <dc:creator>Jules Robineau</dc:creator>
      <pubDate>Tue, 03 Nov 2026 07:03:00 +0000</pubDate>
      <link>https://dev.to/julesrobineau/the-nodejs-brotli-flaw-your-server-decompresses-whatever-apis-send-back-30ne</link>
      <guid>https://dev.to/julesrobineau/the-nodejs-brotli-flaw-your-server-decompresses-whatever-apis-send-back-30ne</guid>
      <description>&lt;p&gt;On October 21, Node.js fixed a flaw in its Brotli decoder, CVE-2026-111497. I went through the Node images in my projects. Two Next.js frontends are built on a tag that still ships Node 22.21.1. That tag will never get the fix.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: a crafted Brotli stream can make Node write outside the memory it reserved. The process can crash, leak memory, or run an attacker's code. You are exposed if your server decompresses Brotli that comes from outside. Node's &lt;code&gt;fetch&lt;/code&gt;, axios and Express 5 all do it by default. Move to Node 22.23.4, 24.22.1 or 26.12.1. Node 18, Node 20 and some Docker tags will never be fixed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Versions and source status: snapshot as of October 31, 2026. Check the latest fixes before deploying.&lt;/p&gt;

&lt;p&gt;This article is for Node.js developers and for teams that ship Node in containers. You do not need to know Brotli to follow it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who decompresses Brotli without knowing it
&lt;/h2&gt;

&lt;p&gt;The flaw has one condition. Your application must decompress Brotli data supplied by someone else. So the real question is simple. Which code on your server decompresses Brotli?&lt;/p&gt;

&lt;p&gt;I read the source code of Node, undici, axios and body-parser. The table sums up what each one does.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;fetch&lt;/code&gt; case is the quietest one. Node built it on undici, the HTTP library of the Node.js project. Over HTTPS, &lt;code&gt;fetch&lt;/code&gt; asks the server for Brotli on its own, with an &lt;code&gt;accept-encoding&lt;/code&gt; header that includes &lt;code&gt;br&lt;/code&gt;. Then it decompresses the response without asking you.&lt;/p&gt;

&lt;p&gt;Changing that header does not protect you. In undici's code, the decoder depends on the response's &lt;code&gt;Content-Encoding&lt;/code&gt; header. A hostile server can send you Brotli even if you did not ask for it.&lt;/p&gt;

&lt;p&gt;The risk comes from URLs you do not control. Think of a webhook entered by a customer, a link preview, an RSS feed or an image to download. A compromised third-party API is enough too.&lt;/p&gt;

&lt;p&gt;For incoming requests, Express 5 relies on body-parser 2. That version decompresses bodies sent with &lt;code&gt;Content-Encoding: br&lt;/code&gt;. So any client can push a Brotli stream at you. Express 4 uses body-parser 1, which does not know Brotli.&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2F6fkl5adtasgbzcdph8ey.png" class="article-body-image-wrapper"&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%2Farticles%2F6fkl5adtasgbzcdph8ey.png" alt="Two paths lead to Node's Brotli decoder" width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Two paths lead to the decoder.&lt;/strong&gt; The responses your server receives, and the bodies it accepts. You wrote neither.&lt;/p&gt;

&lt;p&gt;An image that only builds a frontend receives no traffic. It still needs the update, but it is not the priority.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Node.js fixed on October 21
&lt;/h2&gt;

&lt;p&gt;On October 21, Node.js shipped three security releases: 22.23.4, 24.22.1 and 26.12.1. The advisory lists ten flaws. Four are rated "high". Only one can lead to code execution, the one in the &lt;a href="https://en.wikipedia.org/wiki/Brotli" rel="noopener noreferrer"&gt;Brotli&lt;/a&gt; decoder.&lt;/p&gt;

&lt;p&gt;A server that compresses with Brotli says so with the &lt;code&gt;Content-Encoding: br&lt;/code&gt; header. The client must then decompress the response before reading it. That is the decoder's job.&lt;/p&gt;

&lt;p&gt;The decoder reads the stream piece by piece. When it hit an invalid section, it thought it was just missing a few bytes. It waited for more instead of rejecting the stream.&lt;/p&gt;

&lt;p&gt;Meanwhile, it kept storing the next bytes in a small eight-byte buffer. It did not stop at the edge. So it wrote into the memory next to it. This is called an out-of-bounds write.&lt;/p&gt;

&lt;p&gt;Node lists three possible effects. The process can crash. It can leak part of its memory. Or the attacker can run their own code inside your Node process.&lt;/p&gt;

&lt;p&gt;Node rates the flaw "high". The &lt;a href="https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures" rel="noopener noreferrer"&gt;CVE&lt;/a&gt; record, written by Google, scores it 9.2 out of 10. The NVD, the US vulnerability database, scores it 9.8.&lt;/p&gt;

&lt;p&gt;The bug comes from Google's Brotli library. Google shipped the fixed versions the same day: 1.0.10, 1.1.1 and 1.2.1. But Node ships its own copy of Brotli.&lt;/p&gt;

&lt;p&gt;I checked with &lt;code&gt;ldd&lt;/code&gt; in two official images. The &lt;code&gt;node&lt;/code&gt; binary loads no Brotli library from the system. So updating the packages in your image changes nothing for Node. It is the same trap as &lt;a href="https://jrobineau.com/en/blog/2026-11-02-go-emudhra-rebuild-binaries.html" rel="noopener noreferrer"&gt;Go's eMudhra fix&lt;/a&gt;, which I covered yesterday.&lt;/p&gt;

&lt;h2&gt;
  
  
  Confirmed exploitation since October 27
&lt;/h2&gt;

&lt;p&gt;On October 22, the CVE record still said "Exploitation: none". CISA added the flaw to its KEV catalog on October 27. That catalog records confirmed exploitation. The assessment changed to "active" the next day.&lt;/p&gt;

&lt;p&gt;On October 30, Singapore’s Cyber Security Agency also reported a public proof of concept. These sources describe successive states. They do not give an account of a specific attack here. This snapshot ends on October 31, 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  My lab: 14 FROM node lines, three versions that will never be fixed
&lt;/h2&gt;

&lt;p&gt;I listed the &lt;code&gt;FROM node:&lt;/code&gt; lines in every Dockerfile of my projects. I count 14 of them, in 11 files. For each tag, I read Docker Hub, then ran &lt;code&gt;node --version&lt;/code&gt; in today's image.&lt;/p&gt;

&lt;p&gt;The tag that surprised me is &lt;code&gt;node:22-alpine3.21&lt;/code&gt;. It looks like it follows Node 22. In fact, it ships Node 22.21.1, and it has not moved in a year.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Alpine_Linux" rel="noopener noreferrer"&gt;Alpine&lt;/a&gt; is a very small Linux distribution. The &lt;code&gt;alpine3.21&lt;/code&gt; suffix pins its version. The team behind the Node images dropped Alpine 3.21 on December 4, 2025. Today it only builds the Alpine 3.23 and 3.24 variants.&lt;/p&gt;

&lt;p&gt;Since then, that tag gets no new Node version at all. Nothing warns you. The build passes and the image starts.&lt;/p&gt;

&lt;p&gt;One of the two repositories does have a Dependabot that watches Docker images. In May, it proposed moving to &lt;code&gt;node:25-alpine3.21&lt;/code&gt;. It kept the suffix, so it stayed inside the frozen family. Node 25 reached end of life three weeks later, on June 1.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;node:18-alpine&lt;/code&gt; and &lt;code&gt;node:20-alpine&lt;/code&gt; are frozen for another reason. Node 18 has been end of life since April 30, 2025, Node 20 since April 30, 2026. Their copy of Brotli is version 1.1.0, inside the affected range. Node's advisory says it plainly. These official releases remain vulnerable because their release lines received no fix.&lt;/p&gt;

&lt;p&gt;One last detail, on my laptop. The cached &lt;code&gt;node:24-alpine&lt;/code&gt; image dates from August 3. It holds Node 24.19.0, without the fix. A build that reuses that copy makes a vulnerable image, even with an up-to-date tag on Docker Hub.&lt;/p&gt;

&lt;p&gt;Then I searched my code for anything that decompresses Brotli. No service calls the Brotli functions of &lt;code&gt;zlib&lt;/code&gt;. None uses Express. The two Next.js frontends make no server-side &lt;code&gt;fetch&lt;/code&gt; in production. Their API calls leave from the browser.&lt;/p&gt;

&lt;p&gt;A single route makes a server-side &lt;code&gt;fetch&lt;/code&gt;. It only turns on in local development, toward a storage service I control. So my real exposure is low.&lt;/p&gt;

&lt;p&gt;But a grep does not see what my dependencies do. And the next server-side &lt;code&gt;fetch&lt;/code&gt; will arrive without anyone rereading the &lt;code&gt;FROM&lt;/code&gt; line.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Brotli version number proves nothing
&lt;/h2&gt;

&lt;p&gt;Node shows the version of its libraries in &lt;code&gt;process.versions&lt;/code&gt;. I compared two Node 22 images, one vulnerable and one fixed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run --rm node:22-alpine3.21 node -p &lt;span class="s2"&gt;"process.version + ' brotli ' + process.versions.brotli"&lt;/span&gt;
&lt;span class="c"&gt;# v22.21.1 brotli 1.1.0&lt;/span&gt;
docker run --rm node:22-alpine node -p &lt;span class="s2"&gt;"process.version + ' brotli ' + process.versions.brotli"&lt;/span&gt;
&lt;span class="c"&gt;# v22.23.4 brotli 1.1.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both show Brotli 1.1.0. Node applied Google's fix to its copy without changing that number. Node 24 is the same, with 1.2.0 before and after. Compare the Node version with 22.23.4, 24.22.1 or 26.12.1 instead.&lt;/p&gt;

&lt;p&gt;The fix also adds a constant to &lt;code&gt;zlib.constants&lt;/code&gt;. In my tests, it only exists in the fixed versions. It makes a quick check in a running container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker &lt;span class="nb"&gt;exec&lt;/span&gt; my-container node -p &lt;span class="s2"&gt;"process.version + ' ' + ('BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH' in require('zlib').constants)"&lt;/span&gt;
&lt;span class="c"&gt;# v22.23.4 true   (fixed)&lt;/span&gt;
&lt;span class="c"&gt;# v22.21.1 false  (vulnerable)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What to change
&lt;/h2&gt;

&lt;p&gt;If you cannot deploy today, two settings reduce the risk. With Express 5, the &lt;code&gt;inflate: false&lt;/code&gt; option rejects compressed bodies with a 415 error:&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="n"&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="n"&gt;express&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="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;inflate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&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="c1"&gt;// a body sent with Content-Encoding: br gets a 415 error&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With axios, the &lt;code&gt;decompress: false&lt;/code&gt; option turns decompression off. Your code then gets the compressed bytes, and handling them is up to you. For &lt;code&gt;fetch&lt;/code&gt;, I found no matching setting. Only a Node update protects it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;A Node fix only protects the container where it actually runs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[ ] List every &lt;code&gt;FROM node:&lt;/code&gt; line in your Dockerfiles&lt;/li&gt;
&lt;li&gt;[ ] Spot end-of-life versions: Node 18, Node 20 and older&lt;/li&gt;
&lt;li&gt;[ ] Spot tags tied to an Alpine version that is no longer built, such as &lt;code&gt;alpine3.21&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] Run &lt;code&gt;node -p process.version&lt;/code&gt; in every production container&lt;/li&gt;
&lt;li&gt;[ ] Do not trust &lt;code&gt;process.versions.brotli&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] Look for server-side &lt;code&gt;fetch&lt;/code&gt; and axios calls to URLs you do not control&lt;/li&gt;
&lt;li&gt;[ ] Look for Express 5 and direct calls to the Brotli functions of &lt;code&gt;zlib&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;[ ] Rebuild with &lt;code&gt;--pull&lt;/code&gt;, then redeploy&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;The Brotli flaw does not need you to call Brotli yourself. &lt;code&gt;fetch&lt;/code&gt;, axios and Express 5 do it for you, on data that comes from outside. And a Docker tag can look current while it ships a version that is a year old.&lt;/p&gt;

&lt;p&gt;Open your Dockerfiles today. Look for Node 18 and 20, and for tags that pin an Alpine version. Nobody will update them for you.&lt;/p&gt;

&lt;p&gt;Want a review of your images and your build pipeline? See my &lt;a href="https://jrobineau.com/en/services/devsecops-pipeline.html" rel="noopener noreferrer"&gt;DevSecOps pipeline offer&lt;/a&gt;, or &lt;a href="https://jrobineau.com/en/contact.html" rel="noopener noreferrer"&gt;let's talk&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Dossier DevSecOps et IA&lt;/p&gt;

&lt;h2&gt;
  
  
  Continuer sur ce sujet
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://jrobineau.com/en/blog/devsecops-ai/" rel="noopener noreferrer"&gt;Voir le dossier complet&lt;/a&gt;, puis deux retours directement liés et le service associé.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://nodejs.org/en/blog/vulnerability/october-2026-security-releases" rel="noopener noreferrer"&gt;Node.js, October 21, 2026 security releases&lt;/a&gt; · &lt;a href="https://nodejs.org/en/blog/release/v22.23.4" rel="noopener noreferrer"&gt;Node.js 22.23.4 release notes&lt;/a&gt; · &lt;a href="https://www.cve.org/CVERecord?id=CVE-2026-111497" rel="noopener noreferrer"&gt;CVE-2026-111497 record&lt;/a&gt; · &lt;a href="https://nvd.nist.gov/vuln/detail/CVE-2026-111497" rel="noopener noreferrer"&gt;NVD, CVE-2026-111497&lt;/a&gt; · &lt;a href="https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-111497" rel="noopener noreferrer"&gt;CISA KEV catalog&lt;/a&gt; · &lt;a href="https://www.csa.gov.sg/alerts-and-advisories/alerts/al-2026-154" rel="noopener noreferrer"&gt;Singapore CSA, alert AL-2026-154&lt;/a&gt; · &lt;a href="https://github.com/google/brotli/releases/tag/v1.2.1" rel="noopener noreferrer"&gt;Brotli 1.2.1 release notes&lt;/a&gt; · &lt;a href="https://github.com/nodejs/undici/blob/v6.29.1/lib/web/fetch/index.js" rel="noopener noreferrer"&gt;undici 6.29.1, fetch source&lt;/a&gt; · &lt;a href="https://github.com/expressjs/body-parser/blob/v2.4.0/lib/read.js" rel="noopener noreferrer"&gt;body-parser 2.4.0, body reading&lt;/a&gt; · &lt;a href="https://github.com/axios/axios/blob/v1.x/lib/adapters/http.js" rel="noopener noreferrer"&gt;axios HTTP adapter&lt;/a&gt; · &lt;a href="https://nodejs.org/api/zlib.html" rel="noopener noreferrer"&gt;Node.js zlib documentation&lt;/a&gt; · &lt;a href="https://github.com/nodejs/release#release-schedule" rel="noopener noreferrer"&gt;Node.js release schedule&lt;/a&gt; · &lt;a href="https://github.com/nodejs/docker-node/pull/2326" rel="noopener noreferrer"&gt;docker-node, Alpine 3.21 removal&lt;/a&gt; · &lt;a href="https://hub.docker.com/_/node" rel="noopener noreferrer"&gt;Docker Hub, node image&lt;/a&gt; · &lt;a href="https://docs.docker.com/reference/cli/docker/buildx/build/" rel="noopener noreferrer"&gt;docker build documentation&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>security</category>
      <category>docker</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The eMudhra fix lives in your Go binary, not in your Docker image</title>
      <dc:creator>Jules Robineau</dc:creator>
      <pubDate>Mon, 02 Nov 2026 07:03:00 +0000</pubDate>
      <link>https://dev.to/julesrobineau/the-emudhra-fix-lives-in-your-go-binary-not-in-your-docker-image-3i9g</link>
      <guid>https://dev.to/julesrobineau/the-emudhra-fix-lives-in-your-go-binary-not-in-your-docker-image-3i9g</guid>
      <description>&lt;p&gt;On October 19, Go shipped two security releases: 1.27.3 and 1.26.10. The fix touches a single package, &lt;code&gt;crypto/x509&lt;/code&gt;. I rebuilt one of my Go services on the same Docker image as before. Go's own scanner still found the flaw.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: the eMudhra fix is a list of eight banned keys, written into the code of &lt;code&gt;crypto/x509&lt;/code&gt;. That list is compiled into your binary. Updating the base image or the system certificates does not add it. You have to rebuild with Go 1.27.3 or 1.26.10, then redeploy. If your Dockerfile still builds with Go 1.25, rebuilding changes nothing: that version gets no more fixes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Versions and source status: snapshot as of October 31, 2026. Check the latest fixes before deploying.&lt;/p&gt;

&lt;p&gt;This article is for Go developers and for teams that ship Go services in containers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happened with eMudhra
&lt;/h2&gt;

&lt;p&gt;eMudhra is a &lt;a href="https://en.wikipedia.org/wiki/Certificate_authority" rel="noopener noreferrer"&gt;certificate authority&lt;/a&gt;. Most browsers and operating systems accept its certificates.&lt;/p&gt;

&lt;p&gt;On October 17, Mozilla blocked eight of its intermediate certificates in Firefox. An intermediate certificate is signed by the root. It is the one that then signs website certificates.&lt;/p&gt;

&lt;p&gt;The private keys of those eight certificates were very weak. They could be recovered in microseconds. With one of those keys, anyone can sign a TLS certificate for any domain. They can then sit between your service and the API it calls, and read the traffic.&lt;/p&gt;

&lt;p&gt;Go shipped its fix two days later. It was the project's first security release on the "URGENT" track. Usually the team announces a security fix three to seven days before it ships. This time it shipped with no advance notice.&lt;/p&gt;

&lt;h2&gt;
  
  
  My lab: the same service, three binaries
&lt;/h2&gt;

&lt;p&gt;Only the last two rows compare the same code with two compilers. The April binary is a historical reference.&lt;/p&gt;

&lt;p&gt;One of my projects has about ten Go services. They all declare &lt;code&gt;go 1.25.0&lt;/code&gt; in their &lt;code&gt;go.mod&lt;/code&gt;. Their Dockerfile builds with &lt;code&gt;golang:1.25-bookworm&lt;/code&gt;. It then copies the binary into a &lt;a href="https://github.com/GoogleContainerTools/distroless" rel="noopener noreferrer"&gt;distroless&lt;/a&gt; image.&lt;/p&gt;

&lt;p&gt;I ran one of those services through &lt;code&gt;govulncheck&lt;/code&gt;. It is Go's official tool for finding known vulnerabilities. With &lt;code&gt;-mode=binary&lt;/code&gt;, it analyzes a compiled binary directly.&lt;/p&gt;

&lt;p&gt;In Go's database, the eMudhra flaw is GO-2026-6809. It is still there with Go 1.25.14, and for a good reason: that version never got the fix.&lt;/p&gt;

&lt;p&gt;I checked Docker Hub. The &lt;code&gt;golang:1.25-bookworm&lt;/code&gt; image is the same as &lt;code&gt;golang:1.25.14-bookworm&lt;/code&gt;. It has not changed since August 19.&lt;/p&gt;

&lt;p&gt;Go's release policy explains why. Each major release is supported until two newer ones exist. Go 1.27 shipped on August 19. So Go 1.25 gets no fixes at all anymore. With my Dockerfile, rebuilding a hundred times fixes nothing.&lt;/p&gt;

&lt;p&gt;The 13 vulnerabilities left with Go 1.27.3 come from my dependencies: &lt;code&gt;golang.org/x/net&lt;/code&gt;, &lt;code&gt;golang.org/x/text&lt;/code&gt;, gRPC, pgx and OpenTelemetry. Rebuilding fixes the standard library. Modules are updated separately, with &lt;code&gt;go get&lt;/code&gt; and tests. I covered that part in &lt;a href="https://jrobineau.com/en/blog/2026-07-29-go-supply-chain-security.html" rel="noopener noreferrer"&gt;my article on the Go supply chain&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix is a list, compiled into your binary
&lt;/h2&gt;

&lt;p&gt;I opened the Go 1.27.3 source. The fix adds a table to &lt;code&gt;crypto/x509/verify.go&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c1"&gt;// distrustedSPKIHashes contains hashes of SPKIs from certificates which&lt;/span&gt;
&lt;span class="c1"&gt;// we don't consider to be trustworthy. We use these hashes to filter out&lt;/span&gt;
&lt;span class="c1"&gt;// chains returned by Verify&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;distrustedSPKIHashes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="k"&gt;struct&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="s2"&gt;"ebed6475c2c2d80fcb199f3fe8dd6e6b3ce60b77eb15d4e42c3dec0c6f5b5105"&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="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"49dd353dc2b919a3770645117d0e60c16115e7d1bc259eefe734b00ea434fe5f"&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="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;// ... six more hashes&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each line is the SHA-256 hash of a public key. &lt;code&gt;Verify&lt;/code&gt; builds the possible certificate chains. It drops every chain that contains one of those keys. If no chain is left, the TLS connection fails.&lt;/p&gt;

&lt;p&gt;Here is the key point. Go compiles its standard library into every binary. So this table lives inside your executable, not on the server's disk.&lt;/p&gt;

&lt;p&gt;Updating the &lt;code&gt;ca-certificates&lt;/code&gt; package in your image does not bring it in. That package holds root certificates. It cannot exclude an intermediate certificate. The Go team says it in its post: Linux has no system mechanism to revoke an intermediate. That is why it shipped an urgent release.&lt;/p&gt;

&lt;p&gt;On Linux, Go checks certificates itself. That covers almost all of your containers. A binary built with an older version still accepts those eight keys.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nobody watched the line that picks the compiler
&lt;/h2&gt;

&lt;p&gt;Those services do have Dependabot. Dependabot is GitHub's bot that proposes dependency updates. In these repositories, it only watches Go modules, and only my shared internal module.&lt;/p&gt;

&lt;p&gt;So the &lt;code&gt;FROM golang:1.25-bookworm&lt;/code&gt; line is watched by nothing. The frontend repository watches its Docker images. So does the Keycloak one. The Go services do not.&lt;/p&gt;

&lt;p&gt;I also found three Go versions in the same project. My CI runner image ships Go 1.25.8 for the tests. The Dockerfile builds with Go 1.25.14 today. The binary left on my laptop came from Go 1.25.0. The tests pass. They say nothing about the version that built the image.&lt;/p&gt;

&lt;p&gt;The lesson is simple. The compiler version is a dependency. It needs watching like the others.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check what runs, not what is written
&lt;/h2&gt;

&lt;p&gt;For comparable scans, save the date, &lt;code&gt;govulncheck&lt;/code&gt; version, commit and build flags. The vulnerability database changes. My lab totals are not expected results for your future scans.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;date&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;+%&lt;/span&gt;&lt;span class="no"&gt;FT&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="no"&gt;TZ&lt;/span&gt;
&lt;span class="n"&gt;govulncheck&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;
&lt;span class="n"&gt;git&lt;/span&gt; &lt;span class="n"&gt;rev&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;parse&lt;/span&gt; &lt;span class="no"&gt;HEAD&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your &lt;code&gt;go.mod&lt;/code&gt; gives a minimum version. It does not say what built your binary. To find out, ask the binary itself:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;go&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;my&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;head&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="c1"&gt;# ./my-service: go1.25.14&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A distroless image usually has no shell. An executable it contains can still run directly. For this check, copy the binary out:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;docker&lt;/span&gt; &lt;span class="n"&gt;create&lt;/span&gt; &lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt; &lt;span class="n"&gt;registry&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;my&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;
&lt;span class="n"&gt;docker&lt;/span&gt; &lt;span class="n"&gt;cp&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;my&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;my&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt;
&lt;span class="n"&gt;docker&lt;/span&gt; &lt;span class="n"&gt;rm&lt;/span&gt; &lt;span class="n"&gt;check&lt;/span&gt;
&lt;span class="n"&gt;govulncheck&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;mode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;binary&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;my&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;service&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;govulncheck&lt;/code&gt; exits with code 3 when it finds a vulnerability. A CI step that runs it fails on its own.&lt;/p&gt;

&lt;p&gt;One detail surprised me. My Dockerfile builds with &lt;code&gt;-ldflags="-s -w"&lt;/code&gt;. That option strips the symbol table from the binary. But &lt;code&gt;govulncheck&lt;/code&gt; uses it to know which functions are present. Without it, the tool reports more broadly.&lt;/p&gt;

&lt;p&gt;On the same code with Go 1.25.14, it reports 52 vulnerabilities instead of 21. The eMudhra flaw still shows up. For a precise result, also run &lt;code&gt;govulncheck ./...&lt;/code&gt; on the source code in your CI. Keep binary mode to check the image you ship.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to change
&lt;/h2&gt;

&lt;p&gt;For Dependabot, a few lines in &lt;code&gt;.github/dependabot.yml&lt;/code&gt; are enough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="k"&gt;package&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ecosystem&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;docker&lt;/span&gt;
    &lt;span class="n"&gt;directory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;
    &lt;span class="n"&gt;schedule&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="n"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;weekly&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;A standard library fix does not exist until your binary is rebuilt.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Run &lt;code&gt;go version -m&lt;/code&gt; on the binary of every deployed image&lt;/li&gt;
&lt;li&gt;[ ] Check that every binary uses at least go1.27.3 or go1.26.10&lt;/li&gt;
&lt;li&gt;[ ] Search all your Dockerfiles for &lt;code&gt;FROM golang:1.25&lt;/code&gt; and older&lt;/li&gt;
&lt;li&gt;[ ] Have Dependabot or Renovate watch the &lt;code&gt;docker&lt;/code&gt; ecosystem&lt;/li&gt;
&lt;li&gt;[ ] Run &lt;code&gt;govulncheck&lt;/code&gt; in CI, on the source code and on the binary&lt;/li&gt;
&lt;li&gt;[ ] Align the CI Go version with the image Go version&lt;/li&gt;
&lt;li&gt;[ ] Rebuild and redeploy the services nobody has touched in a long time&lt;/li&gt;
&lt;li&gt;[ ] Update your modules separately, with &lt;code&gt;go get&lt;/code&gt; and tests&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;In Go, part of your TLS security lives in your binary. When Go fixes its standard library, your service stays vulnerable until the next build. And if your build image is no longer supported, you never get a build containing the fix.&lt;/p&gt;

&lt;p&gt;Open each of your Dockerfiles today and look at the &lt;code&gt;FROM golang&lt;/code&gt; line. It is the dependency nobody reviews.&lt;/p&gt;

&lt;p&gt;Want a review of your Go images and your build pipeline? See my &lt;a href="https://jrobineau.com/en/services/devsecops-pipeline.html" rel="noopener noreferrer"&gt;DevSecOps pipeline offer&lt;/a&gt;, or &lt;a href="https://jrobineau.com/en/contact.html" rel="noopener noreferrer"&gt;let's talk&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://go.dev/blog/emudhra-incident" rel="noopener noreferrer"&gt;Go blog, response to the eMudhra incident&lt;/a&gt; · &lt;a href="https://pkg.go.dev/vuln/GO-2026-6809" rel="noopener noreferrer"&gt;Go vulnerability database, GO-2026-6809 (CVE-2026-111943)&lt;/a&gt; · &lt;a href="https://go.dev/cl/851047" rel="noopener noreferrer"&gt;Go, change 851047&lt;/a&gt; · &lt;a href="https://go.dev/doc/devel/release" rel="noopener noreferrer"&gt;Go release history and policy&lt;/a&gt; · &lt;a href="https://go.dev/security/policy" rel="noopener noreferrer"&gt;Go security policy&lt;/a&gt; · &lt;a href="https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck" rel="noopener noreferrer"&gt;govulncheck documentation&lt;/a&gt; · &lt;a href="https://hub.docker.com/_/golang" rel="noopener noreferrer"&gt;Docker Hub, golang image&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>docker</category>
      <category>go</category>
      <category>security</category>
    </item>
    <item>
      <title>AI agent or human error, it does not matter: did your backup hold?</title>
      <dc:creator>Jules Robineau</dc:creator>
      <pubDate>Wed, 28 Oct 2026 07:03:00 +0000</pubDate>
      <link>https://dev.to/julesrobineau/ai-agent-or-human-error-it-does-not-matter-did-your-backup-hold-1nbd</link>
      <guid>https://dev.to/julesrobineau/ai-agent-or-human-error-it-does-not-matter-did-your-backup-hold-1nbd</guid>
      <description>&lt;p&gt;On 14 October, a whole season of The Challenge, a show on the Swedish channel TV4, disappeared. It was edited and due to air five weeks later. In the morning, the newspaper Aftonbladet blamed an AI agent. In the afternoon, TV4 denied it: no AI, but human error at the producer.&lt;/p&gt;

&lt;p&gt;Everyone argued about the same question: who deleted it? TV4's head of programming gave the only useful answer. There was a backup, and it had not worked. When the files disappeared, they did not exist anywhere else.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: after a deletion, people look for the culprit. AI agent, colleague or script, it barely matters. The real question is why no copy was left. My own backup stopped for four months without me noticing. A useful backup reports its silence, stays out of reach of whatever can delete, and has actually been restored.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This article is for developers who let AI agents work on their machine, and for business owners responsible for their data. No technical background is needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who deleted it? The question saves nothing
&lt;/h2&gt;

&lt;p&gt;Back to the Swedish story. According to Aftonbladet's sources, the producer Mastiff had let an AI agent onto its server. According to the same paper, TV4 answered that same day that its investigation pointed to "the human factor" at Mastiff, and not to AI.&lt;/p&gt;

&lt;p&gt;The raw footage survived. All the editing has to be redone. The premiere, planned for 22 November, moved to 2027.&lt;/p&gt;

&lt;p&gt;Agent or human, the result is the same. Months of work have to be redone. The difference between an outage and a disaster is not the culprit. It is the copy.&lt;/p&gt;

&lt;h2&gt;
  
  
  When the copy lives where the original lives
&lt;/h2&gt;

&lt;p&gt;In April 2026, at the startup PocketOS, a coding agent was working on a test environment. It was Cursor, running Claude Opus 4.6. It hit a credentials error and decided to fix it on its own.&lt;/p&gt;

&lt;p&gt;It found an access token in a file unrelated to its task. That token had been created to manage domain names. In fact, it gave full rights on the hosting provider's API. The agent deleted the production database volume in a single call. It took 9 seconds.&lt;/p&gt;

&lt;p&gt;The backups went with it. The host, Railway, stored them in the same volume as the data. The founder summed it up: the copy was in the same blast radius as the original.&lt;/p&gt;

&lt;p&gt;The story ends well. Railway recovered the data from its own copies, kept elsewhere. Since then, its API deletions wait 48 hours before they become final. But that rescue did not come from PocketOS. Its own latest usable backup was three months old.&lt;/p&gt;

&lt;h2&gt;
  
  
  My backup stopped for four months, and I did not notice
&lt;/h2&gt;

&lt;p&gt;I run my coding agents without confirmation prompts. My safety net is an hourly backup of my work folders. It uses &lt;a href="https://restic.net/" rel="noopener noreferrer"&gt;restic&lt;/a&gt;, and goes to a storage space I rent from Hetzner.&lt;/p&gt;

&lt;p&gt;On 1 June, I reinstalled my machine. I wanted the new Ubuntu release, because of Nvidia driver problems. The reinstall wiped two small things: the &lt;a href="https://wiki.archlinux.org/title/Systemd/Timers" rel="noopener noreferrer"&gt;systemd timer&lt;/a&gt; that started the backup, and the file that held its password.&lt;/p&gt;

&lt;p&gt;No backup ran from 1 June to 2 October. Nothing warned me.&lt;/p&gt;

&lt;p&gt;A backup that fails makes noise: an error, an email, a red message. A backup that no longer runs makes no noise at all. That is the one you need to watch.&lt;/p&gt;

&lt;p&gt;I noticed by looking at my storage space at Hetzner. It had not changed in a long time.&lt;/p&gt;

&lt;p&gt;Then I had to open the old repository. The passphrase was nowhere to be found. I had typed it by hand when I created it. I was sure I had written it down somewhere. It was nowhere, not even in my password manager. And restic's documentation is clear: without the password, the data cannot be accessed. I had to start again with a new repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I set up since
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A record of every success.&lt;/strong&gt; After each successful backup, the script writes the time to a file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An alert on silence.&lt;/strong&gt; Every time my agent starts a session, a hook reads that file. If the last success is more than 48 hours old, it warns me.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A real restore.&lt;/strong&gt; I restored a full folder somewhere else, then compared. All 4,495 files were identical.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A regular re-read.&lt;/strong&gt; Every week, restic re-reads a different part of the backed-up data. In a year, the whole repository gets read.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A layer out of reach.&lt;/strong&gt; Hetzner takes a daily &lt;a href="https://en.wikipedia.org/wiki/Snapshot_(computer_storage)" rel="noopener noreferrer"&gt;snapshot&lt;/a&gt; of my space, kept for about ten days. My laptop's SSH key can delete the restic repository. It cannot delete those snapshots, which are only managed from Hetzner's console or API.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last layer has two limits, and I would rather say them.&lt;/p&gt;

&lt;p&gt;First, snapshots rotate. Each new one pushes out the oldest. If nobody notices a deletion within ten days, there is nothing left to recover. With four months of silence, they would not have saved me. That is why the 48-hour alert matters so much.&lt;/p&gt;

&lt;p&gt;Second, they live on the same space, at the same provider. Hetzner says it itself: a snapshot is not a full backup. It protects against a deletion from my laptop. Not against losing the account. So I still lack a copy somewhere else, and offline.&lt;/p&gt;

&lt;h2&gt;
  
  
  A useful backup answers four questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Is it still running?&lt;/strong&gt; Do not watch for errors. Watch for missing successes. A last-success date and an alert past a deadline are enough.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who can delete it?&lt;/strong&gt; If your laptop, your agent or one of its tokens can delete the backup, it is not a backup. It is a second folder waiting to be deleted. restic offers an append-only mode with its dedicated server: the client can add backups, not remove them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is it in the same place as the original?&lt;/strong&gt; ANSSI, the French cybersecurity agency, recommends the 3-2-1 rule. That means three copies of the data: the original and two backups on different media, one of them offline. Attackers target the copies too. According to Sophos, 94% of organizations hit by ransomware say the attackers tried to compromise their backups.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have you ever restored it?&lt;/strong&gt; A backup that was never restored is only a hope. ANSSI puts it simply: backups must be tested regularly. The passphrase is part of that. Store it where you will find it on the day things break.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Who deletes does not matter. What is left afterwards does.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Record the time of the last success, and alert if it is more than 48 hours old&lt;/li&gt;
&lt;li&gt;[ ] Check who can delete the backup: not your laptop, not your agent, not its tokens&lt;/li&gt;
&lt;li&gt;[ ] Keep one copy away from the original, and one copy offline&lt;/li&gt;
&lt;li&gt;[ ] Store the passphrase in your password manager, then check that it opens the repository&lt;/li&gt;
&lt;li&gt;[ ] Restore a real folder, compare the files, write down the date of the test&lt;/li&gt;
&lt;li&gt;[ ] Re-read part of the backed-up data every week&lt;/li&gt;
&lt;li&gt;[ ] After a reinstall, check that your scheduled tasks still run&lt;/li&gt;
&lt;li&gt;[ ] Give your agents tokens limited to their task&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What to remember
&lt;/h2&gt;

&lt;p&gt;One day, something will delete your data. An AI agent, a colleague, a script, or you. You do not control who. You control the copy.&lt;/p&gt;

&lt;p&gt;A useful backup is watched for its silence. It lives out of reach of whatever can delete. And it has been restored at least once.&lt;/p&gt;

&lt;p&gt;Want to check that your team's backups would hold the day an agent gets it wrong? &lt;a href="https://jrobineau.com/en/contact.html" rel="noopener noreferrer"&gt;Let's talk&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://www.tv4.se/artikel/2iwfK5MNpFID98pxQbsC7t/hel-saesong-av-tv4-programmet-raderat-av-ai" rel="noopener noreferrer"&gt;TV4, The Challenge season deleted (14/10/2026)&lt;/a&gt; · &lt;a href="https://www.aftonbladet.se/nojesbladet/a/31oE8A/the-challenge-sverige-raderad-av-ai-bara-veckor-innan-premiaren" rel="noopener noreferrer"&gt;Aftonbladet, same story&lt;/a&gt; · &lt;a href="https://cybernews.com/ai-news/the-challenge-tv-season-deleted-ai-agent-tv4/" rel="noopener noreferrer"&gt;Cybernews, in English&lt;/a&gt; · &lt;a href="https://decrypt.co/365897/ai-agent-deletes-startup-database-9-seconds-founder-says" rel="noopener noreferrer"&gt;Decrypt, PocketOS (28/04/2026)&lt;/a&gt; · &lt;a href="https://blog.railway.com/p/your-ai-wants-to-nuke-your-database" rel="noopener noreferrer"&gt;Railway, recovery and guardrails&lt;/a&gt; · &lt;a href="https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html" rel="noopener noreferrer"&gt;restic, repository password&lt;/a&gt; · &lt;a href="https://github.com/restic/rest-server" rel="noopener noreferrer"&gt;restic rest-server, append-only mode&lt;/a&gt; · &lt;a href="https://docs.hetzner.com/storage/storage-box/snapshots/" rel="noopener noreferrer"&gt;Hetzner, Storage Box snapshots&lt;/a&gt; · &lt;a href="https://messervices.cyber.gouv.fr/documents-guides/anssi_fondamentaux_sauvegarde_systemes_dinformation_v1.1.pdf" rel="noopener noreferrer"&gt;ANSSI, backup fundamentals (2025, French)&lt;/a&gt; · &lt;a href="https://www.sophos.com/en-us/blog/the-impact-of-compromised-backups-on-ransomware-outcomes" rel="noopener noreferrer"&gt;Sophos, compromised backups (2024)&lt;/a&gt;&lt;/p&gt;

</description>
      <category>backup</category>
      <category>devops</category>
      <category>ai</category>
      <category>security</category>
    </item>
    <item>
      <title>Nobody keeps watching an AI that is almost always right</title>
      <dc:creator>Jules Robineau</dc:creator>
      <pubDate>Mon, 26 Oct 2026 07:03:00 +0000</pubDate>
      <link>https://dev.to/julesrobineau/nobody-keeps-watching-an-ai-that-is-almost-always-right-3bo4</link>
      <guid>https://dev.to/julesrobineau/nobody-keeps-watching-an-ai-that-is-almost-always-right-3bo4</guid>
      <description>&lt;p&gt;On 13 October, around 11:45 pm, a Tesla drove through a closed-off lane on the I-80 freeway in California. It hit a highway patrol car stopped at an earlier crash. Two officers were injured. The driver, aged 22, told the police he was asleep and that the car was on FSD. The police have not confirmed that FSD was engaged.&lt;/p&gt;

&lt;p&gt;FSD stands for Full Self-Driving. The full product name is "Full Self-Driving (Supervised)". The word that matters is in parentheses.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: a human does not keep watching a machine that is almost always right. We have known it since 1983. The numbers confirm it on the road, and with coding agents. At Anthropic, testers catch 17% of dangerous commands early in a session, and about 5% after 50 prompts. Approving every action does not protect you. Put the control in the system: rules that block, traces to read, a copy out of reach.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This article is for developers and business owners who let AI agents act, and who count on a human to watch them.&lt;/p&gt;

&lt;h2&gt;
  
  
  "Supervised" means you are the one watching
&lt;/h2&gt;

&lt;p&gt;Tesla renamed its product in late March 2024. "FSD Beta" became "FSD (Supervised)". The manual is clear. The car needs a fully attentive driver, ready to take over at any moment. A cabin camera checks the driver's attention.&lt;/p&gt;

&lt;p&gt;Tesla's support page says it in four words: "Do not become complacent."&lt;/p&gt;

&lt;p&gt;The problem is that the system works most of the time. On the same page, Tesla claims seven times fewer collisions with FSD engaged. That is Tesla's own figure. But it does describe the driver's experience: hundreds of trips without trouble.&lt;/p&gt;

&lt;p&gt;The US road safety agency, NHTSA, has been running an in-depth investigation since March on 3.2 million equipped vehicles. It covers crashes in reduced visibility. In the cases reviewed, the system only warned the driver at the very last moment. According to the agency, drivers may not have known they had to step in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Humans cannot watch a reliable machine
&lt;/h2&gt;

&lt;p&gt;In 1983, psychologist Lisanne Bainbridge published a short paper, "Ironies of Automation". It is still cited everywhere. Its idea fits in two sentences.&lt;/p&gt;

&lt;p&gt;When you automate, you leave the human one task: watch the machine and step in when it fails. That is precisely the task humans do badly.&lt;/p&gt;

&lt;p&gt;She builds on studies from the 1950s. Even motivated, nobody keeps effective attention for more than half an hour on something where almost nothing happens. And the longer a machine has worked well, the less people watch it.&lt;/p&gt;

&lt;p&gt;Recent studies say the same. In 2024, IIHS, a US road safety institute, followed 14 Tesla drivers for four weeks using Autopilot. First attention reminders went up 26%. Stronger alerts went down 64%. Drivers had learned to silence the car with a quick nudge on the wheel, then went back to their phones.&lt;/p&gt;

&lt;p&gt;Videos also show the camera fooled by a folded bill, a paper face or a doll's head. These are not serious tests. But they show what a human does with a control that gets in the way: they work around it.&lt;/p&gt;

&lt;h2&gt;
  
  
  With a coding agent, it is the same thing
&lt;/h2&gt;

&lt;p&gt;A coding agent often asks for your permission before acting. Run a command, edit a file, install a package. You click yes or no. It is the same deal as FSD: the machine acts, the human watches.&lt;/p&gt;

&lt;p&gt;In August, Anthropic published numbers on Claude Code. Users approve 97% of permission prompts. Anthropic also ran a test with 1,053 paid testers. Each one had a dangerous command slipped into their session. The humans caught 13.6% of them.&lt;/p&gt;

&lt;p&gt;The detail says even more. Early in a session, testers blocked about 17% of dangerous commands. After 50 prompts, they blocked only about 5%. That is exactly the wear Bainbridge described, measured on developers.&lt;/p&gt;

&lt;p&gt;An honest caveat: Anthropic offers an automatic alternative to these approvals, called auto mode. These numbers also serve its product. They are still the only ones of that size I found.&lt;/p&gt;

&lt;p&gt;The 2026 Stack Overflow survey adds a contrast. Only 6.6% of developers trust AI for an important decision. These are not the same people as Claude Code users. But the gap tells you something: we distrust in theory, and we click yes in practice.&lt;/p&gt;

&lt;h2&gt;
  
  
  My agent runs without asking for confirmation
&lt;/h2&gt;

&lt;p&gt;My Claude agent runs without asking me to confirm each action. But I did not replace supervision with nothing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jrobineau.com/en/blog/2026-10-21-what-is-an-agent-harness.html" rel="noopener noreferrer"&gt;Hooks&lt;/a&gt; watch everything. Before each command, a guardrail reads it and blocks the ones that destroy something. And every action is logged. If something goes wrong, I can trace it back and audit.&lt;/p&gt;

&lt;p&gt;While I was preparing this article, the guardrail blocked a command from my agent. It was a &lt;code&gt;git checkout -- .&lt;/code&gt;, which wipes uncommitted changes with no way back. The agent had to take a safer route, a &lt;code&gt;git stash&lt;/code&gt;, which sets them aside. Nobody had to click anything.&lt;/p&gt;

&lt;p&gt;This guardrail has its limits. In my tests, a misresolved variable or a Python script could still get through. That is why logs and backups remain essential. I cover it in &lt;a href="https://jrobineau.com/en/blog/2026-07-23-ai-agent-permissions-dev-vs-prod.html" rel="noopener noreferrer"&gt;the article on agent permissions&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Put the control in the system, not in someone's attention
&lt;/h2&gt;

&lt;p&gt;The lesson from Tesla and Bainbridge is not "humans are bad". It is a known limit. You have to build from it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What is forbidden is blocked by a rule.&lt;/strong&gt; Not by a click, not by an instruction in the prompt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human approval is kept for what cannot be undone.&lt;/strong&gt; Deleting, sending, paying, deploying to production. The fewer prompts, the more each one actually gets read.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Everything that goes through leaves a trace.&lt;/strong&gt; A trace can be read later, with a clear head.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One copy stays out of reach.&lt;/strong&gt; The day everything else fails, that copy saves you.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is already how &lt;a href="https://jrobineau.com/en/blog/2026-09-28-ai-agent-auto-reply-approval.html" rel="noopener noreferrer"&gt;my mail agent&lt;/a&gt; works. Each type of reply has its own sending rule, written in code. A simple question goes out on its own, twice at most, with a delay. A refusal always waits for my click.&lt;/p&gt;

&lt;h2&gt;
  
  
  The checklist
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Do not count on anyone's vigilance to hold your security.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Count the approval prompts one person gets per day&lt;/li&gt;
&lt;li&gt;[ ] Block forbidden commands with a hook, not with a sentence in the prompt&lt;/li&gt;
&lt;li&gt;[ ] Keep human approval for irreversible actions&lt;/li&gt;
&lt;li&gt;[ ] Log every agent action, and read the logs from time to time&lt;/li&gt;
&lt;li&gt;[ ] Test your guardrails with deliberately dangerous commands&lt;/li&gt;
&lt;li&gt;[ ] Keep a copy of your data that the agent cannot touch&lt;/li&gt;
&lt;li&gt;[ ] Never present "a human approves it" as enough security&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What to remember
&lt;/h2&gt;

&lt;p&gt;"Supervised" protects nobody if the supervisor ends up asleep, or clicking yes without reading. It is not a character flaw. It is a human limit described since 1983, and measured again this year.&lt;/p&gt;

&lt;p&gt;An AI agent that is almost always right is the most dangerous case. Build its guardrails as if nobody were watching.&lt;/p&gt;

&lt;p&gt;Want to set up your team's agents without counting on anyone's vigilance? &lt;a href="https://jrobineau.com/en/contact.html" rel="noopener noreferrer"&gt;Let's talk&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt; &lt;a href="https://electrek.co/2026/10/16/tesla-fsd-crash-chp-patrol-car-driver-asleep-fairfield/" rel="noopener noreferrer"&gt;Electrek, Fairfield crash (16/10/2026)&lt;/a&gt; · &lt;a href="https://www.cbsnews.com/sacramento/news/i80-fairfield-tesla-full-self-driving-chp-crash-video/" rel="noopener noreferrer"&gt;CBS Sacramento, same crash&lt;/a&gt; · &lt;a href="https://www.tesla.com/support/fsd" rel="noopener noreferrer"&gt;Tesla, FSD (Supervised) support page&lt;/a&gt; · &lt;a href="https://static.nhtsa.gov/odi/inv/2026/INOA-EA26002-10023.pdf" rel="noopener noreferrer"&gt;NHTSA, investigation EA26002&lt;/a&gt; · &lt;a href="https://doi.org/10.1016/0005-1098(83)90046-8" rel="noopener noreferrer"&gt;Bainbridge, Ironies of Automation (1983)&lt;/a&gt; · &lt;a href="https://www.iihs.org/news/detail/drivers-quickly-learn-to-skirt-limits-set-by-partial-automation-systems" rel="noopener noreferrer"&gt;IIHS, Autopilot study (2024)&lt;/a&gt; · &lt;a href="https://claude.com/blog/auto-mode-default-in-claude-code" rel="noopener noreferrer"&gt;Anthropic, approval data (07/08/2026)&lt;/a&gt; · &lt;a href="https://survey.stackoverflow.co/2026/ai/data/ai-trust" rel="noopener noreferrer"&gt;Stack Overflow 2026, trust in AI&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>security</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
