<?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: Evgenii Iakovenko</title>
    <description>The latest articles on DEV Community by Evgenii Iakovenko (@yakoveka).</description>
    <link>https://dev.to/yakoveka</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%2F4200028%2F958cd620-4421-441b-8d5b-476d8b222688.png</url>
      <title>DEV Community: Evgenii Iakovenko</title>
      <link>https://dev.to/yakoveka</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yakoveka"/>
    <language>en</language>
    <item>
      <title>Finding PHP bugs is cheap now. Drupal, Symfony and Laravel are shipping the fixes three different ways</title>
      <dc:creator>Evgenii Iakovenko</dc:creator>
      <pubDate>Thu, 03 Dec 2026 10:13:32 +0000</pubDate>
      <link>https://dev.to/yakoveka/finding-php-bugs-is-cheap-now-drupal-symfony-and-laravel-are-shipping-the-fixes-three-different-3m6e</link>
      <guid>https://dev.to/yakoveka/finding-php-bugs-is-cheap-now-drupal-symfony-and-laravel-are-shipping-the-fixes-three-different-3m6e</guid>
      <description>&lt;p&gt;On 25 November Symfony published 23 security advisories in one day. The same day Drupal released SA-CORE-2026-019, the fix for its own incomplete fix from a week before. Laravel published 23 framework advisories over November, and five more on 2 December. Drupal had already shipped 106 advisories in October alone.&lt;/p&gt;

&lt;p&gt;None of this means the code got worse overnight. Drupal's security team put it plainly in October: the surge reflects "an increase in automated discovery velocity", and "finding vulnerabilities is no longer the slow step". PHP2Shell, the PHP core bug from part one, was found with AI tools and went from the first find to a working exploit against Drupal in one day.&lt;/p&gt;

&lt;p&gt;This is the last of three posts about PHP security in autumn 2026. Part one covered PHP core, part two covered Drupal and how I patched two sites through the installer takeover. This one compares how three PHP ecosystems are coping with the volume, because they are solving it in three different places, and none of them can solve the last step for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drupal: a volunteer team, funded triage, and a pre-announced release
&lt;/h2&gt;

&lt;p&gt;Drupal's security team is made up of volunteers, and the SA-CORE-2026-019 advisory says so in its footer. What changed this year is the money and the tooling around them. In May 2026 the Drupal Association received a grant from Alpha-Omega for a Security Engineer in Residence, and the funded team started in early June. A bot called Triagebot posts one message per new report with a suggested classification and likely duplicates, "and does nothing else". AI tooling proposes weakness classifications for CVE records, "with mandatory human verification on every entry".&lt;/p&gt;

&lt;p&gt;The Drupal blog post from 29 October is unusually honest about what that bought them: "funding the complete review workflow is the only reason our volunteer process kept publishing without buckling". It also says where the bottleneck moved: "A security fix reaches sites only when a release ships", and "core release management needs more resources (funding, people) as well". Core maintainers have opened proposals to change the security release process.&lt;/p&gt;

&lt;p&gt;Drupal's biggest strength for site owners is the warning. Two days before the 18 November release, a PSA told everyone a highly critical core fix was coming and that "exploits might be developed within hours or days". Exploitation was reported about a day after the release. If you read the PSA, you had a release window booked before the bug was public.&lt;/p&gt;

&lt;p&gt;The cost showed up a week later. SA-CORE-2026-017 didn't cover sites in "unusual or incomplete install states", so 019 had to follow, and that one needed &lt;code&gt;update.php&lt;/code&gt; on top of the new code. Fast fixes get second rounds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Symfony: long LTS windows and big batches
&lt;/h2&gt;

&lt;p&gt;Symfony's model is release discipline. Symfony 7.4 is an LTS branch with security fixes until the end of November 2029, and 6.4 gets them until the end of November 2027. The advisories arrive in batches: 23 on 25 November, after a batch of Twig advisories on 24 November. For a team on an LTS branch, that is one patch release to apply, not 23 decisions.&lt;/p&gt;

&lt;p&gt;I like this model for the boring reason: it makes the upgrade a routine. You stay on the LTS minor, you take the patch release, and the change set is small enough to test in an afternoon.&lt;/p&gt;

&lt;p&gt;The cost is visible in the batch itself. Of the 23 titles from 25 November, five say "incomplete fix for" an earlier CVE and one says "regression of" a CVE from 2020. And on 29 October Symfony published a post about something worse: a Mime header injection fix announced in May as released "was committed, but this commit was never merged into a maintenance branch, so no release contained it". Users noticed and reported it. I respect that they wrote it up in plain words, and it is the same lesson Drupal wrote down: a fix that is not in a release protects nobody.&lt;/p&gt;

&lt;h2&gt;
  
  
  Laravel: owning the platform the code runs on
&lt;/h2&gt;

&lt;p&gt;Laravel is the only one of the three that also sells hosting, through Laravel Cloud, Forge and Vapor, and that changed how PHP2Shell went for its customers. Laravel's post-mortem has the timeline. The PHP project sent a pre-announcement at 19:58 UTC on 20 October. At 08:55 the next morning Laravel turned on Cloudflare's managed firewall rules for Cloud domains. PHP published the release at 13:38, the Cloud runtime patch started rolling out at 14:31, and at 18:05 it was at 100% in every Cloud region. About four and a half hours from release to every Cloud workload, patched in place, with no redeploy from customers.&lt;/p&gt;

&lt;p&gt;The rest of the platform shows the limits of the model. Forge changed the PHP default for new servers only. For existing ones the announcement said "we haven't changed this for you" and asked customers to set &lt;code&gt;session.upload_progress.enabled = Off&lt;/code&gt; themselves. Vapor customers had to redeploy to get the patched runtimes, and "if you're running PHP 8.0, or 8.1 no patch is available". Forge itself had a bad evening: about 48,000 deployment jobs queued, roughly 4,800 cancelled, and a recovery announced too early, which Laravel calls "premature" in its own post-mortem. Their fixes are process ones: incident commander sign-off on every customer message, one owner per channel, a soak period before announcing recovery, and recorded war rooms.&lt;/p&gt;

&lt;p&gt;The line from that post I keep quoting: "This will keep happening. Disclosures like these are now frequent, and AI is shortening the time between a vulnerability becoming known and someone trying to exploit it."&lt;/p&gt;

&lt;p&gt;One thing the platform doesn't do for you: the framework bump. Laravel Cloud patched the PHP runtime, but the 23 framework advisories from November still need a &lt;code&gt;composer update&lt;/code&gt; in your repository, a test run and a deploy. The two High ones from late November are both covered by 12.74.0 on Laravel 12 and 13.44.1 on Laravel 13. Laravel 11 stopped getting security fixes in March 2026.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the three have in common
&lt;/h2&gt;

&lt;p&gt;Each of them is fixing a different stage of the same pipeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Drupal is fixing intake: triage, deduplication and review, so the volunteer team can keep up with the reports.&lt;/li&gt;
&lt;li&gt;Symfony is fixing packaging: predictable LTS releases that bundle many fixes into one upgrade.&lt;/li&gt;
&lt;li&gt;Laravel is fixing delivery, but only for the runtime on its own hosting.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;None of them can do the last step for a site that you host yourself: getting the new code into production and restarting the processes that run it. And two of the three shipped fixes for their own incomplete fixes this autumn, which matches PHP itself, where 21 October was followed by the 19 November batch. I would plan for every critical fix to come back once.&lt;/p&gt;

&lt;p&gt;If I had to copy one model for my own sites, it would be Laravel's, at a much smaller scale. Own the path from "release published" to "every process restarted", and make it one command. Boardinn, the white-label SaaS I build, already works like that: one container image, and a release rolls every tenant site. In part two that rollout put the fleet on the fixed Drupal core 13 minutes after exploitation was first reported, which is too close for comfort, and the fix for that was earlier signals, not a faster pipeline. The gap I wrote about in part one is still open: PHP itself only moves when I rebuild the image, and I still don't have a scheduled rebuild for quiet weeks. That's next on my list.&lt;/p&gt;

&lt;h2&gt;
  
  
  A checklist for business and government
&lt;/h2&gt;

&lt;p&gt;This is the part for the people who sign the budget and the contracts.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Inventory.&lt;/strong&gt; For each application: PHP version and SAPI, framework and version, and who patches the runtime (you, a hosting platform, or nobody). If nobody can fill in the third column, that's the finding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Know the support dates.&lt;/strong&gt; PHP 8.1 and older are end of life and have no PHP2Shell fix, and PHP 8.2 security support ends on 31 December 2026. Laravel 11 is end of life, and Laravel 12 gets security fixes until 24 February 2027. Symfony 8.0 is end of life, 8.1 ends in January 2027, and 6.4 in November 2027. Drupal 11.2 and below and 10.5 and below no longer get security releases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set a patch deadline in hours for the worst cases, and measure it to production.&lt;/strong&gt; For a known exploited vulnerability or a "highly critical" Drupal advisory, the clock stops when every site runs the fixed code, not when the pull request is merged. For comparison, SecurityWeek reports that US federal agencies got three days to patch SA-CORE-2026-017 after CISA added it to its Known Exploited Vulnerabilities catalogue.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plan for the second round.&lt;/strong&gt; Keep the people and the release window available for a week after a critical fix. PHP, Drupal and Symfony all shipped follow-ups this autumn.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Watch the pre-announcements.&lt;/strong&gt; PHP and Drupal both announced their critical releases in advance. That warning is the cheapest hours you will ever get.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat mitigations as bridges.&lt;/strong&gt; Drupal Steward, a managed WAF ruleset or PHP's ini workarounds buy you hours. Drupal and PHP both say it about their own mitigations: upgrade anyway.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If you use a platform, read what it patches.&lt;/strong&gt; A hosting platform can patch PHP for you. It will not update your framework in &lt;code&gt;composer.lock&lt;/code&gt;. Write down who owns each layer, and put the patch deadline in the contract if a vendor owns one.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  End of the series
&lt;/h2&gt;

&lt;p&gt;Three posts in, my summary is short. Finding bugs is cheap now, and that will not reverse. The projects are adapting: Drupal with funded triage, Symfony with release discipline, Laravel by patching the runtime on its own hosting. The part they can't adapt for you is your own deploy.&lt;/p&gt;

&lt;p&gt;One question for you: when the next PHP2Shell lands, who in your organisation owns the step from "release published" to "every worker restarted", and how many hours does it take?&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>php</category>
      <category>security</category>
      <category>vulnerabilities</category>
    </item>
    <item>
      <title>Drupal in November 2026: 106 advisories a month, an installer takeover, and how I patched two sites through it</title>
      <dc:creator>Evgenii Iakovenko</dc:creator>
      <pubDate>Mon, 30 Nov 2026 11:44:49 +0000</pubDate>
      <link>https://dev.to/yakoveka/drupal-in-november-2026-106-advisories-a-month-an-installer-takeover-and-how-i-patched-two-sites-3i6</link>
      <guid>https://dev.to/yakoveka/drupal-in-november-2026-106-advisories-a-month-an-installer-takeover-and-how-i-patched-two-sites-3i6</guid>
      <description>&lt;p&gt;On 18 November Drupal published SA-CORE-2026-017: the installer could be used to reinstall a live site, which ends in a site takeover and remote code execution. The advisory was later updated to say exploitation started as early as 19 November, 19:00 UTC. The fleet behind Boardinn, the white-label SaaS I build, got the fix at 19:13 UTC that day. Thirteen minutes after exploitation began.&lt;/p&gt;

&lt;p&gt;That's a margin I don't want to rely on. My other site, Milo, got the same fix at 07:33 UTC on 20 November, twelve and a half hours into known exploitation.&lt;/p&gt;

&lt;p&gt;This is part two of three about PHP security in autumn 2026. Part one covered PHP core: PHP2Shell and the 19 November release. This one is Drupal. Part three compares how Symfony, Laravel and Drupal are coping with the volume.&lt;/p&gt;

&lt;h2&gt;
  
  
  The surge
&lt;/h2&gt;

&lt;p&gt;On 29 October the Drupal Security Team published the numbers. From June through October 2026 Drupal shipped 256 security advisories, more than in the previous 30 months combined. The monthly count went from about 8 in early 2026 to 28 in June, 74 in September and 106 in October. The peak was 39 advisories on one day, 28 October. 134 people were credited with reports since 1 June, against 68 in all of 2025, "many of them using AI tools".&lt;/p&gt;

&lt;p&gt;The team's reading is that the surge reflects "an increase in automated discovery velocity", not worse code. One line from the post sums it up: "Finding vulnerabilities is no longer the slow step."&lt;/p&gt;

&lt;p&gt;SA-CORE-2026-017 fits that pattern. The advisory credits the discovery to Anthropic's OSS Scanner, a free opt-in service that, according to SecurityWeek, had reported more than 5,000 vulnerabilities across 680 open source projects by early November.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three advisories in eight days
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SA-CORE-2026-017&lt;/strong&gt; (18 November, CVE-2026-132165, Highly critical, 20/25). The installer can be used to reinstall Drupal, which gives the attacker the site. Fixed in 10.6.22, 11.3.22 and 11.4.13. Drupal published a PSA two days ahead of the release and warned that "exploits might be developed within hours or days". Exploitation was reported from 19 November, 19:00 UTC, about a day after the release. SecurityWeek reports that CISA added it to the Known Exploited Vulnerabilities catalogue on 24 November, with a deadline of 27 November for US federal agencies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SA-CORE-2026-018&lt;/strong&gt; (18 November, CVE-2026-132166, 14/25). A gadget chain in core. On its own it does nothing: it needs a separate &lt;code&gt;unserialize()&lt;/code&gt; bug somewhere to be exploitable. Same fixed versions as 017.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SA-CORE-2026-019&lt;/strong&gt; (25 November, CVE-2026-136716, Highly critical, 21/25). The fix for 017 was incomplete. In the advisory's words, "certain sites in unusual or incomplete install states remain vulnerable to site takeover … including production sites", and "it is not apparent in the user interface if a site is in the affected vulnerable state". It was exploited in the wild as well. The fix is 10.6.23, 11.3.23 or 11.4.14, &lt;strong&gt;plus running &lt;code&gt;update.php&lt;/code&gt;&lt;/strong&gt;: an update hook repairs the install state. The advisory also tells you to secure the installer and to check user 1: its email, its password and any recent changes.&lt;/p&gt;

&lt;p&gt;So the code update alone wasn't enough for 019. A site that got the new code but never ran its database updates was still exposed, and you couldn't see that from the admin UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I patched
&lt;/h2&gt;

&lt;p&gt;Both sites run Drupal 11.4 on PHP-FPM in Docker. Here is what actually happened, from git and the CI logs. All times are UTC.&lt;/p&gt;

&lt;p&gt;SA-CORE-2026-017:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;18 Nov, evening: advisory released.&lt;/li&gt;
&lt;li&gt;19 Nov, 19:00: first reported exploitation.&lt;/li&gt;
&lt;li&gt;19 Nov, 19:13: Boardinn fleet running 11.4.13.&lt;/li&gt;
&lt;li&gt;20 Nov, 07:33: Milo deployed with 11.4.13.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;SA-CORE-2026-019:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;25 Nov: advisory released. Boardinn's daily security job ran at 15:59 that day and did not flag it.&lt;/li&gt;
&lt;li&gt;26 Nov, 10:46: Milo, a manual bump to 11.4.14, deployed at 11:13.&lt;/li&gt;
&lt;li&gt;26 Nov, 15:42: the Boardinn job opens its PR (core 11.4.14 plus Symfony 7.4.24).&lt;/li&gt;
&lt;li&gt;27 Nov, 09:21: merged. 09:44: the release finishes rolling the fleet.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Four things I took from this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Measure to production, not to merge.&lt;/strong&gt; A green PR protects nobody. For a highly critical advisory the clock stops when every site is running the new code, so that's the number to track and the one to shrink.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A daily audit lags.&lt;/strong&gt; Boardinn has a job that runs &lt;code&gt;composer audit&lt;/code&gt; against the locked production packages every day and opens a PR with the bumps. It's useful, and it catches the long tail of contrib advisories I would never read one by one. But it can only see an advisory once it reaches the advisory database, and it runs once a day. On 019 it was a day behind me. I patched Milo by hand that morning because I read the advisory, not because a tool told me. For core, the PSA Drupal posts before a release is the earliest signal you get, and it's worth booking the release window in your calendar when it appears.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;update.php&lt;/code&gt; is part of the fix.&lt;/strong&gt; Both of my deploy pipelines run &lt;code&gt;drush updb&lt;/code&gt; on every deploy, so the update hook that 019 depends on ran without me thinking about it. If your deploy is "pull code, clear cache", 019 is the advisory that shows why that isn't enough. Run the database updates on every deploy, not only when someone remembers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lock the installer at the web server.&lt;/strong&gt; On Milo, Caddy executes only &lt;code&gt;/index.php&lt;/code&gt;. Every other &lt;code&gt;.php&lt;/code&gt; path gets a 404 before PHP even sees the request, including &lt;code&gt;core/install.php&lt;/code&gt;, and the deploy runs database updates through drush inside the container, so &lt;code&gt;update.php&lt;/code&gt; doesn't need to be reachable over HTTP either. That rule went in to cut down scanner noise, and it ended up closing the attack path behind both installer advisories. If you need the installer, you need it once, at install time. After that it shouldn't be reachable from the internet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Symfony moves in step
&lt;/h2&gt;

&lt;p&gt;Drupal core pins its Symfony components through &lt;code&gt;drupal/core-recommended&lt;/code&gt;, so you can't bump Symfony on its own. When I moved Milo to 11.4.14, &lt;code&gt;composer audit&lt;/code&gt; and the release notes also asked for Symfony 7.4.24 and Twig 3.31.1. Symfony had published its own batch of 20 advisories on 25 November, the same day as 019. Boardinn's job handles this by updating the whole &lt;code&gt;drupal/core-*&lt;/code&gt; set together and holding it to the current core minor, so a minor upgrade stays a human decision.&lt;/p&gt;

&lt;p&gt;The practical point: "update Drupal core" means core plus the Symfony and Twig versions it pins. Check the lock file diff, not only the &lt;code&gt;drupal/core&lt;/code&gt; line.&lt;/p&gt;

&lt;h2&gt;
  
  
  A short checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Be on 10.6.23, 11.3.23 or 11.4.14 or later, with the Symfony and Twig versions they pin.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;drush updb&lt;/code&gt; (or &lt;code&gt;update.php&lt;/code&gt;) after the update, and make it part of every deploy.&lt;/li&gt;
&lt;li&gt;Block &lt;code&gt;core/install.php&lt;/code&gt; at the web server once the site is installed. Block &lt;code&gt;update.php&lt;/code&gt; too if your updates run from the CLI.&lt;/li&gt;
&lt;li&gt;Check user 1: email, password hash, last login, recent changes. 019 says the vulnerable state isn't visible in the UI, so look at the data.&lt;/li&gt;
&lt;li&gt;Treat a Drupal PSA as a calendar event. Have someone free when the release lands, and measure your time to patch from the release to production, not to the merge.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Next
&lt;/h2&gt;

&lt;p&gt;Part three compares how Symfony, Laravel and Drupal are absorbing this flood: a community security team with AI triage, LTS discipline with batched advisories, and a framework that owns its hosting platform and patches the runtime for its customers. Finding bugs is cheap now. Shipping the fix is the slow part.&lt;/p&gt;

&lt;p&gt;One question for you: when the last highly critical Drupal advisory came out, how many hours passed before the fix was running in production?&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>infosec</category>
      <category>php</category>
      <category>security</category>
    </item>
    <item>
      <title>PHP2Shell: two PHP core bugs, one October patch, and a second wave in November</title>
      <dc:creator>Evgenii Iakovenko</dc:creator>
      <pubDate>Fri, 27 Nov 2026 10:13:14 +0000</pubDate>
      <link>https://dev.to/yakoveka/php2shell-two-php-core-bugs-one-october-patch-and-a-second-wave-in-november-2o93</link>
      <guid>https://dev.to/yakoveka/php2shell-two-php-core-bugs-one-october-patch-and-a-second-wave-in-november-2o93</guid>
      <description>&lt;p&gt;On 19 August 2026 a researcher pointed a set of AI tools at the PHP core and they found the first bug. By 20 August the same work had a working remote code execution against Drupal, on 21 August against WordPress, and on 24 August it went to the PHP team. PHP acknowledged it on 21 September. The fix and the disclosure landed on 21 October, about two months after the first find. Wiz published the timeline, and the line I keep coming back to is theirs: a single researcher completed in a week what would previously have taken a world-class team months.&lt;/p&gt;

&lt;p&gt;This is part one of three posts about PHP security in autumn 2026. This one covers PHP core only. Part two is Drupal, part three is how Symfony, Laravel and Drupal are responding. I run two Drupal sites on PHP, so I read these advisories as someone who has to act on them.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the two bugs actually are
&lt;/h2&gt;

&lt;p&gt;PHP2Shell is two CVEs, CVE-2026-109618 and CVE-2026-109619, both disclosed and fixed on 21 October. php.net rates them CVSS v4.0 9.2 and describes them as allowing unauthenticated remote code execution.&lt;/p&gt;

&lt;p&gt;The first is memory handling. When PHP runs out of memory in the middle of a request, its cleanup path can treat partly initialized request data as if it were valid. The name in the advisory is "RCE via OOM corruption".&lt;/p&gt;

&lt;p&gt;The second is state that outlives its request. Data owned by one request survives after its memory is freed, and the next request on the same worker picks it up. "RCE via stale global state".&lt;/p&gt;

&lt;p&gt;Neither needs a bug in your application. That is the uncomfortable part. Wiz writes that even a simple Hello World application can be vulnerable, and they demonstrated the attack against WordPress, Drupal and Joomla running their latest container images. php2shell.com is explicit that exploitation does not require one of those applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who was exposed
&lt;/h2&gt;

&lt;p&gt;Short answer: almost everyone serving PHP over HTTP. Every PHP version released in the last decade is affected by at least one of the bugs behind these two CVEs, going back to 5.4, per Wiz. php.net lists PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. They call the risk highest for mod_php, because they have a demonstrated exploit where an unauthenticated request triggers the attack before any application code runs.&lt;/p&gt;

&lt;p&gt;Fixed versions are 8.2.35, 8.3.36, 8.4.27 and 8.5.12. PHP 8.1 and older got nothing, because those branches no longer receive updates.&lt;/p&gt;

&lt;p&gt;One number to handle with care: PHP's share of websites is often quoted at around 70%. That is market share, not a count of vulnerable servers, and neither php.net nor the Wiz post cites a source for it. Use it as context, not as your risk number. My guess is that the share is lower today: new projects lean towards Python and TypeScript, partly because that is where language models are most fluent. But there is a lot of legacy PHP out there, and somebody has to keep it patched.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you cannot upgrade today
&lt;/h2&gt;

&lt;p&gt;php.net lists workarounds and is clear that none of them is complete. The two main ones: Set memory_limit to -1 where the application cannot override it, for example through php_admin_value. Set session.upload_progress.enabled to 0. Then restart every worker.&lt;/p&gt;

&lt;p&gt;The first one is a bridge with a cost: an unlimited memory_limit is also no ceiling for a runaway script, so watch the host while you run that way. And do not sit on the settings. php.net says it plainly: "There are no complete mitigations, updating is the only safe choice."&lt;/p&gt;

&lt;p&gt;I don't think you can be ready for a bug like this in advance. Nobody had PHP2Shell on their roadmap. What you can have is a system that lets you change what runs in production quickly, because these disclosures will keep coming. For Boardinn, the white-label SaaS I build, part of that system is a daily job that runs &lt;code&gt;composer audit&lt;/code&gt; against the locked production packages and, when an advisory shows up, opens a pull request with the bumps. Merging and the release stay manual. On the hosts, Ubuntu's unattended-upgrades installs security packages every night. When I checked both servers on 27 November, they had installed that morning's batch without errors, and both also said "reboot required". One of them had been up for 15 weeks. Automatic reboots are off on purpose, because a production box should not reboot itself, but that makes the reboot a human job, and nobody had been doing it. I rebooted both the same day. For the signal itself, I watch php.net and cybersecurity forums, and every server now sends me a Telegram alert when it needs a reboot, so the next "reboot required" doesn't wait 15 weeks for me to notice it.&lt;/p&gt;

&lt;p&gt;The catch is that &lt;code&gt;composer audit&lt;/code&gt; knows nothing about the PHP binary itself. A PHP release reaches the server through the container image or the OS packages, and that path needs its own owner. On my two sites PHP-FPM runs in Docker from the floating &lt;code&gt;php:8.3-fpm&lt;/code&gt; tag, so the host's automatic updates never touch PHP at all. PHP moves only when an image is rebuilt with a fresh base pull, which in my setup happens on every release. When I checked on 27 November, the latest builds of both sites had resolved to the same base digest as &lt;code&gt;8.3.37-fpm&lt;/code&gt; on Docker Hub, and replacing the containers restarted the workers. The weak spot is the opposite case: a quiet week with no release means PHP stays on whatever the last build pulled. A scheduled rebuild would close that gap, and I don't have one yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 19 November release
&lt;/h2&gt;

&lt;p&gt;The second wave arrived on 19 November: 8.2.36, 8.3.37, 8.4.28, 8.5.13, plus 8.6.0 as the new stable branch. php.net's notice the day before said the issues rated critical require either non-default configuration or uncommon setups, which is reassuring until you count how many production boxes have one non-default setting nobody documented.&lt;/p&gt;

&lt;p&gt;The critical list on GitHub includes request smuggling in PHP-FPM through an unread request body, several use-after-free bugs (magic-method backtraces, last_fatal_error_backtrace, the timezone cache, an interrupted session shutdown), and partially overwritten session files leading to RCE. Lower down are a PHP-FPM epoll bug that gives local privilege escalation, an XSS in the FPM status page, a PHAR signature downgrade, and CVE-2026-115560, the session serializer issue from 23 October.&lt;/p&gt;

&lt;p&gt;That last one needs a specific setup: an application that switches session.serialize_handler to php at runtime with ini_set() before session_start(), with upload progress still enabled. Not common, but not impossible in older code.&lt;/p&gt;

&lt;p&gt;If you are on the 19 November builds, you also have the PHP2Shell fix. If you are on the 21 October builds, you have the PHP2Shell fix but not this batch.&lt;/p&gt;

&lt;h2&gt;
  
  
  EOL PHP is now a business decision
&lt;/h2&gt;

&lt;p&gt;The part managers need to hear is not the CVE list. It is the support table.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;PHP 8.1 and older: end of life, no PHP2Shell fix, no 19 November fix. A known unauthenticated RCE with no vendor patch.&lt;/li&gt;
&lt;li&gt;PHP 8.2: security fixes only, end of life on 31 December 2026.&lt;/li&gt;
&lt;li&gt;PHP 8.3: security fixes until 31 December 2027.&lt;/li&gt;
&lt;li&gt;PHP 8.4: active until 31 December 2026, security until 31 December 2028.&lt;/li&gt;
&lt;li&gt;PHP 8.5: active until 31 December 2027.&lt;/li&gt;
&lt;li&gt;PHP 8.6: released 19 November 2026.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The choice is no longer patch or wait. For 8.1 and older it is upgrade or carry an unpatched RCE, and for 8.2 it is upgrade this quarter or join that group. An upgrade is a project with a budget, a test plan and a date. A CVE is a Tuesday.&lt;/p&gt;

&lt;p&gt;What to tell management, in one pass: we run PHP version X on these hosts, this is where the support window ends, this is the cost of moving to a supported branch, and this is the deadline we commit to. If nobody can answer the first part, that is the finding.&lt;/p&gt;

&lt;h2&gt;
  
  
  A short checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Inventory PHP versions and SAPIs on each host. php.net rates mod_php as the highest risk for PHP2Shell, and most of the 19 November criticals sit in PHP-FPM and sessions.&lt;/li&gt;
&lt;li&gt;Move to 8.2.36, 8.3.37, 8.4.28 or 8.5.13, then restart the workers. A patched binary with old workers still running is not patched.&lt;/li&gt;
&lt;li&gt;If you must wait, apply memory_limit=-1 through php_admin_value and session.upload_progress.enabled=0, restart, and put a date on the upgrade.&lt;/li&gt;
&lt;li&gt;Test the behaviour change. The fix adds a hard memory limit that terminates the process, and when it fires, shutdown handlers don't run, so code that logs or cleans up in a shutdown handler will notice.&lt;/li&gt;
&lt;li&gt;Put 8.2 on the calendar. 31 December 2026 ends security support, and the next PHP2Shell will not wait for your sprint.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Next
&lt;/h2&gt;

&lt;p&gt;Part two is Drupal, including how I patched two Drupal sites through it. A core installer bug that allows a site takeover was exploited in the wild the day after its advisory, and Drupal shipped 106 advisories in October alone. Part three compares how Symfony, Laravel and Drupal are absorbing this volume of reports, because finding is now cheap and the patching is not.&lt;/p&gt;

&lt;p&gt;One question for you: which PHP branch are your production servers on right now, and does the person who signs the infrastructure budget know its end of life date?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>cybersecurity</category>
      <category>php</category>
      <category>security</category>
    </item>
    <item>
      <title>Our API was down for 56 minutes and nothing threw an error</title>
      <dc:creator>Evgenii Iakovenko</dc:creator>
      <pubDate>Thu, 19 Nov 2026 16:40:34 +0000</pubDate>
      <link>https://dev.to/yakoveka/our-api-was-down-for-56-minutes-and-nothing-threw-an-error-4o4l</link>
      <guid>https://dev.to/yakoveka/our-api-was-down-for-56-minutes-and-nothing-threw-an-error-4o4l</guid>
      <description>&lt;h2&gt;
  
  
  The night nothing threw
&lt;/h2&gt;

&lt;p&gt;In August the homepage and the login page of our platform stopped answering. Requests just sat there: no error page, no timeout, no 5xx, no exception in the API, no alert. The outage lasted 56 minutes, until we noticed it ourselves and fixed it.&lt;/p&gt;

&lt;p&gt;The database was up the whole time. Nothing reported a problem while the platform served nothing. That is the part I keep coming back to.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the platform looks like
&lt;/h2&gt;

&lt;p&gt;It is a consumer platform with real-money wallets. The stack is NestJS and TypeORM on node-postgres (&lt;code&gt;pg-pool&lt;/code&gt;), Postgres, Docker Compose, one API process plus a background worker. We were a small team, and new features were prioritized over tech debt, so observability work kept losing to the next release. That is not an excuse. It is the context in which this bug lived without anyone looking at it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How a purchase took the pool hostage
&lt;/h2&gt;

&lt;p&gt;A purchase runs inside &lt;code&gt;dataSource.transaction(manager =&amp;gt; …)&lt;/code&gt;. Inside that transaction, the step that credits rewards for the purchase read the rewards settings through a service. That service queried through an injected repository, not through the transaction's &lt;code&gt;manager&lt;/code&gt;. So every one of those calls acquired a second pool connection while the transaction still held its first. Settings cache misses did the same thing.&lt;/p&gt;

&lt;p&gt;The code that introduced the second acquire merged about ten days before the outage.&lt;/p&gt;

&lt;p&gt;With 10 or more concurrent purchases, each transaction held one connection and queued for a second one, which only another of those transactions could release. Pool max was 10. Every connection was taken, every acquire waited, and nothing else could get in.&lt;/p&gt;

&lt;p&gt;Postgres's deadlock detector never fired. The wait was in the application, not on a lock. From the server's side the sessions were just &lt;code&gt;idle in transaction&lt;/code&gt;, holding their row locks, and Postgres has no way to know they were waiting on each other through the pool. Every new request queued behind them.&lt;/p&gt;

&lt;p&gt;And it was silent because &lt;code&gt;connectionTimeoutMillis&lt;/code&gt; was unset. A pg-pool acquire with no timeout queues forever. No error, no log line, no 5xx. A hanging request is not a failing request, so nothing in our monitoring had a reason to complain.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I assumed and what was true
&lt;/h2&gt;

&lt;p&gt;Three things I believed that evening, and what was actually going on.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I assumed the pool was 20. It ran at the pg default of 10. The pool settings sat in an &lt;code&gt;extra&lt;/code&gt; block under a config namespace (&lt;code&gt;registerAs&lt;/code&gt;) that TypeORM never reads. The block looked like config, so that dead block had been hiding a max-10 pool for months.&lt;/li&gt;
&lt;li&gt;I assumed the rewards feature flag was off in production, because the environment doc said so. It was on. I checked through the API on the day of the incident. During triage that stale line hid the flag's role: the code path was armed on production while every doc said it wasn't.&lt;/li&gt;
&lt;li&gt;I assumed the health endpoint would tell us something. It never touched the database. The worker's healthcheck was an HTTP probe that could never pass.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The fix that night and the trade-off
&lt;/h2&gt;

&lt;p&gt;We shipped the fix about an hour later, the same evening. The tempting move was to bump the pool and go to bed, and I did weigh it that night. I didn't want that as the whole fix, because the pool size was not the bug. A bigger pool only raises the number of concurrent purchases you need before the same thing happens. The main concern was that the shape would come back at a load level we could not predict.&lt;/p&gt;

&lt;p&gt;So the structural fix came first: the settings read is hoisted out, prefetched before the transaction opens, and passed in as a required field on the input type. Forgetting the prefetch is now a type error, not a latent deadlock. A second code path with the same shape got the same hoist. The pool also got an explicit max and an acquire timeout, so a starved acquire fails loudly instead of hanging.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;OrderService&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;dataSource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;DataSource&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;settingsRepo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Repository&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Settings&lt;/span&gt;&lt;span class="o"&gt;&amp;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;async&lt;/span&gt; &lt;span class="nf"&gt;place&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;orderId&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="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dataSource&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;manager&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;manager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findOneOrFail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&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;orderId&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;settings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;settingsRepo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findOneByOrFail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"wallet"&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;// second connection&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;settle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;manager&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;settings&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;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 typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;PlaceOrderInput&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;orderId&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;settings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Settings&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// required: forgetting the prefetch is a type error&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;OrderService&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;dataSource&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;DataSource&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;async&lt;/span&gt; &lt;span class="nf"&gt;place&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;orderId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;settings&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;PlaceOrderInput&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;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dataSource&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;transaction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;manager&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;manager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findOneOrFail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="p"&gt;:&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;orderId&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="nf"&gt;settle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;manager&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;settings&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;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// caller&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;settings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;settingsRepo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findOneByOrFail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"wallet"&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;await&lt;/span&gt; &lt;span class="n"&gt;orderService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;place&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;orderId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;settings&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;The fix was +162/−69 in 9 files. The hardening merged about 30 minutes later, +367/−46 in 15 files.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Default&lt;/th&gt;
&lt;th&gt;What it buys&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DB_POOL_MAX&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;20&lt;/td&gt;
&lt;td&gt;the size the pool was supposed to have&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DB_CONNECT_TIMEOUT_MS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;10 s&lt;/td&gt;
&lt;td&gt;acquire timeout: fail loudly instead of hanging&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DB_STATEMENT_TIMEOUT_MS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;30 s API / 120 s worker&lt;/td&gt;
&lt;td&gt;not applied to the migrations CLI: a long &lt;code&gt;CREATE INDEX&lt;/code&gt; must stall, not die&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DB_IDLE_IN_TXN_TIMEOUT_MS&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;60 s API / 300 s worker&lt;/td&gt;
&lt;td&gt;plus a 60 s server-side backstop on Postgres, for clients that set nothing&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All four live in one function, which is now the only place pool config is real. The dead config block was deleted. The health endpoint probes the pool with &lt;code&gt;SELECT 1&lt;/code&gt; and a 2 s budget, returning 503 on failure. The worker healthcheck checks a heartbeat file instead of an HTTP endpoint it could never satisfy. An autoheal container restarts anything marked unhealthy. New gauges expose &lt;code&gt;db_pool_total&lt;/code&gt;, &lt;code&gt;db_pool_idle&lt;/code&gt; and &lt;code&gt;db_pool_waiting&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;And the rule got written down for humans and for AI agents, in the backend rules file and &lt;code&gt;AGENTS.md&lt;/code&gt;: never acquire a second connection inside a transaction, with four sub-rules: thread the &lt;code&gt;manager&lt;/code&gt;, hoist the read, distrust "it's cached", and no external awaits inside a transaction.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same class of bug came back 13 days later
&lt;/h2&gt;

&lt;p&gt;Thirteen days later a teammate fixed the same class of bug in another money flow. A settings read inside a balance-reservation transaction was moved onto the caller's &lt;code&gt;manager&lt;/code&gt;, so it now runs on the connection already holding the per-user advisory locks. Same shape, different feature, same fix.&lt;/p&gt;

&lt;p&gt;This time it was found in code review, not by an outage. For me that is the real result of that night: the pattern now has a name and a written rule, so reviewers look for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  To summarize
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Grep your transactional code paths for injected repositories and the bare &lt;code&gt;DataSource&lt;/code&gt;. Anything that isn't &lt;code&gt;manager&lt;/code&gt; is a second acquire.&lt;/li&gt;
&lt;li&gt;Set an acquire timeout (&lt;code&gt;connectionTimeoutMillis&lt;/code&gt; in node-postgres). The default is to wait forever.&lt;/li&gt;
&lt;li&gt;Check that the pool size you set is the pool size in use: log &lt;code&gt;pool.totalCount&lt;/code&gt; and &lt;code&gt;options.max&lt;/code&gt; at boot, or export a gauge. Config can sit somewhere the ORM never reads.&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;idle_in_transaction_session_timeout&lt;/code&gt; on the server, not only per client.&lt;/li&gt;
&lt;li&gt;A healthcheck that doesn't touch the database cannot detect a database-side outage.&lt;/li&gt;
&lt;li&gt;"It's cached" can still be a conditional database read, on a miss or on keys you never cache.&lt;/li&gt;
&lt;li&gt;Encode the rule in types where you can. A required prefetched input beats a code comment.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;p&gt;New features always won the prioritization, and I understand why. Deadlines were real. But tech debt that never wins a prioritization gets paid as downtime, and I would rather price that in minutes before it happens than explain it afterwards. That is the conversation I would force earlier, in plain numbers: this gap costs us an outage of unknown length, and here is what the hardening costs to prevent it. Getting that agreed with the business up front is the part that was missing, and it is my job to make that ask concrete instead of hoping someone finds the time.&lt;/p&gt;

</description>
      <category>api</category>
      <category>backend</category>
      <category>debugging</category>
      <category>monitoring</category>
    </item>
    <item>
      <title>Your Drupal node page says 403. Your RSS feed doesn't care</title>
      <dc:creator>Evgenii Iakovenko</dc:creator>
      <pubDate>Thu, 22 Oct 2026 08:47:32 +0000</pubDate>
      <link>https://dev.to/yakoveka/your-drupal-node-page-says-403-your-rss-feed-doesnt-care-4m5g</link>
      <guid>https://dev.to/yakoveka/your-drupal-node-page-says-403-your-rss-feed-doesnt-care-4m5g</guid>
      <description>&lt;p&gt;I ran into a bug where private content leaked even though a node access hook was already in place. Opening the node directly returned 403, exactly as intended. But the same content was sitting in the RSS feed, in search results and on taxonomy term pages, available to anyone.&lt;/p&gt;

&lt;p&gt;The hook wasn't broken. It checks permissions when someone visits the node page, and on those pages nobody was visiting the node. The content was only being listed, as if everyone had permission to see it.&lt;/p&gt;

&lt;p&gt;Drupal has two separate access systems, and they don't talk to each other. This post shows the difference on a throwaway Drupal 11.4 site you can reproduce in a few minutes, compares the ways to fix it, and ends with a two-minute check for your own site.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two access systems
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Single-entity access.&lt;/strong&gt; When someone opens &lt;code&gt;/node/123&lt;/code&gt;, Drupal asks &lt;code&gt;hook_node_access()&lt;/code&gt;. This is where most of us put rules like "only the author and staff can see this".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Query access.&lt;/strong&gt; When Drupal builds a list of nodes (Views, core search, the front page feed, taxonomy term pages), it doesn't call &lt;code&gt;hook_node_access()&lt;/code&gt; for every row. That would be far too slow. It adds a condition on the &lt;code&gt;node_access&lt;/code&gt; table to the SQL query instead.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The main concern is the second one. If no module on your site implements node grants, core doesn't add that condition at all. The comment in &lt;code&gt;NodeDatabaseHooks&lt;/code&gt; says it directly: if there are no node access modules, it doesn't need to alter the query. So for every listing, published means public.&lt;/p&gt;

&lt;h2&gt;
  
  
  The demo
&lt;/h2&gt;

&lt;p&gt;The demo site has a private content type, &lt;code&gt;secret_note&lt;/code&gt;, and a small access hook: only the author or a user with &lt;code&gt;view any secret_note&lt;/code&gt; can view a note.&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="na"&gt;#[Hook('node_access')]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;nodeAccess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;NodeInterface&lt;/span&gt; &lt;span class="nv"&gt;$node&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$operation&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;AccountInterface&lt;/span&gt; &lt;span class="nv"&gt;$account&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;AccessResultInterface&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// ...&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$is_author&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nv"&gt;$account&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;hasPermission&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'view any secret_note'&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="nc"&gt;AccessResult&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;neutral&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;cachePerUser&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;addCacheableDependency&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$node&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="nc"&gt;AccessResult&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;forbidden&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Secret notes are visible to their author and staff only.'&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;cachePerUser&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;addCacheableDependency&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$node&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;Alice owns three notes. A small script requests a few URLs as anonymous and prints &lt;code&gt;LEAK&lt;/code&gt; when a secret title appears in the response:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PASS  /node/1                   (403 for anonymous)
LEAK  /rss.xml                  (2 secret titles visible)
LEAK  /search/node?keys=quasar  (3 secret titles visible)
LEAK  /taxonomy/term/1          (3 secret titles visible)
Summary: 3 leak(s), 0 fail(s)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The node page is protected. Everything that lists nodes isn't. Nobody added an endpoint here: the feed, search and term pages all come with a standard site.&lt;/p&gt;

&lt;p&gt;RSS shows two notes and not three because the front page feed only lists promoted nodes, and two of the notes were promoted. That's a detail of the feed, not a protection.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix: node grants
&lt;/h2&gt;

&lt;p&gt;The fix is to tell the listing queries who may see what. That's what node grants are for, and the naming is confusing enough that it's worth translating:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;record&lt;/strong&gt; is a lock on a node. &lt;code&gt;hook_node_access_records($node)&lt;/code&gt; returns the locks, and Drupal stores them in the &lt;code&gt;node_access&lt;/code&gt; table when the node is saved.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;grant&lt;/strong&gt; is a key a user holds. &lt;code&gt;hook_node_grants($account, $operation)&lt;/code&gt; returns the keys for the current user. They are computed per request, never stored.&lt;/li&gt;
&lt;li&gt;Both are a pair of a realm (any name your module picks) and an id. A user sees a node in a listing if any of their keys fits any of its locks.&lt;/li&gt;
&lt;li&gt;Core gives every user, anonymous included, the key &lt;code&gt;all / 0&lt;/code&gt;. So a lock of &lt;code&gt;all / 0&lt;/code&gt; simply means "public".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the demo, the policy is one small class:&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="na"&gt;#[Hook('node_access_records')]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;records&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;NodeInterface&lt;/span&gt; &lt;span class="nv"&gt;$node&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;array&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nv"&gt;$node&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;isPublished&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="p"&gt;[];&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;in_array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$node&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;bundle&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;PUBLIC_BUNDLES&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;TRUE&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="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;grant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'all'&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="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;in_array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$node&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;bundle&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;PRIVATE_BUNDLES&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;TRUE&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="p"&gt;[&lt;/span&gt;
      &lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;grant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;REALM_OWNER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;$node&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getOwnerId&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
      &lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;grant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;REALM_STAFF&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&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="p"&gt;[];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="na"&gt;#[Hook('node_grants')]&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;grants&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;AccountInterface&lt;/span&gt; &lt;span class="nv"&gt;$account&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nv"&gt;$operation&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;array&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$operation&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s1"&gt;'view'&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="p"&gt;[];&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nv"&gt;$grants&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$account&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;isAuthenticated&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$grants&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;REALM_OWNER&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="n"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;$account&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&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="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$account&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;hasPermission&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'view any secret_note'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$grants&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;REALM_STAFF&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&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="nv"&gt;$grants&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 rules mirror the access hook on purpose: author, or staff. If the two disagree, the node page and the listings will disagree again, just in a new way.&lt;/p&gt;

&lt;p&gt;Here is what ends up in &lt;code&gt;node_access&lt;/code&gt; (Alice is user 2):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nid  type         realm       gid
22   secret_note  demo_owner  2
22   secret_note  demo_staff  1
26   article      all         0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I wrote the Kernel test before the hooks, and it failed first, which is the point of it:&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="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;assertSame&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'Public article'&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;listedTitles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$anonymous&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;assertSame&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'Alice note 1'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Alice note 2'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Public article'&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;listedTitles&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="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;assertSame&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="s1"&gt;'Bob note'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Public article'&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;listedTitles&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$bob&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Existing nodes keep their old rows until grants are rebuilt, so the module ships a post update that calls &lt;code&gt;\Drupal::service(NodeAccessRebuild::class)-&amp;gt;rebuild()&lt;/code&gt;. On a big site, rebuild in batch mode.&lt;/p&gt;

&lt;p&gt;With grants in place, the same check passes. I also added a typical "latest content" view at &lt;code&gt;/latest&lt;/code&gt;, to make sure a view built later is covered too:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PASS  /node/11                  (403 for anonymous)
PASS  /rss.xml                  (200)
PASS  /search/node?keys=quasar  (200)
PASS  /taxonomy/term/1          (200)
PASS  /latest                   (200)
Summary: 0 leak(s), 0 fail(s)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The public articles are still in every listing, Alice sees her own notes on &lt;code&gt;/latest&lt;/code&gt;, and Bob sees only the public articles. Any view someone builds later is covered as well, because the filter lives in the query, not in the view.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pitfall: a type you forgot
&lt;/h2&gt;

&lt;p&gt;Then I added a second private type, &lt;code&gt;secret_invoice&lt;/code&gt;. I remembered the access hook and forgot the grants class. The invoice page returned 403, and:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LEAK  /search/node?keys=quasar  (1 secret items visible)
LEAK  /taxonomy/term/1          (1 secret items visible)
LEAK  /latest                   (1 secret items visible)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reason is the last &lt;code&gt;return []&lt;/code&gt; in &lt;code&gt;records()&lt;/code&gt;. When every module returns no locks for a published node, core doesn't leave it without any. It writes &lt;code&gt;all / 0&lt;/code&gt;, which means public. So an unclassified type is public in every listing, even with grants in place.&lt;/p&gt;

&lt;p&gt;The safety net is a Unit test that reads every &lt;code&gt;node.type.*.yml&lt;/code&gt; from the config sync directory and fails when a type isn't in either list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Node type 'secret_invoice' is not classified as public or private in NodeGrantsHooks;
when published, core makes it public in every listing.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Classifying the type isn't enough on its own. Invoices that already exist keep their &lt;code&gt;all / 0&lt;/code&gt; row until grants are rebuilt, so the fix needs a second post update.&lt;/p&gt;

&lt;p&gt;Two more things the demo doesn't show, but you will meet them on a real site:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Derived ownership.&lt;/strong&gt; If a node's owner lives in another node (a linked record, a parent case), saving that other node doesn't rewrite this node's locks. You have to rewrite them yourself when the relation changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fresh installs.&lt;/strong&gt; If you create sites with &lt;code&gt;site:install&lt;/code&gt;, make sure grants are rebuilt after your module is installed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Or use a contrib module
&lt;/h2&gt;

&lt;p&gt;You don't always need custom grants. I checked the three modules people usually mention (drupal.org, October 2026):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Content Access&lt;/strong&gt; (2.1.0, Drupal 9.4 to 11). Role-based access per content type, with optional per-node overrides, built on node grants. It's the same mechanism as the demo without any code. Note that it isn't covered by the security advisory policy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permissions by Term&lt;/strong&gt; (3.1.41, Drupal 10 and 11). Access follows taxonomy terms assigned to users or roles, also built on node grants. Feature-complete and in maintenance mode.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Group&lt;/strong&gt; (3.3.5 for Drupal 10.3 and 11; 4.0 is in alpha). A full membership model: users belong to groups with their own roles, content belongs to groups. It doesn't use node grants; it alters entity and Views queries. If you use it, test every type of listing your site has.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To summarize when I'd pick what:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;"Role X can see type Y" and editors manage it: Content Access.&lt;/li&gt;
&lt;li&gt;Access follows a vocabulary (department, region, client): Permissions by Term.&lt;/li&gt;
&lt;li&gt;Real memberships and organisations: Group.&lt;/li&gt;
&lt;li&gt;Ownership comes from your own domain model: custom grants, about 40 lines plus a test.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you combine modules, keep in mind that grants add up. A user who holds any matching key sees the node, so one generous module wins over a strict one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check your site in two minutes
&lt;/h2&gt;

&lt;p&gt;Open these in a private window, as anonymous:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;/rss.xml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/search/node?keys=&amp;lt;a word that appears in private content&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/taxonomy/term/&amp;lt;id&amp;gt;&lt;/code&gt; for a few terms that private content uses&lt;/li&gt;
&lt;li&gt;Any listing your site has: &lt;code&gt;/node&lt;/code&gt;, views pages, "latest" blocks&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then look at the table:&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;realm&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;node_access&lt;/span&gt; &lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;realm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the only realm is &lt;code&gt;all&lt;/code&gt; and you have private content in nodes, nothing protects your listings.&lt;/p&gt;

&lt;p&gt;The demo repo has a tag for every stage, so you can see each fix as a diff: &lt;a href="https://github.com/yakoveka/drupal-access-demo" rel="noopener noreferrer"&gt;https://github.com/yakoveka/drupal-access-demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you write an access hook, write a listing test next to it: an entity query with access checks, run as a stranger. Which listing on your site would you check first?&lt;/p&gt;

</description>
      <category>backend</category>
      <category>drupal</category>
      <category>php</category>
      <category>security</category>
    </item>
  </channel>
</rss>
