<?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: zerox80</title>
    <description>The latest articles on DEV Community by zerox80 (@zerox80).</description>
    <link>https://dev.to/zerox80</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%2F4229178%2Fee4e8cad-ad28-4a22-a6fe-0aa7e02f9f44.png</url>
      <title>DEV Community: zerox80</title>
      <link>https://dev.to/zerox80</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zerox80"/>
    <language>en</language>
    <item>
      <title>Internxt: What stays private around 10 findings without publicly confirmed fixes</title>
      <dc:creator>zerox80</dc:creator>
      <pubDate>Mon, 23 Nov 2026 21:40:20 +0000</pubDate>
      <link>https://dev.to/zerox80/what-stays-private-publishing-around-eleven-unfixed-findings-4ipe</link>
      <guid>https://dev.to/zerox80/what-stays-private-publishing-around-eleven-unfixed-findings-4ipe</guid>
      <description>&lt;p&gt;This series now runs to several posts: 3 fixed vulnerabilities, the harness that reproduced them, a timeline, and the CERT ticket. Between them they describe an audit of 13 findings in an open-source backend. If you read all of them, you will notice something odd: only 3 findings have technical details. The other 10 appear as IDs in status tables.&lt;/p&gt;

&lt;p&gt;That is deliberate, and this post explains the rules behind it, because publishing around vulnerabilities you have not been allowed to see is its own discipline, and getting it wrong undoes the part of the disclosure process that actually works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The clock comes first
&lt;/h2&gt;

&lt;p&gt;The schedule has been stated in every post and emailed to the vendor twice: full technical details for the fixed issues on 1 December 2026, and for everything else, fixed or not, on 18 January 2027, 90 days after my first email on 20 October. A disclosure deadline is not decoration. It exists so that a report cannot be buried by silence: after 90 days, the information is public no matter what happened. But it also obligates the person who sets it. If I publish details early, the deadline stops being a commitment and becomes a mood, and the vendor has no reason to believe any date I give them again.&lt;/p&gt;

&lt;p&gt;So every technical claim in this series has to survive 1 question: is it about a finding that is fixed, or is it about the clock? 3 findings are fixed and have published advisories: C07, C08 and C03. Those I can explain down to the line of code, because the code no longer misbehaves on master, and the vendor has already published the summaries itself. The rest appear as identifiers and status, nothing more.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a private report looks like
&lt;/h2&gt;

&lt;p&gt;For contrast, here is what a maintainer receives, using C03, which is fixed and published and therefore safe to show, as the example. This is the head of the report that went privately to the vendor on 28 October and later to CERT-Bund:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;C03: Route workspace ID is not bound to target team ID
Private GHSA: https://github.com/internxt/drive-server-wip/security/advisories/GHSA-wjmx-m49r-9rrh

&lt;span class="gu"&gt;### Summary
&lt;/span&gt;
Workspace A's owner used A's authorized route to delete a nondefault team
belonging to workspace B; the B team row disappeared. Reproduced locally
against master &lt;span class="sb"&gt;`7d7a8be2`&lt;/span&gt; on 2026-10-28; final severity and production
reachability require maintainer review.

&lt;span class="gu"&gt;### Details
&lt;/span&gt;
&lt;span class="gs"&gt;**Checked revision:**&lt;/span&gt; 7d7a8be2 (2026-10-28). The individual local PoC
passed (1/1).

&lt;span class="gs"&gt;**Observed behavior:**&lt;/span&gt; The guard authorizes owner status for the URL's
workspaceId. Team deletion passes only teamId downstream; role change
passes both but selects the target team/member without comparing the
team's workspace to the authorized URL workspace.

&lt;span class="gs"&gt;**Suggested remediation:**&lt;/span&gt; Resolve the team under the authorized workspace
before mutation and use a scoped repository predicate; add cross-workspace
regression tests.

&lt;span class="gs"&gt;**Scope:**&lt;/span&gt; No production system or real account was tested.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every finding in the set has a file like this: summary, checked revision, affected code with line references, observed behaviour, remediation, scope, then the PoC and the runner settings. The unfixed ones have the same structure. You will not see their contents in this series until they are fixed, or until 18 January, whichever comes first.&lt;/p&gt;

&lt;p&gt;The layout is identical across all 13, which is itself part of the disclosure plan:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;report.md layout, every finding
  Cxx: one-line impact statement
  private GHSA reference and reporter rating
  ### Summary          observed behaviour, checked revision
  ### Details          affected code with file:line references,
                       observed behaviour, suggested remediation,
                       scope
  ### Proof of concept PoC source, test-only patch, runner settings
  ### Impact           prerequisites and limitations, bounded
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When the maintainer reads the 8th report, they already know where the evidence is and what the reporter claims versus what the reporter tested. When a CERT opens the same file, they can see the boundary without a conversation. And when a post like this one needs to quote a report head to explain what a report looks like, the quoted structure works for every case; the only variable is which one is safe to show.&lt;/p&gt;

&lt;p&gt;The state machine on the GitHub side is worth a paragraph, because the public posts read differently once you know it. A private advisory moves through &lt;code&gt;draft&lt;/code&gt;, &lt;code&gt;triage&lt;/code&gt;, &lt;code&gt;published&lt;/code&gt; and &lt;code&gt;closed&lt;/code&gt;, and each state says something specific: &lt;code&gt;draft&lt;/code&gt; means written, &lt;code&gt;triage&lt;/code&gt; means received, &lt;code&gt;published&lt;/code&gt; means confirmed and disclosed, and &lt;code&gt;closed&lt;/code&gt; means the advisory is no longer active, which is the strange one, because GitHub does not ask why. A maintainer can close an advisory with no fix, no explanation and no publication, and the page then shows a High-severity finding, a reporter credit, and a resolution field that says nothing. 2 advisories in this case are in exactly that state. It is the only state in the system that means "we saw this and we are not going to tell you what we concluded", and it is worth knowing that it exists before you read a disclosure timeline that involves one.&lt;/p&gt;

&lt;p&gt;The editing rule shows up most clearly in a comparison. The C03 post in this series shows the workspace validator, the unscoped &lt;code&gt;findWorkspaceUser&lt;/code&gt;, the cross-workspace PoC and the fix, because C03 is fixed and the advisory is published. If I were writing the C01 post today, the same article would have its middle removed: no code, no PoC, no mechanism, just an identifier, a severity, a filed date and a triage status, and a sentence saying what is coming on 18 January. 2 findings, same series, completely different shapes, and the shape is decided by one fact: is the vulnerability still live on master or not.&lt;/p&gt;

&lt;p&gt;There is a version of this story that is written in a different tone, and I have chosen not to write it. A month of silence with a fix in hand is genuinely enraging; the anger is not wrong, and anyone who has reported a vulnerability and watched an inbox stay empty knows the specific flavour of it. But anger in the text gives the vendor an exit: it lets the conversation become about the tone instead of the dates. Every factual claim in this series survives being read by someone who dislikes me personally, and that is not an accident of temperament. It is the only property of the writing that makes the withheld technical half survivable. A reporter who has published the mechanism of an unfixed bug has spent everything; a reporter who has published only checkable facts still holds the deadline.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rules, stated plainly
&lt;/h2&gt;

&lt;p&gt;First: a technical detail is published only when the finding it belongs to is fixed, or the deadline has passed. Not "when it feels safe", not "when it would make a better post": fixed, or expired.&lt;/p&gt;

&lt;p&gt;Second: unfixed findings can be named, counted and statused, but not explained. Saying that C01 and C02 are rated High and remain in triage tells a user of the product nothing they can exploit; explaining how they work would. The line between "exists" and "how" is the whole game.&lt;/p&gt;

&lt;p&gt;Third: no impact speculation. Every scope paragraph in every report says the same 3 things: local checkout, synthetic data, no production system tested. The posts repeat it because the alternative, a blog post implying that production is definitely exploitable, would be a claim I have not tested and cannot back.&lt;/p&gt;

&lt;p&gt;Fourth: everything public must be independently checkable. The advisories are public pages, the fixes are public commits, the timeline is a public issue, and every date in every post comes from one of those. A reader who distrusts me can verify the whole story from links, which is also why the story survives the withheld technical half.&lt;/p&gt;

&lt;p&gt;That last rule is what makes this series possible at all. The ghosting, the part that angers people, does not require a single line of vulnerability code to be told. It requires dates, quotes, commit links and advisory states, all of which are public. The bugs are the reason the story started; the silence is the story.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why not just publish everything now
&lt;/h2&gt;

&lt;p&gt;The argument for immediate full disclosure is not stupid. The code is open source; a sufficiently motivated person can find these bugs again; every day of delay is a day the bugs exist unfixed. All of that is true, and it is exactly the calculation a reporter has to make honestly.&lt;/p&gt;

&lt;p&gt;Here is the counterweight, and it is specific to this case, not a general principle. The vendor has demonstrated that it fixes what is in front of it: 2 patches landed within a day of the report, a third landed on 20 November with a review and a regression test. In my experience, the disclosure process showed significant communication and coordination shortcomings. Publishing the remaining technical details now would guarantee that the broken queue processes them in public, in an environment where the first reaction is defensive, where CVE-level attention arrives before a triage answer ever did, and where I would have burned the one thing that has actually produced movement: the ability to say "you still have until January, and I would rather verify your fixes than publish over them."&lt;/p&gt;

&lt;p&gt;There is also a plainer reason. Publishing details for bugs that are fixed costs the vendor nothing and costs users nothing, because the information is already safe. Publishing details for bugs that are not fixed costs the users of the product the window they still have. The reporter decides the deadline; the deadline decides the risk. That is the whole of coordinated disclosure, and it is a heavier decision than the angry version of it sounds.&lt;/p&gt;

&lt;p&gt;So the series tells what can be told now, completely, and holds the rest to a date that has been stated in writing to the vendor, twice, with the CERT attached. On 18 January 2027 the remaining findings are published with full technical detail, fixed or not. If they are fixed before then, they get the same treatment C07, C08 and C03 got: a story, the code, the fix, the regression test, and credit to the people who patched it.&lt;/p&gt;

&lt;p&gt;References: &lt;a href="https://github.com/internxt/drive-server-wip/security/advisories/GHSA-8734-26fx-fg92" rel="noopener noreferrer"&gt;GHSA-8734-26fx-fg92&lt;/a&gt;, &lt;a href="https://github.com/internxt/drive-server-wip/security/advisories/GHSA-mv5w-7wrf-r458" rel="noopener noreferrer"&gt;GHSA-mv5w-7wrf-r458&lt;/a&gt;, &lt;a href="https://github.com/internxt/drive-server-wip/security/advisories/GHSA-wjmx-m49r-9rrh" rel="noopener noreferrer"&gt;GHSA-wjmx-m49r-9rrh&lt;/a&gt;, &lt;a href="https://dev.to/zerox80/3-fixes-in-internxts-drive-backend-1nk6"&gt;the timeline post&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>disclosure</category>
      <category>opensource</category>
      <category>bugbounty</category>
    </item>
    <item>
      <title>Internxt Drive: a logout that lasted 120 milliseconds</title>
      <dc:creator>zerox80</dc:creator>
      <pubDate>Mon, 23 Nov 2026 21:40:16 +0000</pubDate>
      <link>https://dev.to/zerox80/a-logout-that-lasted-120-milliseconds-3fo2</link>
      <guid>https://dev.to/zerox80/a-logout-that-lasted-120-milliseconds-3fo2</guid>
      <description>&lt;p&gt;A logout that lasts 120 milliseconds is still a logout, technically. It returns 200, it puts the token on a blacklist, and for about the time it takes to blink, the token really is rejected. Then it works again.&lt;/p&gt;

&lt;p&gt;I found this one because I was checking a different question. Late October 2026, local checkout of &lt;code&gt;internxt/drive-server-wip&lt;/code&gt; at commit &lt;code&gt;7d7a8be2&lt;/code&gt;, synthetic users, a disposable PostgreSQL on 55432 and a Valkey on 56379. I was going through the authentication module looking at how sessions end, not how they begin. Session termination is a good place to audit because everyone remembers to check the login path and almost nobody re-reads the logout path after the first implementation.&lt;/p&gt;

&lt;p&gt;The entire logout use case is 28 lines:&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;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;JwtService&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'@nestjs/jwt'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;CacheManagerService&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'../cache-manager/cache-manager.service'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Injectable&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'@nestjs/common'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="no"&gt;JWT_7DAYS_EXPIRATION&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="s1"&gt;'./constants'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@Injectable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AuthUsecases&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;cacheManagerService&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;CacheManagerService&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;jwtService&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;JwtService&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;async&lt;/span&gt; &lt;span class="nf"&gt;logout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jwt&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;tokenClaims&lt;/span&gt; &lt;span class="o"&gt;=&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;jwtService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jwt&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="n"&gt;tokenClaims&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jti&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;currentTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1000&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;ttl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tokenClaims&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exp&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;currentTime&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="n"&gt;ttl&lt;/span&gt; &lt;span class="o"&gt;&amp;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;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;cacheManagerService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blacklistJwt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="n"&gt;tokenClaims&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jti&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="n"&gt;ttl&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="no"&gt;JWT_7DAYS_EXPIRATION&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;p&gt;&lt;code&gt;jwtService.decode(jwt)&lt;/code&gt; gives back the claims. &lt;code&gt;exp&lt;/code&gt; is a Unix timestamp in seconds. &lt;code&gt;Date.now()&lt;/code&gt; is milliseconds, so &lt;code&gt;Math.floor(Date.now() / 1000)&lt;/code&gt; converts the current time into seconds to make the subtraction work. &lt;code&gt;ttl = tokenClaims.exp - currentTime&lt;/code&gt; is therefore a number of &lt;strong&gt;seconds&lt;/strong&gt;. If it is positive, the &lt;code&gt;jti&lt;/code&gt; goes onto a blacklist for that long. It reads correctly. It is the kind of code you glance at and move on from, which is exactly why I went to look at the other end of the call.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CacheManagerService.blacklistJwt&lt;/code&gt; is 3 lines: it takes a &lt;code&gt;jti&lt;/code&gt; and a &lt;code&gt;ttl&lt;/code&gt;, prefixes the key with &lt;code&gt;jwt:&lt;/code&gt;, and forwards both to the cache manager's &lt;code&gt;set&lt;/code&gt; with the TTL passed through unchanged. That &lt;code&gt;set&lt;/code&gt; API expects &lt;strong&gt;milliseconds&lt;/strong&gt;. The locked version in this repository documents that. So a token with 2 minutes of life left was blacklisted for 120 milliseconds. The &lt;code&gt;?? JWT_7DAYS_EXPIRATION&lt;/code&gt; fallback in the logout code is dead code: &lt;code&gt;ttl&lt;/code&gt; is only used inside &lt;code&gt;if (ttl &amp;gt; 0)&lt;/code&gt;, so it can never be nullish at the point where the fallback would apply. Someone added a safety net to a value that was already guaranteed to be a number. Nobody added the multiplication.&lt;/p&gt;

&lt;p&gt;It is worth being precise about what the blacklist is for, because the design is reasonable. A JWT is self-contained: once signed, the server has no session record to delete. To end a session early you need a revocation list, and the natural key is the &lt;code&gt;jti&lt;/code&gt; claim with an expiry equal to the token's remaining lifetime. After &lt;code&gt;exp&lt;/code&gt;, the token is invalid on its own, so there is no reason to keep the blacklist entry. That is exactly what this code implements. The only thing wrong with it is a factor of one thousand.&lt;/p&gt;

&lt;p&gt;I checked the validation side to make sure the blacklist was the only thing standing between a logged-out token and a live session:&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;async&lt;/span&gt; &lt;span class="nf"&gt;validate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;JwtAuthInfo&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="k"&gt;try&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="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;UnauthorizedException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Old token version detected'&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;jti&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jti&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="n"&gt;jti&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;isBlacklisted&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;cacheManagerService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isJwtBlacklisted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jti&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="n"&gt;isBlacklisted&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;UnauthorizedException&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;The strategy decodes the payload, extracts the &lt;code&gt;jti&lt;/code&gt;, and calls &lt;code&gt;isJwtBlacklisted&lt;/code&gt;. If the key exists, the request is rejected. Otherwise any correctly signed token is accepted. There is no second check, no session table, no server-side record of "this user logged out". The blacklist is the entire mechanism. When its 120 milliseconds expire, the token is indistinguishable from one that was never logged out.&lt;/p&gt;

&lt;p&gt;The unit conversion already existed elsewhere in the codebase, which made the miss more interesting:&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;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nf"&gt;daysAgo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;days&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&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;Time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dateWithTimeAdded&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;days&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'day'&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;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;convertTimestampToDate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;dayjs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;timestamp&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toDate&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="cm"&gt;/**
   * Returns a new Date object set to the end of the day (23:59:59.999)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Time.convertTimestampToDate&lt;/code&gt; in &lt;code&gt;src/lib/time.ts&lt;/code&gt; multiplies by 1000 by hand; one helper knew about seconds and milliseconds, and the logout path did not use it.&lt;/p&gt;

&lt;p&gt;I checked the &lt;code&gt;cache-manager&lt;/code&gt; version pinned in the repository before writing this up, because a unit mismatch is only a bug if the receiving API really does interpret the number the way I thought. It does: the third argument to &lt;code&gt;set&lt;/code&gt; is a TTL in milliseconds. The library is not ambiguous and the code is not ambiguous; the 2 are simply written in different units, and TypeScript types both of them as &lt;code&gt;number&lt;/code&gt;. That is the whole difficulty. There is no type, no name and no test between &lt;code&gt;ttl&lt;/code&gt; and &lt;code&gt;cacheManager.set&lt;/code&gt; that would make a reviewer stop. Every static check passes. Every unit test that mocks the cache manager passes. The bug lives in the space between 2 correct lines.&lt;/p&gt;

&lt;p&gt;That is also why the failure is so quiet. Nothing throws. The cache accepts 120 as a TTL, stores the key, and evicts it 120 milliseconds later. From inside the process, the logout looks successful: the blacklist call happened, the key existed, the response was 200. Only an observer with a watch and the original token can see that the containment lasted less than a second. If the test had asserted only "the key exists after logout", it would have passed on the vulnerable code.&lt;/p&gt;

&lt;p&gt;I wrote a PoC that signs a short-lived token and uses it against the real HTTP stack. Logout, immediate reuse, a 350-millisecond wait, reuse again:&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'C08: a logged-out signed token becomes usable after its Redis blacklist TTL expires'&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="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;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createTestUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&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;original&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;jwt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&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="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;any&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;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;jti&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;v4&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;sub&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="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;original&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;payload&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="nf"&gt;getEnv&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;secrets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jwt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'120s'&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;first&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getHttpServer&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="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/auth/logout'&lt;/span&gt;&lt;span class="p"&gt;)&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="s1"&gt;'Authorization'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${token}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&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;blocked&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getHttpServer&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="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/auth/logout'&lt;/span&gt;&lt;span class="p"&gt;)&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="s1"&gt;'Authorization'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${token}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blocked&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;401&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="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;350&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;reused&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getHttpServer&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 result:&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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blocked&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;401&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="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;350&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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reused&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&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;200, then 401, then 200. The same token, the same signature, accepted again about a third of a second after logout. There is nothing exotic here: no race condition, no timing attack, no clock skew. A number in the wrong unit. The reason it matters is the scenario in which a user reaches for the logout button: a token leaked, a session left open on a machine they do not control, a device lost. Logout is the containment control. A 120-millisecond containment control is not one.&lt;/p&gt;

&lt;p&gt;The 350-millisecond wait in the test is not arbitrary. The token I signed had 2 minutes of life left, so the blacklist entry, on the vulnerable code, lived for 120 milliseconds. Waiting 350 gives the entry 3 full chances to expire and leaves no room for a slow clock or a busy event loop to explain the second 200 away. I deliberately used the logout endpoint itself for all 3 requests rather than some cheaper authenticated route, because it exercises the same global auth guard a real reuse would. The test is small, but every line of it is load-bearing.&lt;/p&gt;

&lt;p&gt;Everything ran through the same harness as the other 12 findings: loopback-only guards at the top of the PoC's &lt;code&gt;beforeAll&lt;/code&gt;, a staged test file removed by a &lt;code&gt;trap&lt;/code&gt; on exit, synthetic credentials, SendGrid in sandbox mode, jest in band with &lt;code&gt;--forceExit&lt;/code&gt;. The 4-line test-only patch for the repository's mock Bridge provider, the one that adds the missing &lt;code&gt;getLimit()&lt;/code&gt;, is documented in &lt;a href="https://dev.to/zerox80/reproducing-a-backend-vulnerability-without-touching-production-713"&gt;the harness post&lt;/a&gt;, not with the finding.&lt;/p&gt;

&lt;p&gt;The report went out on 28 October with the other 12. The fix landed on 29 October in &lt;code&gt;6a7801c&lt;/code&gt;, and it is a better fix than the bug deserved. It adds a named conversion helper &lt;code&gt;Time.secondsToMs&lt;/code&gt;, converts the delta before passing it on, puts the unit in the variable name, and renames the cache parameter so the next reader cannot avoid the question:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gu"&gt;@@ -1,7 +1,7 @@&lt;/span&gt;
 import { JwtService } from '@nestjs/jwt';
 import { CacheManagerService } from '../cache-manager/cache-manager.service';
 import { Injectable } from '@nestjs/common';
&lt;span class="gd"&gt;-import { JWT_7DAYS_EXPIRATION } from './constants';&lt;/span&gt;
&lt;span class="gi"&gt;+import { Time } from '../../lib/time';&lt;/span&gt;

 @Injectable()
 export class AuthUsecases {

&lt;span class="gu"&gt;@@ -47,9 +41,13 @@ export class Time {&lt;/span&gt;
   }

   public static readonly convertTimestampToDate = (timestamp: number): Date =&amp;gt; {
&lt;span class="gd"&gt;-    return dayjs(timestamp * 1000).toDate();&lt;/span&gt;
&lt;span class="gi"&gt;+    return dayjs(Time.secondsToMs(timestamp)).toDate();&lt;/span&gt;
   };

&lt;span class="gu"&gt;@@ -97,11 +97,11 @@ export class CacheManagerService {&lt;/span&gt;
     return cachedLimit;
   }

&lt;span class="gd"&gt;-  async blacklistJwt(jti: string, ttl: number) {&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2 e2e tests came with it. One asserts that the token is rejected immediately after logout. The other connects to Redis directly, reads the &lt;code&gt;pTTL&lt;/code&gt; of the blacklist key, and compares it with the token's remaining lifetime within 10 seconds:&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="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Logout'&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;redisClient&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;RedisClientType&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;loginAndGetToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&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="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;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;registrationData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;generateValidRegistrationData&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="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;registerUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;registrationData&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;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getHttpServer&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="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/auth/login/access'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;HttpStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;OK&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;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;newToken&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That second test is the one that would have caught the original bug: it does not check "was something blacklisted", it checks "for how long". The commit also swapped the local cache image from &lt;code&gt;redis:latest&lt;/code&gt; to &lt;code&gt;valkey/valkey:8&lt;/code&gt; and exposed port 6379 so the test could reach it from the host, which is a small, honest detail: the reason this bug survived is that there was no test that could observe a TTL from outside the process. Once there was one, the unit error was obvious.&lt;/p&gt;

&lt;p&gt;Then the advisory sat. I had filed &lt;a href="https://github.com/internxt/drive-server-wip/security/advisories/GHSA-mv5w-7wrf-r458" rel="noopener noreferrer"&gt;GHSA-mv5w-7wrf-r458&lt;/a&gt; privately on 29 October, the day of the fix. On 3 November I emailed security@ with links to every advisory and asked who was coordinating. No answer. On 4 November I asked in the public issue whether they needed help and offered to open pull requests. No answer. On 9 November Internxt published the C07 advisory themselves, rated Low, without telling me, so I knew the publishing machinery worked. C08, fixed the same day as C07, stayed unpublished.&lt;/p&gt;

&lt;p&gt;On 19 November I wrote in the issue: "Why does noone answer? Why all that silent? All my findings are all valid." On 20 November the issue was closed and locked to collaborators, and C08 appeared as published, High, with my name added under Credits as Reporter. 22 days after the fix, and the same 22 days after the advisory I had filed privately on that 29 October. Nobody had replied to either of my questions; the answer was the published page.&lt;/p&gt;

&lt;p&gt;I should correct something I wrote earlier. In the first draft of the disclosure post I said I was not credited on C08. By the time the advisory went live, a credit had been added, &lt;code&gt;zerox80&lt;/code&gt; as Reporter, though the advisory itself was created by the maintainer rather than published from mine, and the credit shows no acceptance. The C07 advisory, by contrast, was published from my draft with the credit accepted and a comment from me asking for public attribution. 2 bugs fixed on the same day, 2 advisories handled 3 weeks apart, 2 different credit states. None of it was explained to me; I read it off the pages. It is a small thing, but it is exactly the kind of small thing a single email would have settled. On GitHub all 8 advisories in this repository now carry the note "This report was submitted with AI assistance", which is worth knowing when you read the discussion around them; the PoCs and test logs are the evidence, not the prose.&lt;/p&gt;

&lt;p&gt;The same 20 November also produced the only substantive sentence I received after 29 October, in the now-locked issue; the timeline post quotes it in full. C08 had been fixed for 3 weeks. C03 was fixed and published that day. C09 and C11 were closed without a published fix or a stated reason. C01 and C02, both rated High, stayed in triage.&lt;/p&gt;

&lt;p&gt;I keep coming back to the unit. &lt;code&gt;ttl&lt;/code&gt; is a perfectly reasonable name for a variable. &lt;code&gt;ttlMs&lt;/code&gt; is a reasonable name that also forces a question every time it is passed to a new API. The rename in &lt;code&gt;6a7801c&lt;/code&gt; is not decoration; it is the actual fix, because the bug was never in the arithmetic, it was in the absence of anything that would make a reviewer ask "seconds or milliseconds?". A good regression test does the same job from the other side: it measures the thing the code promises, instead of the thing the code happens to do.&lt;/p&gt;

&lt;p&gt;The engineering here took a day. The publishing took 20-3. Between them was a queue nobody answered, a national CERT I had escalated to in early November, and a locked issue. The disclosure schedule I sent on 20 November stands: 1 December 2026 for the timeline and full details of the fixed issues, 18 January 2027 for the rest. I have no evidence the logout bug was exploited. The advisory is open, the PoC is attached, and if Internxt wants a second pair of eyes on any of the fixes, the offer is still open.&lt;/p&gt;

&lt;p&gt;22 days is an awkward length of time to hold a fixed vulnerability. The code is public, the fix is public, the regression test is public; the only thing not public was the fact that the advisory existed. Anyone diffing master on 30 October could have seen the &lt;code&gt;ttlMs&lt;/code&gt; rename and understood what it meant. That is the strange geometry of unpublished advisories for open-source repositories: the fix lands in the open, and the publication that would tell users to update is the part that waits. From the researcher's side, the same 22 days are spent in a different kind of quiet, checking the advisory page for a status change that never comes, wondering whether the notification email failed, and watching a repository you reported to receive 40 commits that are not about your report.&lt;/p&gt;

&lt;p&gt;References: &lt;a href="https://github.com/internxt/drive-server-wip/security/advisories/GHSA-mv5w-7wrf-r458" rel="noopener noreferrer"&gt;GHSA-mv5w-7wrf-r458&lt;/a&gt;, &lt;a href="https://github.com/internxt/drive-server-wip/commit/6a7801c3ad861cf569a83ab5cb4f2514cc6654df" rel="noopener noreferrer"&gt;6a7801c&lt;/a&gt;, &lt;a href="https://github.com/internxt/drive-server-wip/pull/1256" rel="noopener noreferrer"&gt;PR #1256&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>opensource</category>
      <category>nestjs</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Internxt Drive: a 403 that still deleted someone else's private shares</title>
      <dc:creator>zerox80</dc:creator>
      <pubDate>Mon, 23 Nov 2026 21:40:11 +0000</pubDate>
      <link>https://dev.to/zerox80/a-403-that-still-deleted-someone-elses-private-shares-19p1</link>
      <guid>https://dev.to/zerox80/a-403-that-still-deleted-someone-elses-private-shares-19p1</guid>
      <description>&lt;p&gt;The first thing I noticed was the 403. It was the right answer to the wrong question, and by the time the server produced it, the damage was already done.&lt;/p&gt;

&lt;p&gt;It was late October 2026 and I was reading &lt;code&gt;sharing.service.ts&lt;/code&gt; in a local checkout of &lt;code&gt;internxt/drive-server-wip&lt;/code&gt;, the NestJS backend behind Internxt Drive. I had decided to audit the sharing module first because it is where the interesting state lives: private shares between users, pending invitations, public links, encryption keys, and the mapping between a file UUID and the people allowed to see it. A cloud storage product can survive a lot of bugs. It cannot survive getting that mapping wrong.&lt;/p&gt;

&lt;p&gt;The specific question I was asking was boring: in each method that mutates sharing state, where does the authorization check happen relative to the write? Not whether a check exists, since most methods have one, but where it sits in the sequence. A check after a write is a check that never ran when it mattered. I had a local checkout of commit &lt;code&gt;7d7a8be2&lt;/code&gt; from 28 October, a disposable PostgreSQL on port 55432 with TLS and migrations applied, and a Valkey instance on 56379. Synthetic users, synthetic keys, no production system, no real account. That boundary was not an afterthought; it was the condition under which I was willing to run anything at all.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;createPublicSharing&lt;/code&gt; is supposed to create a public link for a file or folder. You send an item UUID, an encryption key, an encrypted code, and optionally a flag called &lt;code&gt;persistPreviousSharing&lt;/code&gt;. If that flag is absent or false, the method cleans up other sharings for the same item first. That makes sense on the surface: you do not want a folder to be public and privately shared at the same time. Here is the middle of the method, as it stood on the audited commit:&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="n"&gt;updatedAt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;shouldRemoveOtherSharings&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;dto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;persistPreviousSharing&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="n"&gt;shouldRemoveOtherSharings&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="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;removeItemFromBeingShared&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;dto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;itemType&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;dto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;itemId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nc"&gt;SharingType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Private&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;sharing&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;sharingRepository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findOneSharingBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;itemId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;dto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;itemId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;itemType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;dto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;itemType&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;SharingType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Public&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;There are 3 things in that block, and their order is the whole finding. First, &lt;code&gt;removeItemFromBeingShared&lt;/code&gt; runs. Then &lt;code&gt;findOneSharingBy&lt;/code&gt; looks for an existing public sharing. Only then does &lt;code&gt;item.isOwnedBy(user)&lt;/code&gt; decide whether the caller is allowed to touch the item at all. The &lt;code&gt;ForbiddenException&lt;/code&gt; at line 1281 returns 403 to a non-owner, which is correct as far as the HTTP response goes. It is also too late, because the deletes have already been issued.&lt;/p&gt;

&lt;p&gt;I went to the helper next, expecting to find an owner filter I had missed:&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;private&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;removeItemFromBeingShared&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;itemType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Sharing&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'itemType'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;itemId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Sharing&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'itemId'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Sharing&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'type'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;sharedWithType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;SharedWithType&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SharedWithType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Individual&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nc"&gt;SharingType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Private&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="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sharingRepository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deleteInvitesBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;itemId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;itemType&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="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;sharingRepository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deleteSharingsBy&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 calls &lt;code&gt;deleteInvitesBy&lt;/code&gt; for the private case and then &lt;code&gt;deleteSharingsBy&lt;/code&gt;, with no &lt;code&gt;ownerId&lt;/code&gt;, no &lt;code&gt;userId&lt;/code&gt; and no predicate tying the rows to the authenticated caller anywhere in the signature. The repository methods are equally direct:&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;async&lt;/span&gt; &lt;span class="nf"&gt;deleteInvitesBy&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="nc"&gt;Partial&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;SharingInvite&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="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&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;sharingInvites&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;destroy&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="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;bulkDeleteInvites&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;itemIds&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;SharingInvite&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'itemId'&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;Nothing in this path opens a transaction, so there is no rollback to undo the deletes when the &lt;code&gt;ForbiddenException&lt;/code&gt; fires a few lines later. In a NestJS service, an exception unwinds the call stack; it does not unwind a committed database write.&lt;/p&gt;

&lt;p&gt;There is a design question hiding behind the ordering bug, and the eventual fix answered it in a way I found interesting. Why should creating a public link destroy the item's private shares at all? The clean-up exists so an item is not public and privately shared at once, a product rule rather than a security requirement, and it was implemented as an unconditional sweep before anyone checked who was asking. The fix does not add a transaction or move the check earlier. It removes the sweep from this path entirely and lets invite creation manage its own state. That is the stronger position: when a mutation cannot be justified for every caller who can reach it, restricting the caller is a patch, removing the mutation is a design decision. The advisory is rated Low because the impact was revocation rather than disclosure, but the underlying pattern of product behaviour implemented before authorization is the same pattern that produces much worse bugs in other codebases.&lt;/p&gt;

&lt;p&gt;The next question was whether an unauthenticated stranger could even reach the method. They cannot, because the route is guarded, but the guard is narrower than it looks. The controller method sits behind the standard auth and in-behalf guards, and the in-behalf guard permits requests that carry no workspace header at all, which is the normal case for a personal drive item. On the audited commit, &lt;code&gt;WorkspacesResourcesItemsInBehalfGuard.canActivate&lt;/code&gt; reads the &lt;code&gt;x-internxt-workspace&lt;/code&gt; header, finds it absent, and falls through to the permissive branch rather than rejecting the request. So the prerequisite is only: be logged in, and know a folder UUID. UUIDs are not secrets in most systems; they appear in links, logs, client state and shared metadata. The attacker does not need to be the owner, a workspace member, or an invitee.&lt;/p&gt;

&lt;p&gt;At that point I stopped reading and wrote a test. I wanted a single self-contained file that a maintainer could run without believing a word of my prose. 3 synthetic users: an owner, an attacker, and a recipient. A folder under the owner's root. One private &lt;code&gt;Sharing&lt;/code&gt; row to the recipient, one &lt;code&gt;SharingInvite&lt;/code&gt; row with a &lt;code&gt;READER&lt;/code&gt; role. Then one HTTP request from the attacker, with &lt;code&gt;persistPreviousSharing: false&lt;/code&gt;:&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'C07: nonowner gets 403 after victim private share and invite are deleted'&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="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;owner&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createTestUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&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;attacker&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createTestUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&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;recipient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createTestUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&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;folder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;childFolder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;owner&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'victim-shared-folder'&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;sharings&lt;/span&gt;&lt;span class="p"&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="n"&gt;itemId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;itemType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'folder'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ownerId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;owner&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="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;sharedWith&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;recipient&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="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'private'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;encryptionKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'local-key'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;encryptionAlgorithm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'aes'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;any&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;role&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;roles&lt;/span&gt;&lt;span class="p"&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="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;v4&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;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'READER'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;any&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;invites&lt;/span&gt;&lt;span class="p"&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="n"&gt;itemId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;itemType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'folder'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sharedWith&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;recipient&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="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;encryptionKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'local-key'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;encryptionAlgorithm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'aes'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'private'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;roleId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;role&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;as&lt;/span&gt; &lt;span class="kt"&gt;any&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;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getHttpServer&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="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/sharings/'&lt;/span&gt;&lt;span class="p"&gt;)&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="s1"&gt;'Authorization'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${attacker.token}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response was 403. Then the test counted the rows:&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="nf"&gt;expect&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;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;403&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;expect&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;sharings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;count&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;itemId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'private'&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="nf"&gt;toBe&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="nf"&gt;expect&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;invites&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;count&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;itemId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&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="nf"&gt;toBe&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Zero private shares. Zero invites. The owner's links were gone, silently, and the only evidence was a failed request in the attacker's log. No file content was read, no key was returned to the attacker, nothing was exfiltrated. That is why the eventual advisory was rated Low. It is also why the bug bothered me: a destructive action that anyone can trigger against someone else's data, hidden behind an HTTP status that says nothing happened.&lt;/p&gt;

&lt;p&gt;Getting the test to run took one small detour. On that commit the repository's mock Bridge provider has no &lt;code&gt;getLimit()&lt;/code&gt; method, but the application calls it while the test app is being constructed, so the PoC ships with a 4-line test-only patch that adds it. I documented the patch separately from the finding and wrote into the report that it changes test code only and does not remediate anything; a reviewer should never have to wonder whether a PoC quietly fixed the bug it claims to demonstrate. The runner that staged the file, pointed every connection string at loopback, forced SendGrid into sandbox mode and removed the staged file again on exit is written up in &lt;a href="https://dev.to/zerox80/reproducing-a-backend-vulnerability-without-touching-production-713"&gt;the harness post&lt;/a&gt;; the PoC file itself repeats the same boundary check at the top of its &lt;code&gt;beforeAll&lt;/code&gt;, throwing unless &lt;code&gt;RDS_HOSTNAME&lt;/code&gt; is &lt;code&gt;127.0.0.1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The first run took about 40 seconds, most of it bootstrapping the Nest application against the disposable database. Jest reported one suite, one test, one pass, and the log between those 2 lines is the entire finding: an HTTP request from a user who owns nothing, a 403, and 2 SQL counts that came back as zero. I ran it twice more because a result like that deserves a second look: deleted rows do not come back, so the second run had to build its own fixtures from scratch, and it did. Reproducibility was the point. A maintainer reading the report could not verify my conclusion about their production system, but they could verify everything I had actually claimed: that this code, on this commit, with this request, deletes these rows.&lt;/p&gt;

&lt;p&gt;On 28 October I put 13 of these packages into an archive (a PoC, a test log, source references pinned to the audited commit, and a hash of the whole thing) and sent it to &lt;a href="mailto:hello@internxt.com"&gt;hello@internxt.com&lt;/a&gt; and &lt;a href="mailto:security@internxt.com"&gt;security@internxt.com&lt;/a&gt;, the address in the repository's own &lt;code&gt;SECURITY.md&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Getting the package to them had taken 8 days: an auto-reply from hello@ on 20 October, a public issue on 24 October that asked only for a confidential channel, another auto-reply on 26 October, and then the suggestion on 28 October that I leave a comment on the public GitHub page so the developers would check, at a company whose product is sold on end-to-end encryption and zero-knowledge storage. I declined and said I would escalate to a national CERT; private vulnerability reporting was switched on within the hour, and the package went out that afternoon. The next morning support wrote "I will pass this to the necessary team members", the last substantive answer for 3 weeks. The full sequence of dates, quotes and emails is in &lt;a href="https://dev.to/zerox80/3-fixes-in-internxts-drive-backend-1nk6"&gt;the timeline post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The fix landed on 29 October, 1 day after the report, in &lt;code&gt;d1f51c9&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gu"&gt;@@ -1163,16 +1163,6 @@ export class SharingService {&lt;/span&gt;
       throw new BadRequestException('Limit for sharing an item reach');
     }

&lt;span class="gd"&gt;-    const shouldRemoveOtherSharings = !createInviteDto.persistPreviousSharing;&lt;/span&gt;
&lt;span class="gd"&gt;-&lt;/span&gt;
&lt;span class="gd"&gt;-    if (shouldRemoveOtherSharings) {&lt;/span&gt;
&lt;span class="gd"&gt;-      await this.removeItemFromBeingShared(&lt;/span&gt;
&lt;span class="gd"&gt;-        createInviteDto.itemType,&lt;/span&gt;
&lt;span class="gd"&gt;-        createInviteDto.itemId,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Internxt removed the delete from both public-share and invite creation, deleted the helper entirely, and added an HTTP regression test. That last part is the part I respect most. The existing unit test for this path checked only that a non-owner gets 403, which passed both before and after the fix. The new e2e test posts to &lt;code&gt;/sharings&lt;/code&gt; as a non-owner, expects the 403, and exists precisely because the old test could not see the side effects:&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'When the owner creates it, then it returns the public sharing'&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="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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/sharings'&lt;/span&gt;&lt;span class="p"&gt;)&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="s1"&gt;'Authorization'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${owner.token}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;buildDto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;HttpStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;CREATED&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toMatchObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'When a user who is not the owner tries to create it, then it fails'&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="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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/sharings'&lt;/span&gt;&lt;span class="p"&gt;)&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="s1"&gt;'Authorization'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${otherUser.token}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;buildDto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;HttpStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;FORBIDDEN&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'When the item does not exist, then it fails'&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="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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/sharings'&lt;/span&gt;&lt;span class="p"&gt;)&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="s1"&gt;'Authorization'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${owner.token}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;buildDto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;v4&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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;HttpStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;NOT_FOUND&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 fix in a day, with a regression test, is good engineering. What followed was not.&lt;/p&gt;

&lt;p&gt;On 9 November a maintainer published &lt;a href="https://github.com/internxt/drive-server-wip/security/advisories/GHSA-8734-26fx-fg92" rel="noopener noreferrer"&gt;GHSA-8734-26fx-fg92&lt;/a&gt; as Low, CVSS 2.3, vector &lt;code&gt;CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N&lt;/code&gt;. I was not told. The vector is defensible: integrity impact Low, no confidentiality impact, attack complexity High because the attacker needs the UUID. I had written the same boundary into the report myself: no production system was tested, the attacker knew the item UUID, and deployment-specific reachability needed maintainer review. The rating was not the problem.&lt;/p&gt;

&lt;p&gt;The problem was that between 29 October and 20 November nobody answered a single question. On 4 November I asked in the issue whether they needed help and offered to open pull requests. On 19 November I asked why nobody was answering. Meanwhile the repository received commits almost every working day: index cleanups, performance work, new features, a client-version policy, a photos bucket. The team was visibly busy. Just not with this queue.&lt;/p&gt;

&lt;p&gt;I had taken the case to CERT-Bund, Germany's national CERT at the BSI, in early November. Their view on 11 November was reasonable: since some issues had already been fixed, there was no reason to assume the rest would not be. They asked me to report back on 24 November. On 20 November I emailed a disclosure schedule to security@ and hello@: 1 December for the timeline and full details of the fixed issues, 18 January 2027 for everything else, 90 days after my first email.&lt;/p&gt;

&lt;p&gt;On that same 20 November, the issue was closed and locked to collaborators, C08 was published as High, C03 was fixed and published as Moderate, C09 and C11 were closed without a published fix or a stated reason, and a maintainer acknowledged the report for the first time in 3 weeks. C07 had been fixed for 22 days. From the outside it looked less like triage than like a queue someone had finally opened.&lt;/p&gt;

&lt;p&gt;The technical lesson here is old and short: authorize first, change data second, and test that a 403 has no side effects. A guard that returns the right status code can still be the wrong guard. The other lesson is about what a severity rating does and does not measure. "Low" describes the impact of this bug on a deployed system. It says nothing about the cost of a report remaining without a substantive response for a month, or about how many other people can read the same open-source code and reach the same line 1268 without ever sending an email.&lt;/p&gt;

&lt;p&gt;The disclosure schedule still stands: 1 December 2026 for the timeline and the fixed issues, 18 January 2027 for full technical details of the remaining findings. I have no evidence any of this was exploited. The advisories are open, the PoCs are attached, and the offer to verify fixes still stands.&lt;/p&gt;

&lt;p&gt;References: &lt;a href="https://github.com/internxt/drive-server-wip/security/advisories/GHSA-8734-26fx-fg92" rel="noopener noreferrer"&gt;GHSA-8734-26fx-fg92&lt;/a&gt;, &lt;a href="https://github.com/internxt/drive-server-wip/commit/d1f51c915e9456e595f0bcc41d392005598faf00" rel="noopener noreferrer"&gt;d1f51c9&lt;/a&gt;, &lt;a href="https://github.com/internxt/drive-server-wip/pull/1257" rel="noopener noreferrer"&gt;PR #1257&lt;/a&gt;, &lt;a href="https://github.com/internxt/drive-server-wip/issues/1246" rel="noopener noreferrer"&gt;issue #1246&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>opensource</category>
      <category>nestjs</category>
      <category>disclosure</category>
    </item>
    <item>
      <title>How I found a cross-tenant data leak in django-tenants</title>
      <dc:creator>zerox80</dc:creator>
      <pubDate>Mon, 23 Nov 2026 21:34:29 +0000</pubDate>
      <link>https://dev.to/zerox80/how-i-found-a-cross-tenant-data-leak-in-django-tenants-38pm</link>
      <guid>https://dev.to/zerox80/how-i-found-a-cross-tenant-data-leak-in-django-tenants-38pm</guid>
      <description>&lt;p&gt;On 2026-11-17 the django-tenants project published GHSA-q7xr-949m-53qg: in versions below 4.0.5, the library's tenant context managers could leave a database connection pointed at the wrong tenant, and every query on that connection afterwards silently read and wrote another tenant's data. I reported it. The whole fix is a missing &lt;code&gt;self.&lt;/code&gt;, and the lines that caused the bug are six years older than the feature that exposed them. This post is the full story, because the pattern generalizes far beyond one Django package: two statements that each look correct on their own, and are wrong together.&lt;/p&gt;

&lt;h2&gt;
  
  
  The one thing a multi-tenant library must get right
&lt;/h2&gt;

&lt;p&gt;django-tenants puts every tenant of a Django project into its own PostgreSQL schema. Tenant "acme" gets a schema named &lt;code&gt;acme&lt;/code&gt; with its own &lt;code&gt;auth_user&lt;/code&gt;, &lt;code&gt;orders&lt;/code&gt; and &lt;code&gt;invoices&lt;/code&gt; tables; tenant "globex" gets the same table set in schema &lt;code&gt;globex&lt;/code&gt;. One process serves everyone, and there is no per-query tenant filter. Isolation is the connection's &lt;code&gt;search_path&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;PostgreSQL resolves an unqualified table name by walking the schemas listed in &lt;code&gt;search_path&lt;/code&gt;; first match wins. django-tenants wraps Django's database backend (&lt;code&gt;django_tenants.postgresql_backend&lt;/code&gt;) so every connection carries a &lt;code&gt;tenant&lt;/code&gt; attribute, and switching tenants is &lt;code&gt;set_tenant(tenant)&lt;/code&gt; or &lt;code&gt;set_schema(name)&lt;/code&gt; — one call that rewrites the connection's &lt;code&gt;search_path&lt;/code&gt; to put the target tenant's schema first, with the shared &lt;code&gt;public&lt;/code&gt; schema behind it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_tenant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;acme&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# the connection's search_path is now effectively: acme, public&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, &lt;code&gt;Order.objects.all()&lt;/code&gt; is one tenant's orders, and nothing in the query itself says which tenant. The entire security model reduces to one invariant: every connection is always pointed at the right schema. Everything below is about a single place where that invariant broke.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two databases, one context manager
&lt;/h2&gt;

&lt;p&gt;The configuration where it broke is the multi-database one: a &lt;code&gt;default&lt;/code&gt; alias plus a second, tenant-aware alias — a reporting replica, an analytics database, a second cluster. django-tenants supports it. You point &lt;code&gt;TENANT_DB_ALIAS&lt;/code&gt; at the second alias, or pass &lt;code&gt;database=&lt;/code&gt; to the helpers, and the library is supposed to do all its switching on that connection instead of the default one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="no"&gt;DATABASES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;# the affected configuration: BOTH aliases use the tenant-aware backend&lt;/span&gt;
    &lt;span class="s2"&gt;"default"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"ENGINE"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"django_tenants.postgresql_backend"&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;"app"&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;"tenants"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"ENGINE"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"django_tenants.postgresql_backend"&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;"app_reporting"&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="no"&gt;TENANT_DB_ALIAS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"tenants"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The context managers are the API you reach for when code needs to look at another tenant for a moment — a management command iterating tenants, a cron job, a view that reads a neighbor schema. The docs show them like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;schema_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"acme"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# every query here runs in the acme schema&lt;/span&gt;

&lt;span class="c1"&gt;# Restores the `SEARCH_PATH` to its original value&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They also work as decorators:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@schema_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"acme"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;database&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"tenants"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;sync_acme&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;# every query here runs in the acme schema on the tenants alias,&lt;/span&gt;
    &lt;span class="c1"&gt;# and the decorator restores the previous tenant afterwards&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That comment is a promise, and it covers both forms. Keep it in mind.&lt;/p&gt;

&lt;p&gt;Alias support in these context managers is young: PR #1106, commit &lt;code&gt;18b96de&lt;/code&gt;, merged at the end of 2024. Before that, the library knew exactly one connection, and &lt;code&gt;connection&lt;/code&gt; was the only name it needed. After it, the code knew two names for connections — and that is precisely where it went wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two lines that did not agree
&lt;/h2&gt;

&lt;p&gt;I came at this from the docs: &lt;code&gt;docs/use.rst&lt;/code&gt; promises that the &lt;code&gt;SEARCH_PATH&lt;/code&gt; is restored after the block, and I wanted to know on which connection that promise holds once you pass &lt;code&gt;database=&lt;/code&gt;. So the first thing I read was the enter/exit pair — with a context manager, the source of truth is that pair, never the docstring. Here is &lt;code&gt;schema_context&lt;/code&gt; as it shipped in 4.0.4, in &lt;code&gt;django_tenants/utils.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nf"&gt;schema_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ContextDecorator&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;schema_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;args&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="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;database&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"database"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;get_tenant_database_alias&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;def&lt;/span&gt; &lt;span class="nf"&gt;__enter__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connections&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;database&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;previous_tenant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt;          &lt;span class="c1"&gt;# &amp;lt;-- the bug&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_schema&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;schema_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__exit__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;exc&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="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;previous_tenant&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_schema_to_public&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_tenant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;previous_tenant&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read it as two halves. &lt;code&gt;__enter__&lt;/code&gt; switches &lt;code&gt;self.connection&lt;/code&gt;, the connection of the alias you asked for. &lt;code&gt;__exit__&lt;/code&gt; restores onto &lt;code&gt;self.connection&lt;/code&gt;. Both halves are correct. The snapshot between them is not: &lt;code&gt;connection&lt;/code&gt; — no &lt;code&gt;self.&lt;/code&gt; — is the module-level &lt;code&gt;django.db.connection&lt;/code&gt;, Django's proxy for the &lt;code&gt;default&lt;/code&gt; alias. The line that remembers "what was this connection on before I switch it" reads the state of a different connection.&lt;/p&gt;

&lt;p&gt;And &lt;code&gt;tenant_context&lt;/code&gt;, a few lines further down, has the same defect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nf"&gt;tenant_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ContextDecorator&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__enter__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connections&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;database&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;previous_tenant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt;          &lt;span class="c1"&gt;# same bug&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_tenant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A context manager is a save/restore contract on one object. Here the save reads object A while the restore writes object B. The tenant that gets restored onto your analytics connection is whatever the default connection happened to be on when the block was entered.&lt;/p&gt;

&lt;p&gt;The fix that shipped in 4.0.5, enter and exit together:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__enter__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connections&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;database&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;previous_tenant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;previous_tenant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt;
    &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_schema&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;schema_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;_previous_tenants&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;previous_tenant&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__exit__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;exc&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;_restore_previous_tenant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connections&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;database&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;Snapshot from the connection you are about to switch, restore onto the connection you switched. &lt;code&gt;connection.tenant&lt;/code&gt; versus &lt;code&gt;self.connection.tenant&lt;/code&gt; — the entire vulnerability is a missing &lt;code&gt;self.&lt;/code&gt;, twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  What that means at runtime
&lt;/h2&gt;

&lt;p&gt;A concrete scenario: the &lt;code&gt;tenants&lt;/code&gt; alias is sitting on tenant Z — some earlier code put it there, that is that alias's normal working state. The default connection is on tenant A, or has no tenant at all and is on &lt;code&gt;public&lt;/code&gt;. Both facts at the same time are the "divergence between the default and the selected alias" the advisory describes.&lt;/p&gt;

&lt;p&gt;The proof of concept attached to my report needed no Django and no PostgreSQL, because the defect is in the control flow, not in the database. It copies the enter/exit logic verbatim out of &lt;code&gt;django_tenants/utils.py&lt;/code&gt; and stubs only the connection objects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FakeConn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tenant&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;events&lt;/span&gt; &lt;span class="o"&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;def&lt;/span&gt; &lt;span class="nf"&gt;set_schema&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;schema_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'set_schema'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;schema_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'FakeTenant(%s)'&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;schema_name&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_tenant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'set_tenant'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tenant&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_schema_to_public&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'set_schema_to_public'&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="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'public'&lt;/span&gt;


&lt;span class="n"&gt;default_conn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FakeConn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'TENANT_A'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# django.db.connection -&amp;gt; default alias&lt;/span&gt;
&lt;span class="n"&gt;connections&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;'default'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;default_conn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'analytics'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;FakeConn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'TENANT_Z'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;default_conn&lt;/span&gt;             &lt;span class="c1"&gt;# the module-level proxy utils.py imports&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nf"&gt;tenant_context&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="c1"&gt;# verbatim logic from utils.py:180-196 (4.0.4)&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;database&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'default'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tenant&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;database&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;database&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__enter__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connections&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;database&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;previous_tenant&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt;   &lt;span class="c1"&gt;# the default proxy&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_tenant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__exit__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;exc&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="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;previous_tenant&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_schema_to_public&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_tenant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;previous_tenant&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connections&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'analytics'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;              &lt;span class="c1"&gt;# sitting on TENANT_Z&lt;/span&gt;
&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;tenant_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'TENANT_B'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;database&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'analytics'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;pass&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                          &lt;span class="c1"&gt;# TENANT_A, expected TENANT_Z&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That block is condensed to the &lt;code&gt;tenant_context&lt;/code&gt; check; the script runs the same loop for &lt;code&gt;schema_context&lt;/code&gt;. The report ran it in a throwaway container with no network, as an unprivileged user, with the script mounted read-only:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;docker run --rm --network none --user 65534:65534 --cap-drop ALL \
  --security-opt no-new-privileges -v /tmp/cve-hunt-poc-run:/poc:ro \
  python:3.13-slim python /poc/repro_c002.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The events log in the output is the confession — you can watch the restore write &lt;code&gt;TENANT_A&lt;/code&gt; onto the analytics connection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;tenant_context
  before enter : TENANT_Z
  inside       : TENANT_B
  after &lt;span class="nb"&gt;exit&lt;/span&gt;   : TENANT_A &lt;span class="o"&gt;(&lt;/span&gt;expected TENANT_Z&lt;span class="o"&gt;)&lt;/span&gt;
  events       : &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'set_tenant'&lt;/span&gt;, &lt;span class="s1"&gt;'TENANT_B'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'set_tenant'&lt;/span&gt;, &lt;span class="s1"&gt;'TENANT_A'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  RESTORE BUG  : True
schema_context
  before enter : TENANT_Z
  inside       : FakeTenant&lt;span class="o"&gt;(&lt;/span&gt;TENANT_B&lt;span class="o"&gt;)&lt;/span&gt;
  after &lt;span class="nb"&gt;exit&lt;/span&gt;   : TENANT_A &lt;span class="o"&gt;(&lt;/span&gt;expected TENANT_Z&lt;span class="o"&gt;)&lt;/span&gt;
  events       : &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'set_schema'&lt;/span&gt;, &lt;span class="s1"&gt;'TENANT_B'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;, &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'set_tenant'&lt;/span&gt;, &lt;span class="s1"&gt;'TENANT_A'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  RESTORE BUG  : True
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So on exit, 4.0.4's &lt;code&gt;__exit__&lt;/code&gt; writes the snapshot it took from the default connection onto the &lt;code&gt;tenants&lt;/code&gt; connection: the alias is now on tenant A, or on &lt;code&gt;public&lt;/code&gt; if the default connection had no tenant set. It is not back on tenant Z, and it is not on whatever it was on before the block. The next query on that alias resolves its &lt;code&gt;search_path&lt;/code&gt; against the wrong schema: reads return another tenant's rows, and writes land in another tenant's tables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nc"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;using&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"tenants"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;first&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 row from tenant A's schema, delivered to code that asked for tenant Z's&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The part that makes this dangerous rather than annoying: nothing raises. The queries succeed, the table names are all valid, the ORM returns rows. A report containing the wrong tenant's numbers, or an order row written into another tenant's table, is not a failure that files itself. It is a failure you discover when a customer asks why they can see data that is not theirs.&lt;/p&gt;

&lt;p&gt;The advisory scores it Moderate, CVSS 6.8 (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N, CWE-284). Attack complexity is High for a reason: the vulnerable state is not something an attacker chooses, it is something the deployment has to already have — a multi-database setup where the default and the selected alias are on different tenants at the moment the block runs, for example a worker thread that has done tenant work on the default alias earlier in its life. When the state does exist, the impact is full cross-tenant read/write, hence C:H/I:H. Single-database deployments are not affected at all: there, &lt;code&gt;connection&lt;/code&gt; and &lt;code&gt;connections[self.database]&lt;/code&gt; are the same object and the bug has nowhere to live.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it survived since 2018
&lt;/h2&gt;

&lt;p&gt;The advisory's git blame puts the two snapshot lines at 2018 and 2020. When they were written they were correct, because the library had one connection and &lt;code&gt;connection&lt;/code&gt; was the only name for it. In 2024, alias support added a second name and updated two of the three places that touch a connection: enter switches the right one, exit restores the right one, but the snapshot kept reading the old one. A reviewer of that diff sees a change that looks complete. The bug is in the line the diff did not touch.&lt;/p&gt;

&lt;p&gt;Three things kept it invisible for two more years:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Single-database deployments — the overwhelming majority — never see it, because both names resolve to the same connection.&lt;/li&gt;
&lt;li&gt;Projects whose &lt;code&gt;default&lt;/code&gt; alias uses a stock Django backend got an &lt;code&gt;AttributeError&lt;/code&gt; on entry instead, because a stock connection has no &lt;code&gt;.tenant&lt;/code&gt;. For them the bug masqueraded as a crash. Crashes get worked around, and the workaround — do not use &lt;code&gt;database=&lt;/code&gt; — also removes the vulnerable path.&lt;/li&gt;
&lt;li&gt;No test asserted the alias's tenant after the block. The existing context-manager tests ran on the default alias, where save and restore coincide and the defect cannot appear. The contract "after the block, the connection I switched is back on the tenant it had before" was never written down as an assertion.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And the docs, both times they show the context managers, promise the right thing — &lt;code&gt;# Restores the SEARCH_PATH to its original value&lt;/code&gt;, &lt;code&gt;docs/use.rst&lt;/code&gt; lines 99 and 123. The code did restore a &lt;code&gt;search_path&lt;/code&gt;. From the wrong connection.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix pulled two more bugs into the light
&lt;/h2&gt;

&lt;p&gt;The maintainer, Tom Turner, did not stop at the missing &lt;code&gt;self.&lt;/code&gt;. The snapshot had a second problem: it lived on the context manager instance. &lt;code&gt;schema_context&lt;/code&gt; doubles as a decorator (&lt;code&gt;ContextDecorator&lt;/code&gt;), and a decorator has exactly one instance serving every call — nested calls and concurrent threads overwrote each other's saved tenant. And &lt;code&gt;with tenant:&lt;/code&gt; — the syntax sugar on the tenant model itself — kept its saved tenants in a class attribute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;TenantMixin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;_previous_tenant&lt;/span&gt; &lt;span class="o"&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;# one list, shared by every tenant and every thread&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__enter__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_previous_tenant&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;activate&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="nb"&gt;self&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__exit__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;exc_type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;exc_val&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;exc_tb&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_tenant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_previous_tenant&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&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;Two concurrent requests pushing to and popping from the same list can restore each other's tenant. That one became its own advisory, GHSA-8558-24hp-q3wq, published the same day. The 4.0.5 fix (commit &lt;code&gt;d61199f&lt;/code&gt;) moves the saved tenants to where the flow actually lives — a per-connection stack, and the connection is per thread:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_previous_tenants&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connection&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;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__dict__&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setdefault&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'_django_tenants_previous_tenants'&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;&lt;code&gt;with tenant:&lt;/code&gt; got the same treatment — the class attribute is gone:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt; def __enter__(self):
     connection = connections[get_tenant_database_alias()]
&lt;span class="gd"&gt;-    self._previous_tenant.append(connection.tenant)&lt;/span&gt;
     self.activate()
&lt;span class="gi"&gt;+    previous_tenant = connection.tenant&lt;/span&gt;
&lt;span class="gi"&gt;+    _previous_tenants(connection).append(previous_tenant)&lt;/span&gt;
     return self

 def __exit__(self, exc_type, exc_val, exc_tb):
     connection = connections[get_tenant_database_alias()]
&lt;span class="gd"&gt;-    connection.set_tenant(self._previous_tenant.pop())&lt;/span&gt;
&lt;span class="gi"&gt;+    _restore_previous_tenant(connection)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All three forms — &lt;code&gt;schema_context()&lt;/code&gt;, &lt;code&gt;tenant_context()&lt;/code&gt; and &lt;code&gt;with tenant:&lt;/code&gt; — push onto that stack on entry and pop on exit, and they push only after the switch succeeded. The old &lt;code&gt;with tenant:&lt;/code&gt; exit also restored a popped &lt;code&gt;None&lt;/code&gt; straight into &lt;code&gt;set_tenant()&lt;/code&gt;, which the new &lt;code&gt;_restore_previous_tenant()&lt;/code&gt; turns into a switch back to &lt;code&gt;public&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The release also adds the regression tests the old suite was missing. This one is quoted from &lt;code&gt;django_tenants/tests/test_utils.py&lt;/code&gt; — two fake connections, save from one, restore onto the other, and the assertion that the switched alias gets its own tenant back:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ContextRestoresSelectedAliasTestCase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;SimpleTestCase&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="s2"&gt;"""schema_context() and tenant_context() on a non-default alias restore
    that alias's own tenant, not the default connection's."""&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;arg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;default&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_FakeTenantConnection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'tenant_a'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;other&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_FakeTenantConnection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'tenant_z'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;fake_connections&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;'default'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'other'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;mock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;patch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;object&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'connections'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fake_connections&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; \
                &lt;span class="n"&gt;mock&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;patch&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;object&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'connection'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertNotEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'tenant_z'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;other&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'tenant_z'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assertEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;default&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'tenant_a'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;test_schema_context_with_database&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;_check&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;utils&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;schema_context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'tenant_b'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;database&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'other'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Four more cases cover &lt;code&gt;tenant_context&lt;/code&gt;, the &lt;code&gt;TENANT_DB_ALIAS&lt;/code&gt; path, the restore-to-public case, nested decorator calls and interleaved connections.&lt;/p&gt;

&lt;p&gt;If your mental model of saved state is "a field on the thing doing the saving", this fix is a good correction. A context manager instance is shared when used as a decorator. A model class attribute is shared by every instance and every thread. Only the connection is per-flow and per-thread.&lt;/p&gt;

&lt;h2&gt;
  
  
  Are you affected?
&lt;/h2&gt;

&lt;p&gt;All four conditions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;django-tenants below 4.0.5;&lt;/li&gt;
&lt;li&gt;a tenant-aware alias besides &lt;code&gt;default&lt;/code&gt;, via &lt;code&gt;TENANT_DB_ALIAS&lt;/code&gt; or the &lt;code&gt;database=&lt;/code&gt; argument;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;schema_context()&lt;/code&gt; or &lt;code&gt;tenant_context()&lt;/code&gt; used on that alias;&lt;/li&gt;
&lt;li&gt;and the &lt;code&gt;default&lt;/code&gt; alias also running &lt;code&gt;django_tenants.postgresql_backend&lt;/code&gt; — if it runs a stock backend, you got the &lt;code&gt;AttributeError&lt;/code&gt; crash instead of the silent leak.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your setup matches, the library side is a 30-second check in a Django shell — your tenant model, two tenants you already have, one context manager:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;django&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;connections&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;django_tenants&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;utils&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;schema_context&lt;/span&gt;

&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Tenant&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;schema_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"tenant-a"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# your tenant model&lt;/span&gt;
&lt;span class="n"&gt;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Tenant&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;schema_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"tenant-z"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;connections&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"default"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_tenant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;connections&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"tenants"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_tenant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;schema_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;schema_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;database&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"tenants"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;connections&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"tenants"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# &amp;lt;4.0.5: A's tenant object -- restored from the default connection&lt;/span&gt;
&lt;span class="c1"&gt;# 4.0.5:   Z's tenant object -- restored from the switched connection&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If it prints the wrong tenant, upgrade; 4.0.5 is the patched release:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;pip show django-tenants &lt;span class="o"&gt;|&lt;/span&gt; grep -i version
pip install --upgrade &lt;span class="s2"&gt;"django-tenants&amp;gt;=4.0.5"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you cannot upgrade yet, the workaround is to not use the context managers on the non-default alias, and switch that connection by hand — which is also exactly what correct code looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;contextlib&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;contextmanager&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;django&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;connections&lt;/span&gt;


&lt;span class="nd"&gt;@contextmanager&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;alias_schema&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;schema_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;alias&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;conn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connections&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;alias&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;previous&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tenant&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_schema&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;schema_name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;yield&lt;/span&gt;
    &lt;span class="k"&gt;finally&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;previous&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_schema_to_public&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_tenant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;previous&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;alias_schema&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"tenant-z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"tenants"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;generate_report&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# snapshot and restore on the same connection&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save from the connection you switch, restore onto the connection you switch — the thing the library has done since 4.0.5.&lt;/p&gt;

&lt;p&gt;While you are checking versions: django-tenants had a hard security season — nine advisories between 2026-10-24 and 2026-11-19, covering SQL injection through unquoted schema names, path traversal via schema names, cross-tenant access through over-long schema names, a cross-tenant template cache collision, tenant deletion and domain takeover, and more. If you run this package anywhere, compare your version against the advisory list, not only against this one.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I took away from it
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;from django.db import connection&lt;/code&gt; is a landmine in any code that knows about database aliases. The name reads as "the connection" and it is actually "the default alias, whatever that is configured as". In &lt;code&gt;django_tenants/utils.py&lt;/code&gt; there were exactly two lines mixing it with &lt;code&gt;connections[self.database]&lt;/code&gt;, and both were the bug. If your project has multi-database code, the audit is one line — every file that imports the module-level proxy and also indexes &lt;code&gt;connections&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;grep -rln &lt;span class="s2"&gt;"connections\["&lt;/span&gt; --include=&lt;span class="s2"&gt;"*.py"&lt;/span&gt; . &lt;span class="o"&gt;|&lt;/span&gt; xargs grep -ln &lt;span class="s2"&gt;"^from django.db import connection"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A context manager is a save/restore pair on one object. The review question is one sentence: does the save read the same object the restore writes? Here the answer was no, for six years, in one of the most-used multi-tenancy packages in the Django world.&lt;/p&gt;

&lt;p&gt;Saved state belongs where the flow lives. Decorator instances are shared by every call, class attributes are shared by every instance and thread, and the failure mode of sharing is that two flows overwrite each other's state — in this case, which tenant to restore. The connection is the one object Django already partitions per thread.&lt;/p&gt;

&lt;p&gt;When a feature generalizes — "the default alias" becomes "any alias" — every line that assumed the old scope needs re-reading, not only the lines the PR touched. The alias PR was reviewed and merged. The snapshot line simply predated the new world, and nobody was told.&lt;/p&gt;

&lt;p&gt;And the missing test is the one that asserts the contract after the exit: state after the block, on the connection that was entered, for every alias. A test like that would have caught this in 2024.&lt;/p&gt;

&lt;p&gt;The disclosure side worked as it should: GitHub private vulnerability reporting, a maintainer who reproduced, fixed, tested and published within days, and credit in the advisory. If you find something like this in a package you depend on, that path is open to you and it costs less time than you think.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/django-tenants/django-tenants/security/advisories/GHSA-q7xr-949m-53qg" rel="noopener noreferrer"&gt;GHSA-q7xr-949m-53qg — Cross-tenant data access via schema_context and tenant_context on non-default database aliases&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/django-tenants/django-tenants/security/advisories/GHSA-8558-24hp-q3wq" rel="noopener noreferrer"&gt;GHSA-8558-24hp-q3wq — Concurrent requests can restore each other's tenant after tenant context managers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/django-tenants/django-tenants/commit/d61199fa06d06feaa1af0ff6524acc74aac1465d" rel="noopener noreferrer"&gt;Fix commit d61199f&lt;/a&gt;, released in 4.0.5 (merge ba251aa, 2026-11-17)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/django-tenants/django-tenants/commit/18b96deed52c95ae8dc2d54fe43348a37adcee19" rel="noopener noreferrer"&gt;Alias support: commit 18b96de, PR #1106 (2024)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/django-tenants/django-tenants/security/advisories" rel="noopener noreferrer"&gt;All django-tenants advisories&lt;/a&gt; — no CVE assigned to this one as of publication&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>cybersecurity</category>
      <category>python</category>
      <category>coding</category>
    </item>
    <item>
      <title>Internxt Drive: the workspace ID that never reached the team being deleted</title>
      <dc:creator>zerox80</dc:creator>
      <pubDate>Mon, 23 Nov 2026 20:56:11 +0000</pubDate>
      <link>https://dev.to/zerox80/the-workspace-id-in-the-url-never-reached-the-team-being-deleted-29hn</link>
      <guid>https://dev.to/zerox80/the-workspace-id-in-the-url-never-reached-the-team-being-deleted-29hn</guid>
      <description>&lt;p&gt;There is a particular kind of bug that only shows up when you read a route and its use case as 2 separate documents. The route authorizes 1 thing. The use case mutates another. Both are correct in isolation.&lt;/p&gt;

&lt;p&gt;C03 was the only finding in the October audit of &lt;code&gt;internxt/drive-server-wip&lt;/code&gt; that got fixed after I escalated to CERT-Bund. It sat in triage from 28 October until 20 November. On that day a maintainer merged PR #1297 with the line "Fixes GHSA-wjmx-m49r-9rrh", published the advisory as Moderate, closed and locked the issue I had been asking questions in, and moved several other advisories at once. I had spent 3 weeks watching commits land on master almost every working day: index cleanups, performance work, client-version policies, a photos bucket, while this one stayed untouched.&lt;/p&gt;

&lt;p&gt;The route is &lt;code&gt;DELETE /workspaces/:workspaceId/teams/:teamId&lt;/code&gt;. Its decorators are explicit about who may call it, and the controller hands the use case only the second of its 2 parameters:&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="nd"&gt;@ApiBearerAuth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nd"&gt;@ApiOkResponse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Deleted team'&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="nd"&gt;@UseGuards&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;WorkspaceGuard&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nd"&gt;@WorkspaceRequiredAccess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;AccessContext&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;WORKSPACE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;WorkspaceRole&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;OWNER&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;deleteTeam&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nd"&gt;@Param&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'teamId'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;ValidateUUIDPipe&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;teamId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;WorkspaceTeamAttributes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&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="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;workspaceUseCases&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deleteTeam&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;teamId&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="nd"&gt;@Post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/teams/:teamId/user/:userUuid'&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;WorkspaceGuard&lt;/code&gt; plus &lt;code&gt;@WorkspaceRequiredAccess(AccessContext.WORKSPACE, WorkspaceRole.OWNER)&lt;/code&gt;. The guard reads the &lt;code&gt;workspaceId&lt;/code&gt; from the URL and checks that the caller is an owner of that workspace. That is a real authorization decision. The problem is what happens to it next: the controller passes only &lt;code&gt;teamId&lt;/code&gt; to the use case. The workspace ID that was just authorized never leaves the controller.&lt;/p&gt;

&lt;p&gt;The use case is 5 lines:&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;async&lt;/span&gt; &lt;span class="nf"&gt;deleteTeam&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;teamId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;WorkspaceTeam&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&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="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="nf"&gt;getAndValidateNonDefaultTeamWorkspace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;teamId&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="kc"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;teamRepository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deleteTeamById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;teamId&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;&lt;code&gt;getAndValidateNonDefaultTeamWorkspace(teamId)&lt;/code&gt; resolves the team by its ID, loads the workspace the team record points at, and validates against that workspace, not against the URL. It also rejects the default team, which is why the helper exists at all. So there are 2 workspaces in play: the guard validates the one in the URL, the validator loads the one the team belongs to, and nothing compares them. &lt;code&gt;deleteTeamById(teamId)&lt;/code&gt; then removes the row. If you own workspace A and know the UUID of a non-default team in workspace B, the A-authorized URL is enough.&lt;/p&gt;

&lt;p&gt;The same pattern showed up in the manager and role-change branches, where &lt;code&gt;findWorkspaceUser&lt;/code&gt; was called with &lt;code&gt;memberId&lt;/code&gt; and &lt;code&gt;deactivated&lt;/code&gt; but no workspace predicate:&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;team&lt;/span&gt; &lt;span class="p"&gt;}&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="nf"&gt;getAndValidateNonDefaultTeamWorkspace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;teamId&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;workspaceUser&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;workspaceRepository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findWorkspaceUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="n"&gt;memberId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;deactivated&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="p"&gt;;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I did not exercise the manager-role branch in the PoC, and I said so in the report. A finding should state exactly what was run and what was only read.&lt;/p&gt;

&lt;p&gt;The workspace domain makes the mistake easy to miss. A workspace has an owner, members, and teams; a team has a manager and members of its own; there is a default team that cannot be deleted. The decorator on the route checks the OWNER role against the workspace named in the URL, so the guard resolves the caller's role correctly. That is why this bug is not simply "no authorization". The authorization exists. It is bound to the wrong object.&lt;/p&gt;

&lt;p&gt;Reading the use case makes the mismatch look almost reasonable, which is what worried me:&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;async&lt;/span&gt; &lt;span class="nf"&gt;getAndValidateNonDefaultTeamWorkspace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;teamId&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;team&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;teamRepository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTeamById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;teamId&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="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;team&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BadRequestException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Team 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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;workspace&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;workspaceRepository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findOne&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;team&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;workspaceId&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;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;workspace&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ForbiddenException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Not valid workspace 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="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;workspace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isDefaultTeam&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;team&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;&lt;code&gt;getAndValidateNonDefaultTeamWorkspace&lt;/code&gt; exists to stop you from deleting the default team, and it does that job well: resolve the team, load its workspace, refuse if this is the default team of that workspace. Every line inside it is defensible. The function was written for a world in which the caller had already been scoped to the right workspace, and the route above it simply never established that. Contracts like that are invisible in a diff review of either file, because neither file contains the mistake. The mistake is the gap between them, and the gap is only visible when you read both in one sitting.&lt;/p&gt;

&lt;p&gt;What tipped me off was not an error message or a failing test. It was the shape of the controller method: 2 path parameters in the URL, one of them used only by decorators. When a &lt;code&gt;:workspaceId&lt;/code&gt; appears in a route and never appears in the method body or the call it makes, that is worth 10 minutes of reading. I opened the use case expecting to find &lt;code&gt;workspaceId&lt;/code&gt; somewhere down the stack. It was not there. The validator resolved a workspace from the team record instead, which is a perfectly sensible thing to do if you assume the team was already scoped, and that assumption is exactly what the guard did not establish.&lt;/p&gt;

&lt;p&gt;This is also why I wrote the PoC with 2 complete workspaces rather than one team with a forged ID. A single workspace would have made the bug invisible: the URL workspace and the team workspace would have been the same object, and the delete would have looked authorised. 2 owners, 2 workspaces, one cross-workspace team ID. The test has to create the disagreement, because the disagreement is the vulnerability.&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'C03: A owner can delete a nondefault team in B through the A workspace URL'&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="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;ownerA&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createTestUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&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;ownerB&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createTestUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&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;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;workspaceFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ownerA&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;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;workspaceFor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ownerB&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;teamB&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;teams&lt;/span&gt;&lt;span class="p"&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="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;v4&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;workspaceId&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;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;managerId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ownerB&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="n"&gt;uuid&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="s1"&gt;'B-local-team'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;any&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;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getHttpServer&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;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`/workspaces/${a.id}/teams/${teamB.id}`&lt;/span&gt;&lt;span class="p"&gt;)&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="s1"&gt;'Authorization'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${ownerA.token}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;expect&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;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;expect&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;teams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findByPk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;teamB&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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBeNull&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;2 assertions:&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="nf"&gt;expect&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;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;expect&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;teams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;findByPk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;teamB&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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBeNull&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;HTTP 200, and the B team row was gone. A 200 is the wrong status code for a delete you were never entitled to, but it is an honest 1: the server had no reason to think anything was missing. The guard had approved workspace A, the validator had approved the team, and nothing in between had ever compared the 2. The request log shows a perfectly ordinary owner deleting a perfectly ordinary team; the fact that the team belonged to someone else's workspace is nowhere in it. That is also what makes this class of bug survive in the wild: there is no error, no alert, no failed request to notice. Just a missing row in a database, and an owner who eventually wonders where their team went.&lt;/p&gt;

&lt;p&gt;For the team's members, the effect would be ordinary in the worst way. A team in this backend groups workspace members with a shared role and a manager; deleting the row dissolves the grouping without touching anyone's files. Nothing is stolen, nothing is read, and the workspace owner's next visit shows a team that simply is not there anymore. No notification is sent for a deletion performed through another workspace's URL, because as far as the code is concerned, no rule was broken. Disappearance without a trace is a peculiar kind of impact to write up: there is nothing to exfiltrate and no confidentiality boundary crossed, and yet the integrity of someone else's workspace structure was modified by a stranger. The Moderate rating on the published advisory is, I think, a fair answer to that.&lt;/p&gt;

&lt;p&gt;Everything ran on commit &lt;code&gt;7d7a8be2&lt;/code&gt; against disposable PostgreSQL and Valkey, with synthetic fixtures and no route to anything else, through the same loopback-only harness as the other 12 findings: a staged test file removed by a &lt;code&gt;trap&lt;/code&gt; on exit, synthetic credentials, SendGrid in sandbox mode, and the &lt;code&gt;127.0.0.1&lt;/code&gt; guard at the top of the PoC's &lt;code&gt;beforeAll&lt;/code&gt;. The 4-line test-only patch for the mock Bridge provider's missing &lt;code&gt;getLimit()&lt;/code&gt; is documented in &lt;a href="https://dev.to/zerox80/reproducing-a-backend-vulnerability-without-touching-production-713"&gt;the harness post&lt;/a&gt;, not with the finding.&lt;/p&gt;

&lt;p&gt;I filed C03 on 28 October as one of the first 3 private advisories, alongside C01 and C02. For the next 3 weeks the repository moved and the advisory did not. On 4 November I offered to open pull requests. On 19 November I asked why nobody was answering. On 20 November the answer arrived as a merge:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gu"&gt;@@ -2568,8 +2570,15 @@ export class WorkspacesUsecases {&lt;/span&gt;
     await this.teamRepository.updateById(team.id, { managerId });
   }

&lt;span class="gd"&gt;-  async deleteTeam(teamId: WorkspaceTeam['id']) {&lt;/span&gt;
&lt;span class="gd"&gt;-    await this.getAndValidateNonDefaultTeamWorkspace(teamId);&lt;/span&gt;
&lt;span class="gi"&gt;+  async deleteTeam(&lt;/span&gt;
&lt;span class="gi"&gt;+    workspaceId: WorkspaceAttributes['id'],&lt;/span&gt;
&lt;span class="gi"&gt;+    teamId: WorkspaceTeam['id'],&lt;/span&gt;
&lt;span class="gi"&gt;+  ) {&lt;/span&gt;
&lt;span class="gi"&gt;+    const { team } = await this.getAndValidateNonDefaultTeamWorkspace(teamId);&lt;/span&gt;
&lt;span class="gi"&gt;+&lt;/span&gt;

&lt;span class="gu"&gt;@@ -2617,7 +2626,7 @@ export class WorkspacesUsecases {&lt;/span&gt;
       this.teamRepository.getTeamUser(userUuid, teamId),
     ]);

&lt;span class="gd"&gt;-    if (!team) {&lt;/span&gt;
&lt;span class="gi"&gt;+    if (team?.workspaceId !== workspaceId) {&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;PR #1297 threads &lt;code&gt;workspaceId&lt;/code&gt; from the route into &lt;code&gt;deleteTeam&lt;/code&gt;, rejects a mismatch with &lt;code&gt;BadRequestException('Team not found')&lt;/code&gt;, scopes &lt;code&gt;findWorkspaceUser&lt;/code&gt; by &lt;code&gt;team.workspaceId&lt;/code&gt; in both the manager and role-change branches, and tightens &lt;code&gt;changeUserRole&lt;/code&gt; with &lt;code&gt;team?.workspaceId !== workspaceId&lt;/code&gt;. It is a careful fix. A code owner approved it, SonarQube reported zero new issues and 88.9% coverage on the new code, and cross-workspace regression tests came with it; one of them constructs a team in another workspace, mocks the repository, and asserts that the role change is refused:&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'When the team belongs to another workspace, then error is thrown and role is not changed'&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="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;team&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;newWorkspaceTeam&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;workspaceId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;v4&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="n"&gt;jest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;spyOn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;teamRepository&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'getTeamById'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mockResolvedValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;team&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="n"&gt;jest&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;spyOn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;teamRepository&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'getTeamUser'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mockResolvedValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;newWorkspaceTeamUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;teamId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;team&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="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;result&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="nf"&gt;changeUserRole&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;v4&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;team&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="s1"&gt;'userId'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;WorkspaceRole&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;MANAGER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whoever picked this up on 20 November did it properly. The 3 weeks before that are the part I have no explanation for, and I would rather say that plainly than invent one.&lt;/p&gt;

&lt;p&gt;That same day also produced everything else at once: the issue was locked to collaborators and closed as completed, C08 was published after 22 days, C09 and C11 were closed without a published fix or a stated reason, and the one-sentence acknowledgement was posted. A queue that had been still for 3 weeks moved 5 things in an afternoon. I would like to be able to say what triggered that, because a researcher holding 11 other findings on a disclosure clock needs to know whether the trigger was an email, a CERT, a sprint, or nothing at all. From the outside it is one indistinguishable event, and the full day is laid out in &lt;a href="https://dev.to/zerox80/3-fixes-in-internxts-drive-backend-1nk6"&gt;the timeline post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One detail about the advisory page itself is worth knowing, because it makes C03 look unfixed to anyone who checks only there. The published advisory still carries the 28 October description: no updated summary, placeholder entries in the version fields, and no mention of the patch. The fix is documented in the pull request and the merge commit, not in the advisory that describes the vulnerability. Cross-check the advisory against &lt;code&gt;master&lt;/code&gt; and the fix is there; read the advisory alone and you could reasonably conclude nothing was ever addressed.&lt;/p&gt;

&lt;p&gt;The part I still cannot explain is the selection. C01 and C02, both rated High, remain in triage without a maintainer response. C09 and C11 were closed on the same 20 November without a published fix or a stated reason. C03, rated Moderate, was the one that got a patch and a published advisory. There may be a completely ordinary reason: a sprint boundary, a ticket someone picked up, a queue finally being read from top to bottom. From the outside it looks arbitrary, and arbitrary is a difficult thing to plan around when you are holding 11 other findings on a disclosure clock.&lt;/p&gt;

&lt;p&gt;I had escalated to CERT-Bund, Germany's national CERT at the BSI, in early November. On 11 November their reading was fair: since some issues had already been fixed, there was no reason to assume the rest would not be. They asked for a status update on 24 November. On 20 November I emailed Internxt a disclosure schedule: 1 December 2026 for the timeline and the fixed issues, 18 January 2027 for full technical details, 90 days after my first email. On the same day, the movement happened. I am not claiming causation. I am describing a sequence, because the sequence is the only data I have.&lt;/p&gt;

&lt;p&gt;The technical rule is short: bind the identifier that was authorized to the row that gets mutated. A guard on the URL is a check on the URL, not on the target. It is the same family as the C07 bug, where a delete ran before an ownership check, and it is the family that IDOR findings have lived in for 20 years. What makes it hard to spot in a NestJS codebase is that the 2 halves look fine in their own files. The controller has guards. The use case has a validator. You have to hold both in your head at once to notice that they are talking about different objects.&lt;/p&gt;

&lt;p&gt;In review, the question that catches this class is not "is there a guard?" but "which object did the guard authorize, and is that the object being changed?". It reads as pedantry until the one time the 2 answers differ. The habit costs a few seconds per route: look at the path parameters, look at what the handler passes downstream, and check that the parameter consumed by authorization is the same parameter that reaches the repository call. In this route it took 1 line, &lt;code&gt;deleteTeam(workspaceId, teamId)&lt;/code&gt; instead of &lt;code&gt;deleteTeam(teamId)&lt;/code&gt;, to make the 2 halves agree, and 1 line in the validator to enforce it. The fix being that small is not a comfort; it is the measurement of how early the mistake should have been caught.&lt;/p&gt;

&lt;p&gt;The other rule is about triage rather than code. A queue that moves 3 weeks late, on the day an issue is locked, and fixes the Moderate finding while 2 High ones stay untouched, gives a researcher nothing to plan with. An acknowledgement, a named contact and a rough timeline would have cost less than the PR. Fixing the code was never the expensive part.&lt;/p&gt;

&lt;p&gt;The disclosure schedule still stands: 1 December 2026 for the timeline and full details of the fixed issues, 18 January 2027 for the remaining findings. I have no evidence this was exploited. The advisory is open, the PoC is attached, and I am happy to verify fixes, including the manager-role branch I did not exercise.&lt;/p&gt;

&lt;p&gt;References: &lt;a href="https://github.com/internxt/drive-server-wip/security/advisories/GHSA-wjmx-m49r-9rrh" rel="noopener noreferrer"&gt;GHSA-wjmx-m49r-9rrh&lt;/a&gt;, &lt;a href="https://github.com/internxt/drive-server-wip/pull/1297" rel="noopener noreferrer"&gt;PR #1297&lt;/a&gt;, &lt;a href="https://github.com/internxt/drive-server-wip/issues/1246" rel="noopener noreferrer"&gt;issue #1246&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>opensource</category>
      <category>nestjs</category>
      <category>authorization</category>
    </item>
    <item>
      <title>Internxt Drive audit: reproducing 13 vulnerabilities without touching production</title>
      <dc:creator>zerox80</dc:creator>
      <pubDate>Mon, 23 Nov 2026 20:55:02 +0000</pubDate>
      <link>https://dev.to/zerox80/reproducing-a-backend-vulnerability-without-touching-production-713</link>
      <guid>https://dev.to/zerox80/reproducing-a-backend-vulnerability-without-touching-production-713</guid>
      <description>&lt;p&gt;13 findings, 13 test files, 13 test logs. That was the most consequential decision in the whole audit, and it had nothing to do with the vulnerabilities.&lt;/p&gt;

&lt;p&gt;When I started reading &lt;code&gt;internxt/drive-server-wip&lt;/code&gt; in October 2026, I made one rule before writing a single assertion: nothing in this project would touch a production system, a real account, or a network service I did not own. The repository is public. The backend is a NestJS application with Sequelize, PostgreSQL, Valkey, a Bridge service for storage credentials, SendGrid for mail, and a fairly large e2e test harness already in the tree. All of that can be pointed at loopback. So every finding would be reproduced against a local checkout of a pinned commit, with synthetic users and disposable services, or it would not be reproduced at all.&lt;/p&gt;

&lt;p&gt;That constraint shaped everything else. A security report is only useful if a maintainer can run it. If reproducing a finding needs a real account, a production dataset, or access to infrastructure the maintainer does not have, the report becomes an anecdote. So each finding got its own self-contained proof of concept, its own log, source references pinned to the audited commit &lt;code&gt;7d7a8be2&lt;/code&gt; from 28 October, and a hash of the archive. A maintainer could run &lt;code&gt;C07&lt;/code&gt; without reading &lt;code&gt;C08&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The first thing to build was the runner:&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;set&lt;/span&gt; -euo pipefail
&lt;span class="nv"&gt;case_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;${2:-}&lt;/span&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="s2"&gt;"$case_id"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;~ ^C&lt;span class="o"&gt;(&lt;/span&gt;0&lt;span class="o"&gt;[&lt;/span&gt;1-9&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;1&lt;span class="o"&gt;[&lt;/span&gt;0-3&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;$ &lt;span class="o"&gt;||&lt;/span&gt; ! -f &lt;span class="s2"&gt;"$source_file"&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="k"&gt;then&lt;/span&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; ! -f package.json &lt;span class="o"&gt;||&lt;/span&gt; ! -x ./node_modules/.bin/jest &lt;span class="o"&gt;||&lt;/span&gt; ! -d test/helpers &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;target&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"test/security-poc-${case_id,,}.e2e-spec.ts"&lt;/span&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; -e &lt;span class="s2"&gt;"$target"&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="k"&gt;then&lt;/span&gt;
cp -- &lt;span class="s2"&gt;"$source_file"&lt;/span&gt; &lt;span class="s2"&gt;"$target"&lt;/span&gt;
&lt;span class="nb"&gt;trap&lt;/span&gt; &lt;span class="s1"&gt;'rm -f -- "$target"'&lt;/span&gt; EXIT
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;NODE_OPTIONS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;--experimental-vm-modules
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;NODE_ENV&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;test&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;RDS_HOSTNAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;127.0.0.1
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;RDS_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;55432
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;RDS_DBNAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;drive_audit
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;RDS_USERNAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;audit
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;RDS_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;local_only_audit_password
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;REDIS_CONNECTION_STRING&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;redis://127.0.0.1:56379
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;REDIS_JOBS_CONNECTION_STRING&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;redis://127.0.0.1:56379
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PCREATED_USERS_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;local_only_precreated_password
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;NOTIFICATIONS_API_ENABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;SENDGRID_MODE_SANDBOX&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;
./node_modules/.bin/jest --config ./test/jest-e2e.json --runInBand \
  --runTestsByPath &lt;span class="s2"&gt;"$target"&lt;/span&gt; --silent --forceExit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It takes a PoC source file and a case ID (&lt;code&gt;C01&lt;/code&gt; through &lt;code&gt;C13&lt;/code&gt;). The first &lt;code&gt;if&lt;/code&gt; rejects a bad ID or a missing file. The second refuses to run outside a checked-out repository with dependencies installed and a &lt;code&gt;test/helpers&lt;/code&gt; directory. Then it refuses to overwrite an existing test file, copies the PoC to &lt;code&gt;test/security-poc-&amp;lt;case&amp;gt;.e2e-spec.ts&lt;/code&gt;, and installs a &lt;code&gt;trap&lt;/code&gt; that removes it again on &lt;code&gt;EXIT&lt;/code&gt;. Every connection string is loopback: PostgreSQL on 55432 with TLS, Valkey on 56379. Every credential is synthetic and written into the report. &lt;code&gt;NOTIFICATIONS_API_ENABLED=false&lt;/code&gt; and &lt;code&gt;SENDGRID_MODE_SANDBOX=true&lt;/code&gt; exist so that no mail can leave the process even if a test path reaches the mailer by accident.&lt;/p&gt;

&lt;p&gt;That &lt;code&gt;trap&lt;/code&gt; line matters more than it looks. A PoC that leaves files behind changes the repository it claims to be testing. A PoC that overwrites an existing test can destroy evidence. A runner that happily executes against a non-loopback host turns a defensive test into something else entirely. These are small lines, and they are the difference between a reproducible report and a claim.&lt;/p&gt;

&lt;p&gt;The installation step was equally deliberate, so that installing dependencies does not execute arbitrary package scripts or phone home, and 13 separate cases never share database state:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm ci --ignore-scripts --no-audit --no-fund
./node_modules/.bin/jest --config ./test/jest-e2e.json --runInBand \
  --runTestsByPath &lt;span class="s2"&gt;"$target"&lt;/span&gt; --silent --forceExit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--runInBand&lt;/code&gt; because a leaked handle should not hang a report; &lt;code&gt;--silent --forceExit&lt;/code&gt; because the log should be readable in one sitting.&lt;/p&gt;

&lt;p&gt;Why HTTP-level e2e tests rather than unit tests against the service classes? Because 2 of the 3 most interesting findings were invisible at the unit level. C07's broken behaviour was a side effect that happened &lt;em&gt;before&lt;/em&gt; the method threw; a mocked repository would have shown the delete and the 403 as 2 independent, "correct" facts. C08 was a timing property: a token blacklisted for 120 milliseconds and re-accepted 350 milliseconds later can only be observed by sending real requests against a real cache, with a clock in the test. The repository already had an e2e harness, since &lt;code&gt;createTestApp&lt;/code&gt; builds the actual Nest application with the actual modules and a mocked Bridge provider, so the honest reproduction used it:&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;export&lt;/span&gt; &lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;CreateTestAppOptions&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;enableAuthGuard&lt;/span&gt;&lt;span class="o"&gt;?:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;enableValidationPipe&lt;/span&gt;&lt;span class="o"&gt;?:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;enableTransformInterceptor&lt;/span&gt;&lt;span class="o"&gt;?:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;enableExtendedQueryParser&lt;/span&gt;&lt;span class="o"&gt;?:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;createTestApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;CreateTestAppOptions&lt;/span&gt; &lt;span class="o"&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="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;NestExpressApplication&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="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;enableAuthGuard&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;enableValidationPipe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;enableTransformInterceptor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;enableExtendedQueryParser&lt;/span&gt; &lt;span class="o"&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="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;options&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;moduleFixture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;TestingModule&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nc"&gt;Test&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createTestingModule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;AppModule&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;The application that comes up is not a stub. Real controllers, real guards, real Sequelize models against the disposable database, real Redis client against the disposable Valkey; only the Bridge, the external storage credential service, is mocked, because it would otherwise want to talk to infrastructure nobody should give a test. That decision matters for what a PoC can honestly claim. A mocked guard would have proven nothing about the guard. The point of running the whole stack locally was that every 403 and every 200 in the logs was produced by the same code that would produce it in production, with only the data and the network being synthetic.&lt;/p&gt;

&lt;p&gt;Getting there was not free. The first PoC failed because a migration had not run against the disposable database; the second because the test configuration expected Valkey on a hostname that only exists inside the repository's docker-compose network, which is why the runner pins &lt;code&gt;REDIS_CONNECTION_STRING&lt;/code&gt; to &lt;code&gt;127.0.0.1:56379&lt;/code&gt; explicitly; the third because the mock Bridge provider was missing &lt;code&gt;getLimit()&lt;/code&gt; and the application refused to finish booting. None of these failures said anything about the vulnerabilities. All of them had to be solved before a single finding could be demonstrated, and all of them produced changes that made the harness better rather than special-casing a single test. That is the actual work of building a reproduction, and it is invisible in the final one-pass log: the PoC that ships in the report is the fourth draft of a file whose first 3 drafts failed for reasons that had nothing to do with the bug.&lt;/p&gt;

&lt;p&gt;1 thing was missing on the audited commit. The mock Bridge provider has no &lt;code&gt;getLimit()&lt;/code&gt;, but the application calls it during setup. I added it with a patch and documented it separately from every finding:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gu"&gt;diff --git a/test/helpers/test-app.helper.ts b/test/helpers/test-app.helper.ts&lt;/span&gt;
index c721448..a099f94 100644
&lt;span class="gu"&gt;@@ -23,6 +23,10 @@ class MockBridgeService {&lt;/span&gt;
&lt;span class="gi"&gt;+  async getLimit() {&lt;/span&gt;
&lt;span class="gi"&gt;+    return 1_000_000_000;&lt;/span&gt;
&lt;span class="gi"&gt;+  }&lt;/span&gt;
   async deleteFile() {
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It changes test code only. It does not remediate a vulnerability. I wrote that sentence into all 13 reports on purpose, because a reviewer should never have to wonder whether the PoC quietly fixed the bug it claims to demonstrate. A test-only compatibility shim that is clearly labelled is boring. An unlabelled one is a reason to distrust the whole package.&lt;/p&gt;

&lt;p&gt;Each PoC repeated the boundary check at the top of its &lt;code&gt;beforeAll&lt;/code&gt;:&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;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;RDS_HOSTNAME&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="s1"&gt;'127.0.0.1'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;REDIS_CONNECTION_STRING&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'127.0.0.1'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&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;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'PoC requires loopback PostgreSQL and Redis'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createTestApp&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;let&lt;/span&gt; &lt;span class="n"&gt;sharings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nc"&gt;SharingModel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;invites&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nc"&gt;SharingInviteModel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;roles&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nc"&gt;RoleModel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;workspaces&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nc"&gt;WorkspaceModel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;workspaceInvites&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nc"&gt;WorkspaceInviteModel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;teams&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nc"&gt;WorkspaceTeamModel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nc"&gt;WorkspaceUserModel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;teamMembers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nc"&gt;WorkspaceTeamUserModel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;preCreatedUsers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nc"&gt;PreCreatedUserModel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nc"&gt;UserModel&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nf"&gt;beforeAll&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="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If &lt;code&gt;RDS_HOSTNAME&lt;/code&gt; is not &lt;code&gt;127.0.0.1&lt;/code&gt;, or the Redis connection string does not point at loopback, the test throws before a single fixture is created. That guard is part of the evidence. It turns "no production system was touched" from a promise into a checked condition that a maintainer can read and verify. Synthetic users come from &lt;code&gt;createTestUser&lt;/code&gt;, folders are created directly through the model, keys are literal strings like &lt;code&gt;local-key&lt;/code&gt;, and the database is called &lt;code&gt;drive_audit&lt;/code&gt; with a user named &lt;code&gt;audit&lt;/code&gt;. Anyone reading the log can see there is no real data in it.&lt;/p&gt;

&lt;p&gt;The reason for 13 separate files rather than one suite was state. A shared suite accumulates it: one case leaves a user, a token, a sharing row, an invite, a workspace team behind, and the next case inherits that state. Then a passing test proves something about the previous test rather than about the vulnerability. Separate runs make each result attributable and each log short enough to read in a sitting. The cost is a lot of duplicated setup code: the same 20 imports, the same &lt;code&gt;beforeAll&lt;/code&gt;, the same &lt;code&gt;createTestUser&lt;/code&gt; calls appear in every file. That duplication is cheaper than ambiguity when the report is handed to someone who has never seen the codebase.&lt;/p&gt;

&lt;p&gt;It also made the reports easier to write. Each one could say: here is the file, here is the commit, here is the command, here is the observed result, here is what was not tested. For the C07 case, the observed result was 3 assertions:&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="nf"&gt;expect&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;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toBe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;403&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;expect&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;sharings&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;count&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;itemId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'private'&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="nf"&gt;toBe&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="nf"&gt;expect&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;invites&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;count&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;itemId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&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="nf"&gt;toBe&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For C08 it was 200, 401, 200 after a 350-millisecond wait. For C03 it was 200 and a missing row. Nothing in the reports claims an impact that the test did not measure.&lt;/p&gt;

&lt;p&gt;The structure of each report followed from that: a summary stating the observed behaviour and the revision it was reproduced on; a details section with affected code, observed behaviour, suggested remediation, and an explicit scope paragraph; the PoC source and the test-only patch, clearly separated; the runner settings; the observed local result; and a limitations section. The same shape 13 times, so a maintainer reading the 8th report already knows where everything is. Repetition in the wrapper is not a flaw; it is what makes the package skimmable.&lt;/p&gt;

&lt;p&gt;The hash of the archive was the last piece, and it exists for an unglamorous reason. A report of this size travels as a zip, and zips get re-downloaded, forwarded, and rebuilt. A SHA-256 on the cover email means the person who eventually reads it can confirm they are reading what I sent, not a version that lost a file or gained an edit somewhere in the chain. It costs 1 line and closes a whole class of "are we looking at the same thing" arguments before they start.&lt;/p&gt;

&lt;p&gt;None of this was fast. Reading the sharing module, the auth module and the workspace module properly took the better part of 2 weekends; building and debugging the harness took another; writing 13 reports that each stand on their own took longer than finding the bugs. That ratio is normal and worth saying out loud, because the visible part of security research is the finding and the invisible part is everything that makes the finding believable. Anyone can claim a bug exists. The work is in making the claim cheap to verify.&lt;/p&gt;

&lt;p&gt;The hardest part of the whole audit was not the code. It was writing down what a passing local test does not prove. A PoC establishes that a code path behaved as described on the checked commit. It says nothing about production reachability, deployment topology, log access, network position, certificate distribution, or whether the behaviour was ever exploited. Those answers belong to the maintainer, and no amount of local testing can produce them. Every report carried that boundary once, at the top, instead of a Severity section padded with speculation. That discipline is also why the reports went out privately: the tests were built to be reproducible, not to be published before a fix existed.&lt;/p&gt;

&lt;p&gt;There is a tension in that discipline worth naming. A PoC that is too cautious proves nothing and wastes everyone's time; a PoC that reaches too far proves things that were never tested. The line I settled on: reproduce the code path exactly as a caller would reach it, claim exactly what the log shows, and stop there. No "an attacker could pivot to", no hypothetical chains, no severity theatre. The dryness is deliberate. A report that says "these 3 assertions failed in this order on this commit" is one a maintainer can act on in an afternoon, and one I can defend line by line a month later against every question of whether the finding was real.&lt;/p&gt;

&lt;p&gt;On 28 October the archive went to &lt;a href="mailto:hello@internxt.com"&gt;hello@internxt.com&lt;/a&gt; and &lt;a href="mailto:security@internxt.com"&gt;security@internxt.com&lt;/a&gt;: 13 findings, 13 PoCs, 13 test logs, source references, a hash. Getting a confidential channel to send it to had taken 8 days and an escalation to a national CERT. The technical work, by contrast, had gone almost exactly to plan. That asymmetry is the part of this story I still find strange. Building a harness that cannot hurt anyone took a weekend of careful, boring decisions. Getting an acknowledgement from the company took a month.&lt;/p&gt;

&lt;p&gt;If you take 1 thing from this, take the &lt;code&gt;trap&lt;/code&gt; line. A reproduction that cleans up after itself, refuses to run in the wrong environment, and states its own limits is worth more than a dramatic proof of concept. The rest of the audit (the disclosure timeline, the advisories that were published, the ones that were closed, the ones still in triage) is written up in &lt;a href="https://dev.to/zerox80/3-fixes-in-internxts-drive-backend-1nk6"&gt;the timeline post&lt;/a&gt;. This post is only about the part that worked.&lt;/p&gt;

</description>
      <category>security</category>
      <category>opensource</category>
      <category>testing</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Internxt Drive: 34 days, 13 security reports, 3 publicly documented fixes</title>
      <dc:creator>zerox80</dc:creator>
      <pubDate>Mon, 23 Nov 2026 20:53:56 +0000</pubDate>
      <link>https://dev.to/zerox80/three-fixes-in-internxts-drive-backend-1nk6</link>
      <guid>https://dev.to/zerox80/three-fixes-in-internxts-drive-backend-1nk6</guid>
      <description>&lt;p&gt;On 20 October 2026 I emailed Internxt to ask where I could privately report a security issue in their backend. I got an auto-reply. 42 days later, 3 of the 13 findings I eventually sent are fixed and have published advisories, 2 are in triage, 2 were closed without a published fix or a stated reason, and 6 never received an advisory at all. This is the timeline, because the timeline is the part that is hard to explain.&lt;/p&gt;

&lt;p&gt;All of this came from a local checkout of the public &lt;code&gt;internxt/drive-server-wip&lt;/code&gt; repository, synthetic data and disposable PostgreSQL and Valkey instances. No production system and no real account was touched. Whether each issue is reachable in production, and how bad it is there, is something only Internxt can confirm. They have not. Technical details for the findings that are still open stay private under the disclosure schedule: 1 December 2026 for the timeline and full details of the fixed issues, 18 January 2027 for the rest, 90 days after my first email.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting a channel
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;What happened&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;20 Oct&lt;/td&gt;
&lt;td&gt;Email to &lt;a href="mailto:hello@internxt.com"&gt;hello@internxt.com&lt;/a&gt; asking for a private security channel. Auto-reply.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;24 Oct&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://github.com/internxt/drive-server-wip/issues/1246" rel="noopener noreferrer"&gt;Issue #1246&lt;/a&gt; asks the same thing, no technical details.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;26 Oct&lt;/td&gt;
&lt;td&gt;Follow-up email. Another auto-reply.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;28 Oct&lt;/td&gt;
&lt;td&gt;Support: "leave a comment on the GitHub page and the developers will check." I decline and say I will escalate to a national CERT.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;28 Oct&lt;/td&gt;
&lt;td&gt;Private vulnerability reporting is enabled. Full package (C01–C13) sent to hello@ and &lt;a href="mailto:security@"&gt;security@&lt;/a&gt;. Advisories for C01–C03 filed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;29 Oct&lt;/td&gt;
&lt;td&gt;"I will pass this to the necessary team members." Last substantive reply.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;29 Oct&lt;/td&gt;
&lt;td&gt;Fixes for C07 and C08 land on master. Advisories for both filed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3 Nov&lt;/td&gt;
&lt;td&gt;Advisories for C09 and C11 filed. Email asking for a coordinating contact. No reply.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4 Nov&lt;/td&gt;
&lt;td&gt;Offer to open PRs in the issue. No reply.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5–6 Nov&lt;/td&gt;
&lt;td&gt;Case submitted to CERT-Bund (BSI).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9 Nov&lt;/td&gt;
&lt;td&gt;Internxt publishes the C07 advisory as Low without telling me.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;11 Nov&lt;/td&gt;
&lt;td&gt;CERT-Bund: since some issues were already fixed, no reason to assume the rest would not be.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;17 Nov&lt;/td&gt;
&lt;td&gt;CERT-Bund asks for a status update on 24 Nov.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;19 Nov&lt;/td&gt;
&lt;td&gt;"Why does noone answer? Why all that silent? All my findings are all valid." No reply.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20 Nov&lt;/td&gt;
&lt;td&gt;Disclosure schedule emailed to security@ and hello@.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;20 Nov&lt;/td&gt;
&lt;td&gt;Issue closed and locked. C08 published (High), C03 fixed and published (Moderate), C09 and C11 closed.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1 Dec&lt;/td&gt;
&lt;td&gt;This post.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;18 Jan 2027&lt;/td&gt;
&lt;td&gt;Full technical details for all remaining findings, fixed or not.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The suggestion on 28 October deserves to be quoted exactly, because it is the sentence that made the rest of this necessary: support told me I could &lt;em&gt;"leave a comment on the GitHub page and the developers will check."&lt;/em&gt; A public GitHub issue, visible to everyone, for security vulnerabilities, at a company that sells end-to-end encrypted, zero-knowledge cloud storage. I had already spent 8 days trying to report an authorization issue. I declined, said I would escalate to a national CERT, and within the hour support offered to forward the report themselves. Later that day a maintainer switched on GitHub's private vulnerability reporting for the repository. That part worked.&lt;/p&gt;

&lt;p&gt;The package went out that afternoon: 13 findings, a self-contained PoC and test log for each, source references pinned to commit &lt;code&gt;7d7a8be2&lt;/code&gt;, and a hash of the archive. It went to hello@ and to &lt;a href="mailto:security@internxt.com"&gt;security@internxt.com&lt;/a&gt;, the address in the repository's own &lt;code&gt;SECURITY.md&lt;/code&gt;. The next morning support wrote "I will pass this to the necessary team members." That was the last thing Internxt told me about my report for 3 weeks.&lt;/p&gt;

&lt;h2&gt;
  
  
  3 fixes
&lt;/h2&gt;

&lt;p&gt;2 landed on 29 October, 1 day after the report. Both came with regression tests, and credit where it is due: that is fast.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;C07&lt;/strong&gt;: &lt;code&gt;createPublicSharing&lt;/code&gt; deleted private shares and pending invites for an item before checking &lt;code&gt;item.isOwnedBy(user)&lt;/code&gt;. A non-owner's request returned 403, but the rows were already gone and no transaction rolled them back. The fix in &lt;code&gt;d1f51c9&lt;/code&gt; removes the delete from both public-share and invite creation and adds an HTTP test that a 403 has no side effects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gu"&gt;@@ -1163,16 +1163,6 @@ export class SharingService {&lt;/span&gt;
       throw new BadRequestException('Limit for sharing an item reach');
     }

&lt;span class="gd"&gt;-    const shouldRemoveOtherSharings = !createInviteDto.persistPreviousSharing;&lt;/span&gt;
&lt;span class="gd"&gt;-&lt;/span&gt;
&lt;span class="gd"&gt;-    if (shouldRemoveOtherSharings) {&lt;/span&gt;
&lt;span class="gd"&gt;-      await this.removeItemFromBeingShared(&lt;/span&gt;
&lt;span class="gd"&gt;-        createInviteDto.itemType,&lt;/span&gt;
&lt;span class="gd"&gt;-        createInviteDto.itemId,&lt;/span&gt;
&lt;span class="gd"&gt;-        SharingType.Public,&lt;/span&gt;
&lt;span class="gd"&gt;-      );&lt;/span&gt;
&lt;span class="gd"&gt;-    }&lt;/span&gt;
&lt;span class="gd"&gt;-&lt;/span&gt;
     const createdInvite = await this.sharingRepository.createInvite(invite);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;C08&lt;/strong&gt;: logout computed &lt;code&gt;exp - now&lt;/code&gt; in seconds and passed it to a cache blacklist TTL that expects milliseconds:&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;async&lt;/span&gt; &lt;span class="nf"&gt;logout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jwt&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;tokenClaims&lt;/span&gt; &lt;span class="o"&gt;=&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;jwtService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;jwt&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="n"&gt;tokenClaims&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jti&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;currentTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;1000&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;ttl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tokenClaims&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exp&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;currentTime&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="n"&gt;ttl&lt;/span&gt; &lt;span class="o"&gt;&amp;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;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;cacheManagerService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blacklistJwt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="n"&gt;tokenClaims&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;jti&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="n"&gt;ttl&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="no"&gt;JWT_7DAYS_EXPIRATION&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;A token with 2 minutes left was blacklisted for 120 ms and accepted again about 350 ms later. &lt;code&gt;6a7801c&lt;/code&gt; adds &lt;code&gt;Time.secondsToMs&lt;/code&gt;, names the parameter &lt;code&gt;ttlMs&lt;/code&gt;, and adds an e2e test that compares Redis &lt;code&gt;pTTL&lt;/code&gt; with the token's remaining lifetime:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gu"&gt;@@ -1,7 +1,7 @@&lt;/span&gt;
 import { JwtService } from '@nestjs/jwt';
 import { CacheManagerService } from '../cache-manager/cache-manager.service';
 import { Injectable } from '@nestjs/common';
&lt;span class="gd"&gt;-import { JWT_7DAYS_EXPIRATION } from './constants';&lt;/span&gt;
&lt;span class="gi"&gt;+import { Time } from '../../lib/time';&lt;/span&gt;

 @Injectable()
 export class AuthUsecases {
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;C03&lt;/strong&gt;: a workspace route authorized the URL's &lt;code&gt;workspaceId&lt;/code&gt; through &lt;code&gt;WorkspaceGuard&lt;/code&gt; and &lt;code&gt;WorkspaceRequiredAccess&lt;/code&gt;, then passed only &lt;code&gt;teamId&lt;/code&gt; to the use case, which resolved the team and deleted it without comparing its workspace. An owner of workspace A could delete a team in workspace B. PR #1297, merged and published on 20 November, threads the workspace ID through and rejects a mismatch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gu"&gt;@@ -2568,8 +2570,15 @@ export class WorkspacesUsecases {&lt;/span&gt;
     await this.teamRepository.updateById(team.id, { managerId });
   }

&lt;span class="gd"&gt;-  async deleteTeam(teamId: WorkspaceTeam['id']) {&lt;/span&gt;
&lt;span class="gd"&gt;-    await this.getAndValidateNonDefaultTeamWorkspace(teamId);&lt;/span&gt;
&lt;span class="gi"&gt;+  async deleteTeam(&lt;/span&gt;
&lt;span class="gi"&gt;+    workspaceId: WorkspaceAttributes['id'],&lt;/span&gt;
&lt;span class="gi"&gt;+    teamId: WorkspaceTeam['id'],&lt;/span&gt;
&lt;span class="gi"&gt;+  ) {&lt;/span&gt;
&lt;span class="gi"&gt;+    const { team } = await this.getAndValidateNonDefaultTeamWorkspace(teamId);&lt;/span&gt;
&lt;span class="gi"&gt;+&lt;/span&gt;
&lt;span class="gi"&gt;+    if (team.workspaceId !== workspaceId) {&lt;/span&gt;
&lt;span class="gi"&gt;+      throw new BadRequestException('Team not found');&lt;/span&gt;
&lt;span class="gi"&gt;+    }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Advisory&lt;/th&gt;
&lt;th&gt;Severity&lt;/th&gt;
&lt;th&gt;Fixed&lt;/th&gt;
&lt;th&gt;Published&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;C07&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/internxt/drive-server-wip/security/advisories/GHSA-8734-26fx-fg92" rel="noopener noreferrer"&gt;GHSA-8734-26fx-fg92&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Low (2.3)&lt;/td&gt;
&lt;td&gt;2026-10-29 &lt;code&gt;d1f51c9&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;2026-11-09&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C08&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/internxt/drive-server-wip/security/advisories/GHSA-mv5w-7wrf-r458" rel="noopener noreferrer"&gt;GHSA-mv5w-7wrf-r458&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;2026-10-29 &lt;code&gt;6a7801c&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;2026-11-20&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C03&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/internxt/drive-server-wip/security/advisories/GHSA-wjmx-m49r-9rrh" rel="noopener noreferrer"&gt;GHSA-wjmx-m49r-9rrh&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;2026-11-20 PR #1297&lt;/td&gt;
&lt;td&gt;2026-11-20&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each fix also came with a regression test, which is the part that keeps a small patch from quietly returning. The C07 test checks the 403 and, more importantly, what the 403 leaves behind:&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'When the owner creates it, then it returns the public sharing'&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="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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/sharings'&lt;/span&gt;&lt;span class="p"&gt;)&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="s1"&gt;'Authorization'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${owner.token}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;buildDto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;HttpStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;CREATED&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toMatchObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'When a user who is not the owner tries to create it, then it fails'&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="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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/sharings'&lt;/span&gt;&lt;span class="p"&gt;)&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="s1"&gt;'Authorization'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${otherUser.token}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;buildDto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;folder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uuid&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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;HttpStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;FORBIDDEN&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'When the item does not exist, then it fails'&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="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="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/sharings'&lt;/span&gt;&lt;span class="p"&gt;)&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="s1"&gt;'Authorization'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${owner.token}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;buildDto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;v4&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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;HttpStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;NOT_FOUND&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 C08 test connects to Redis and reads the blacklist key's remaining TTL, because that is the only way to observe the unit from outside the process:&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="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Logout'&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;redisClient&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;RedisClientType&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;loginAndGetToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&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="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;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;registrationData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;generateValidRegistrationData&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="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;registerUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;registrationData&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;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getHttpServer&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="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/auth/login/access'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;password&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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;HttpStatus&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;OK&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;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;newToken&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 C03 test constructs a team in another workspace and asserts that the role change is refused:&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'When the team belongs to another workspace, then error is thrown and role is not changed'&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="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;team&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;newWorkspaceTeam&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;workspaceId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;v4&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="n"&gt;jest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;spyOn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;teamRepository&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'getTeamById'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mockResolvedValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;team&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="n"&gt;jest&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;spyOn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;teamRepository&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'getTeamUser'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mockResolvedValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;newWorkspaceTeamUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;teamId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;team&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="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;result&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="nf"&gt;changeUserRole&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;v4&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;team&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="s1"&gt;'userId'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;WorkspaceRole&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;MANAGER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;None of the 3 bugs is a missing cryptographic check. They are an ordering mistake, a unit mistake, and an authorized identifier that never reached the repository call. Small patches. Each needed a regression test to stay fixed, and each got one.&lt;/p&gt;

&lt;h2&gt;
  
  
  What did not move
&lt;/h2&gt;

&lt;p&gt;On 9 November Internxt published the C07 advisory themselves and rated it Low, CVSS 2.3 (&lt;code&gt;AV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N&lt;/code&gt;). Nobody told me. C08, fixed the same day, stayed unpublished for 22 days. I asked about the other fixed advisory in the issue on 29 October and again on 4 November. On 19 November I asked why nobody was answering. On 20 November the issue was closed and locked to collaborators, and a maintainer wrote:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/zerox80"&gt;@zerox80&lt;/a&gt; we've received your report and the advisories with you as reporter will be published as they get fixed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is the only substantive sentence I received after 29 October. It arrived on the same day C08 was finally published with my name added as Reporter, C03 was fixed and published, and C09 and C11 were closed without a published fix or a stated reason. I had asked in C09 whether those were false positives or planned for a later sprint:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Is that issue a false positive? Or do u plan to fix those u closed in the next sprints? Thanks a lot for the one u published today!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There was no reply. C01 and C02, both rated High, remain in triage with no maintainer response. C04–C06, C10, C12 and C13 never received an advisory at all. Meanwhile the repository received dozens of commits, nearly every working day: index cleanups, performance work, client-version policies, a photos bucket, network token scoping. The repository remained actively maintained. However, I received no substantive status update regarding the remaining findings.&lt;/p&gt;

&lt;p&gt;The credits tell the same story in miniature. On C07, published from my draft, the reporter credit was accepted. On C08, published from a maintainer-created advisory 22 days after the fix, a credit was added without acceptance and without a word to me. On C09 and C11, closed advisories, the credits sit attached to findings that were never published and never explained. I do not think anyone at Internxt sat down and decided to be difficult about attribution. I think nobody was reading the queue, and every inconsistency in it is a fossil of that. On GitHub all 8 advisories now carry the note "This report was submitted with AI assistance", worth keeping in mind when you read the surrounding discussion, and worth taking seriously as a disclosure policy question in its own right. The evidence in each report is the PoC and the test log, which is exactly why every one of them was built to run rather than to be believed.&lt;/p&gt;

&lt;p&gt;I took the case to CERT-Bund, Germany's national CERT at the BSI, in early November. Their view on 11 November was reasonable: since some issues had already been fixed, there was no reason to assume the rest would not be. They asked me to report back on 24 November. On 20 November I emailed Internxt and passed on a disclosure schedule (this post on 1 December, full technical details on 18 January 2027) in case the GitHub notifications simply were not reaching anyone. I am not claiming the escalation caused the movement on 20 November. I am describing a sequence, because the sequence is the only data I have.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this is a security problem
&lt;/h2&gt;

&lt;p&gt;In 2026, attackers use AI to find, understand and weaponize bugs faster than ever. The window between a bug sitting in a public repository and someone exploiting it keeps getting shorter. Every week a report sits unread in a triage queue is a week in which someone else can find the same line of code, and that person will not send an email first. Internxt's backend is open source, and anyone can read it. That is a strength, but only if the company behind it actually works through the reports it gets for free.&lt;/p&gt;

&lt;p&gt;People who do this work write PoCs, document what they did and did not test, and keep details private to protect users, exactly as the rules ask. In return they expect the bare minimum: an acknowledgement, a contact person and a rough timeline. When even that does not happen, the message is clear: do not bother. Some researchers will stop reporting. Others will stop being careful. Neither makes anyone safer.&lt;/p&gt;

&lt;p&gt;That is what makes this worse coming from Internxt. A company that markets itself on privacy, security and zero-knowledge encryption should be held to a higher standard, not a lower one. Security is not a landing page. It is how you respond when someone tells you something is broken. I have reported vulnerabilities to other projects before, including critical ones, and most of them answered within days. This is the worst disclosure experience I have had so far.&lt;/p&gt;

&lt;p&gt;The fix on the process side is not complicated: a security inbox someone actually reads, an acknowledgement within a few days, 1 named contact, and a timeline. You do not need 40 meetings for that.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens next
&lt;/h2&gt;

&lt;p&gt;I would much rather have published this alongside fixes, but disclosure deadlines exist so that silence cannot go on forever. The schedule gives Internxt 7 more weeks. If you use Internxt, none of this requires anything from you, and I have no evidence that any of it was exploited. You might still want to ask them for an answer yourself.&lt;/p&gt;

&lt;p&gt;Everything in this post is checkable without trusting me. The 3 advisories are public pages with their CVSS vectors and credits; the 3 fixes are public commits and a public pull request on a public repository; the timeline is a public issue with dates on every comment; the C07 rating of Low and the C08 rating of High are on the advisory pages, next to the CWE classifications. The only parts not published are the technical details of the still-open findings, and those are withheld on purpose: they go out on 18 January 2027, or earlier if Internxt fixes them and publishes. A disclosure timeline that a reader cannot verify is just a story; this one comes with links to every event it claims.&lt;/p&gt;

&lt;p&gt;This post is the overview of a small series. &lt;a href="https://dev.to/zerox80/the-workspace-id-in-the-url-never-reached-the-team-being-deleted-29hn"&gt;The workspace ID that never reached the team&lt;/a&gt; is the story of the only finding fixed after the CERT escalation, and &lt;a href="https://dev.to/zerox80/reproducing-a-backend-vulnerability-without-touching-production-713"&gt;reproducing a backend vulnerability without touching production&lt;/a&gt; documents the harness behind all 13 PoCs. Write-ups of C07 and C08 complete the series.&lt;/p&gt;

&lt;p&gt;And Internxt: my offer still stands. The advisories are open, the PoCs are attached, and I am happy to verify your fixes, including the branches I did not exercise.&lt;/p&gt;

</description>
      <category>security</category>
      <category>opensource</category>
      <category>disclosure</category>
      <category>nestjs</category>
    </item>
    <item>
      <title>A missing `if` let remote input bypass Android's keyboard permission in RustDesk</title>
      <dc:creator>zerox80</dc:creator>
      <pubDate>Sat, 14 Nov 2026 23:47:32 +0000</pubDate>
      <link>https://dev.to/zerox80/a-missing-if-let-remote-input-bypass-androids-keyboard-permission-in-rustdesk-c44</link>
      <guid>https://dev.to/zerox80/a-missing-if-let-remote-input-bypass-androids-keyboard-permission-in-rustdesk-c44</guid>
      <description>&lt;p&gt;One &lt;code&gt;if&lt;/code&gt; statement existed on Windows, macOS and Linux. It was missing on Android.&lt;/p&gt;

&lt;p&gt;That is the whole bug. It let a remote peer keep typing and clicking on an Android&lt;br&gt;
device after its keyboard permission had been explicitly revoked. I found it in&lt;br&gt;
RustDesk 1.5.3, reproduced it on an API 35 emulator, and the upstream fix is now&lt;br&gt;
public as &lt;a href="https://github.com/rustdesk/rustdesk/pull/17061" rel="noopener noreferrer"&gt;rustdesk/rustdesk#17061&lt;/a&gt;.&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%2Fmqw0yovd10m9zvx3telc.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%2Fmqw0yovd10m9zvx3telc.png" alt="Cover: RustDesk Android input bypass" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  First, what "keyboard permission" actually means
&lt;/h2&gt;

&lt;p&gt;This is the part that trips people up, so let's be precise. It is &lt;strong&gt;not&lt;/strong&gt; about&lt;br&gt;
whether the Android device has a keyboard. Gboard still works for the person&lt;br&gt;
holding the phone.&lt;/p&gt;

&lt;p&gt;RustDesk sessions carry per-capability flags. The relevant one is:&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;// src/server/connection.rs:2344-2346&lt;/span&gt;
&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;peer_keyboard_enabled&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nb"&gt;self&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="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;keyboard&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="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;disable_keyboard&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;self.keyboard&lt;/code&gt; is set to &lt;code&gt;false&lt;/code&gt; for limited sessions (file transfer, terminal,&lt;br&gt;
view-camera). &lt;code&gt;self.disable_keyboard&lt;/code&gt; comes from a server-pushed policy option&lt;br&gt;
(&lt;code&gt;option.disable_keyboard = Yes&lt;/code&gt;). In both cases the peer is &lt;strong&gt;still connected and&lt;br&gt;
still authorized&lt;/strong&gt; — it has simply been told, via&lt;br&gt;
&lt;code&gt;send_permission(Permission::Keyboard, false)&lt;/code&gt;, that it may not send input.&lt;/p&gt;

&lt;p&gt;So the peer is not "disconnected". It is connected, but the receiving side is&lt;br&gt;
supposed to drop its &lt;code&gt;KeyEvent&lt;/code&gt;, &lt;code&gt;MouseEvent&lt;/code&gt; and &lt;code&gt;PointerDeviceEvent&lt;/code&gt; messages.&lt;br&gt;
On desktop, it does.&lt;/p&gt;
&lt;h2&gt;
  
  
  The asymmetry
&lt;/h2&gt;

&lt;p&gt;Here is the desktop &lt;code&gt;MouseEvent&lt;/code&gt; arm:&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;// src/server/connection.rs:3205-3206&lt;/span&gt;
&lt;span class="cp"&gt;#[cfg(not(any(target_os = "android", target_os = "ios")))]&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;peer_keyboard_enabled&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="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;input_mouse&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;p&gt;And here is the Android arm of the same &lt;code&gt;match&lt;/code&gt;:&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;// src/server/connection.rs:3201-3204&lt;/span&gt;
&lt;span class="cp"&gt;#[cfg(any(target_os = "android", target_os = "ios"))]&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="kc"&gt;Err&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;call_main_service_pointer_input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mouse"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;me&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mask&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;me&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;me&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;debug!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"call_main_service_pointer_input fail:{}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;e&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;No guard. The same pattern repeats for &lt;code&gt;PointerDeviceEvent&lt;/code&gt; (3240-3267) and&lt;br&gt;
&lt;code&gt;KeyEvent&lt;/code&gt; (3318-3330). All three check &lt;code&gt;is_authed_view_camera_conn()&lt;/code&gt;, which&lt;br&gt;
covers one narrow case, but none of them consult &lt;code&gt;peer_keyboard_enabled()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Downstream, the call chain is the real, unmodified RustDesk input path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;connection.rs (Android arm, no guard)
  -&amp;gt; libs/scrap/src/android/ffi.rs   (JNI: "mouse" -&amp;gt; kind 1, "touch" -&amp;gt; kind 0)
  -&amp;gt; MainService.kt  rustPointerInput(IIII)V / rustKeyEventInput([B)V
  -&amp;gt; InputService.kt  onMouseInput / onTouchInput / onKeyEvent
  -&amp;gt; dispatchGesture(...)  /  InputConnection.commitText(...)  /  ACTION_SET_TEXT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which means a peer that was told "no input" can still:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;type arbitrary text into focused fields (passwords, 2FA codes, chats),&lt;/li&gt;
&lt;li&gt;trigger taps and swipes via &lt;code&gt;dispatchGesture()&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;send physical key events.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Reproducing it
&lt;/h2&gt;

&lt;p&gt;I did not need a physical keyboard on the target, nor a live RustDesk server. The&lt;br&gt;
bug lives at the &lt;em&gt;dispatch layer&lt;/em&gt;, below the transport, so I injected real&lt;br&gt;
&lt;code&gt;hbb.MessageOuterClass&lt;/code&gt; protobuf messages at exactly that point:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight kotlin"&gt;&lt;code&gt;&lt;span class="nc"&gt;PoCConnection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;keyEventMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"PWNED-BY-REMOTE-KEYBOARD"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// real KeyEvent{seq=...}&lt;/span&gt;
&lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;ANDROID&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;// -&amp;gt; the three Android arms above&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The receiving app runs the genuine &lt;code&gt;InputService&lt;/code&gt; as a bound&lt;br&gt;
&lt;code&gt;AccessibilityService&lt;/code&gt; (&lt;code&gt;capabilities=33&lt;/code&gt;, including &lt;code&gt;CAN_PERFORM_GESTURES&lt;/code&gt;, and&lt;br&gt;
&lt;code&gt;getInputMethod()&lt;/code&gt; non-null). &lt;code&gt;onKeyEvent()&lt;/code&gt; parses the message and calls&lt;br&gt;
&lt;code&gt;commitText()&lt;/code&gt;, which inserts the whole string into a focused &lt;code&gt;EditText&lt;/code&gt; in one&lt;br&gt;
atomic operation — the same API an IME uses. No keystrokes required.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;keyboard=false&lt;/code&gt; &lt;strong&gt;and&lt;/strong&gt; &lt;code&gt;disable_keyboard=true&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;STATE: keyboard=false disable_keyboard=true -&amp;gt; peer_keyboard_enabled()=false
SINK: InputConnection.commitText("PWNED-BY-REMOTE-KEYBOARD") -&amp;gt; REAL Android text injection
SINK: dispatchGesture(x=160,y=219,willContinue=true) called -&amp;gt; REAL Android input injection
VICTIM UI: onClick fired -&amp;gt; tapCount=1
VICTIM UI: received ACTION_DOWN -&amp;gt; gestureCount=1
HANDLER[Desktop] KeyEvent: peer_keyboard_enabled()==false -&amp;gt; BLOCKED
victim text = "PWNED-BY-REMOTE-KEYBOARD" | button clicks = 1 | gesture events = 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same three messages through the desktop control arms: &lt;strong&gt;all blocked&lt;/strong&gt;. That A/B&lt;br&gt;
comparison is the actual finding — identical input, different guard.&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%2Fqyf1hry76vbspx2btw8h.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%2Fqyf1hry76vbspx2btw8h.png" alt="Emulator screenshot: permission banner, injected text in a real EditText, counters and the live runtime log" width="320" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The red banner reads &lt;code&gt;peer_keyboard_enabled() = FALSE&lt;/code&gt;. The blue-bordered field&lt;br&gt;
is a real &lt;code&gt;EditText&lt;/code&gt; (empty at the start of the run). The grey panel is the live&lt;br&gt;
runtime log, not a static caption.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scope note, because it matters:&lt;/strong&gt; this harness builds the protobuf messages&lt;br&gt;
locally and hands them to &lt;code&gt;on_message&lt;/code&gt; directly. It does not establish a&lt;br&gt;
Rendezvous/TCP session. It proves the authorization decision at the dispatch&lt;br&gt;
layer — which is exactly where the missing &lt;code&gt;if&lt;/code&gt; sits — using the real message&lt;br&gt;
format and the real input sinks. A full end-to-end run would need &lt;code&gt;hbbs&lt;/code&gt;/&lt;code&gt;hbbr&lt;/code&gt;&lt;br&gt;
(or direct IP) plus a controller client.&lt;/p&gt;
&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/rustdesk/rustdesk/pull/17061" rel="noopener noreferrer"&gt;PR #17061&lt;/a&gt;, opened 2026-11-14,&lt;br&gt;
adds 13 lines to those three Android arms:&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="cp"&gt;#[cfg(target_os = "android")]&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;peer_keyboard_enabled&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="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update_auto_disconnect_timer&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="kc"&gt;true&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 same guard goes into the &lt;code&gt;KeyEvent&lt;/code&gt; arm too (without the &lt;code&gt;cfg&lt;/code&gt; line, since&lt;br&gt;
that arm is already Android-only), placed &lt;em&gt;before&lt;/em&gt; modifier tracking. The&lt;br&gt;
auto-disconnect timer update is kept so idle-timeout behaviour does not change.&lt;/p&gt;

&lt;p&gt;The PR also notes a deliberate behaviour change: a peer without input permission&lt;br&gt;
should no longer be able to wake a sleeping screen via &lt;code&gt;rustPointerInput&lt;/code&gt;. The&lt;br&gt;
desktop path, iOS, permission configuration and the Kotlin sinks are untouched.&lt;/p&gt;

&lt;p&gt;A neighbouring &lt;a href="https://github.com/rustdesk/rustdesk/pull/17062" rel="noopener noreferrer"&gt;PR #17062&lt;/a&gt;&lt;br&gt;
hardens the same area from the other side: it stops &lt;code&gt;SwitchPermission&lt;/code&gt; broadcasts&lt;br&gt;
from re-enabling keyboard/clipboard on file-transfer, view-camera and&lt;br&gt;
port-forward connections. Worth reading together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Not the same as the earlier CVEs
&lt;/h2&gt;

&lt;p&gt;Two 2026 advisories look similar at first glance:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-57850 / GHSA-83jc-7j6x-wvj9&lt;/strong&gt; — missing &lt;em&gt;session-type scope
enforcement&lt;/em&gt; before 1.4.9, fixed by
&lt;a href="https://github.com/rustdesk/rustdesk/pull/15469" rel="noopener noreferrer"&gt;#15469&lt;/a&gt; / &lt;code&gt;493b14ba7&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CVE-2026-58056 / GHSA-vp3r-hwqm-x826&lt;/strong&gt; — per-capability flags not reset
after a FileTransfer session.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both are about &lt;em&gt;which flags get set and when&lt;/em&gt;. This one is different: in 1.5.3 the&lt;br&gt;
flags are set correctly and the peer is correctly told "no", but a&lt;br&gt;
platform-gated branch simply never reads them. It is a residual gap that survived&lt;br&gt;
the 1.4.9 fix — which is a good reminder that a security fix in shared code does&lt;br&gt;
not automatically cover &lt;code&gt;#[cfg(target_os = ...)]&lt;/code&gt; duplicates.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I took away
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;cfg&lt;/code&gt;-gated duplicates are a blind spot.&lt;/strong&gt; The same &lt;code&gt;match&lt;/code&gt; arm existed twice.
One got the guard, the other did not. Grep for the guard, not for the function.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Permission denied" is a runtime state, not a disconnect.&lt;/strong&gt; The peer keeps
sending; enforcement has to happen at every entry point.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A desktop test proves nothing about Android.&lt;/strong&gt; An emulator reproduction with
the real AccessibilityService sink is cheap and settles the question.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simulating the transport is fine — if you say so.&lt;/strong&gt; Injecting the wire message
at the dispatch layer isolates the bug precisely; just be explicit about what
the PoC does and does not cover.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Disclosure status
&lt;/h2&gt;

&lt;p&gt;RustDesk documents private reporting at &lt;code&gt;info@rustdesk.com&lt;/code&gt; (&lt;code&gt;docs/SECURITY.md&lt;/code&gt;);&lt;br&gt;
the repository has no published security advisory. The fix PR is public but was&lt;br&gt;
still &lt;strong&gt;open&lt;/strong&gt; at the time of writing, so it is not yet in a release. If you are&lt;br&gt;
writing about this yourself, coordinate the timing with the maintainers and avoid&lt;br&gt;
publishing a turnkey exploit before a patched build ships.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Tested on RustDesk 1.5.3 (checkout &lt;code&gt;3ccb4c4b&lt;/code&gt;), Android Emulator 37.2.13 with an&lt;br&gt;
API 35 &lt;code&gt;google_apis/x86_64&lt;/code&gt; AVD. CWE-862, High.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>security</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>Before authentication: three bugs in Mullvad's gotatun</title>
      <dc:creator>zerox80</dc:creator>
      <pubDate>Thu, 05 Nov 2026 20:10:45 +0000</pubDate>
      <link>https://dev.to/zerox80/before-authentication-three-bugs-in-mullvads-gotatun-25ih</link>
      <guid>https://dev.to/zerox80/before-authentication-three-bugs-in-mullvads-gotatun-25ih</guid>
      <description>&lt;p&gt;WireGuard has a habit I really like. Send it a packet it can't authenticate and it says nothing at all: no error, no hint, nothing an attacker could learn from.&lt;/p&gt;

&lt;p&gt;But silence doesn't mean the packet went nowhere. Before WireGuard gets to ignore a datagram, the kernel has already accepted it, a socket has handed it to userspace, and a handful of tasks have passed it around through buffers and channels, all before a single byte of cryptography runs.&lt;/p&gt;

&lt;p&gt;That stretch of code is where I spent my time in &lt;a href="https://github.com/mullvad/gotatun" rel="noopener noreferrer"&gt;gotatun&lt;/a&gt;, Mullvad's userspace WireGuard implementation written in Rust. I found three bugs there.&lt;/p&gt;

&lt;p&gt;None of them touch WireGuard's cryptography. Two could make a device stop receiving packets entirely, and the third let handshake rate-limiter entries pile up in memory long after they should have been cleared.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Linux:&lt;/strong&gt; one empty UDP datagram could panic the shared receive task.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows:&lt;/strong&gt; one oversized UDP datagram could stop reception for good.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rate limiter:&lt;/strong&gt; source-IP counters never got cleared while no peer had a known endpoint.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All three are fixed. Update to &lt;strong&gt;gotatun 0.10.1&lt;/strong&gt; or later.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Finding&lt;/th&gt;
&lt;th&gt;Affected path&lt;/th&gt;
&lt;th&gt;Severity&lt;/th&gt;
&lt;th&gt;Fixed in&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Empty datagram causes a panic&lt;/td&gt;
&lt;td&gt;Linux batched/GRO receive path&lt;/td&gt;
&lt;td&gt;High, CVSS 7.5&lt;/td&gt;
&lt;td&gt;0.10.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Oversized datagram stops reception&lt;/td&gt;
&lt;td&gt;Windows transport without &lt;code&gt;windows-gro&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;High, CVSS 7.5&lt;/td&gt;
&lt;td&gt;0.10.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Source-IP counters accumulate&lt;/td&gt;
&lt;td&gt;Device with no known peer endpoints&lt;/td&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;0.10.1&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The advisories list 0.9.2 as affected by the Linux and rate-limiter issues, and versions through 0.9.2 for the Windows one. I didn't test every older release, so I can't tell you exactly how far back each bug goes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part before authentication
&lt;/h2&gt;

&lt;p&gt;Receiving a packet and authenticating a peer are two very different things. In gotatun, a platform-specific socket receives the datagram, a buffered receive task pushes it through a channel, and only then does the device handler verify the packet and process handshakes.&lt;/p&gt;

&lt;p&gt;So untrusted input gets handled before WireGuard ever has a say.&lt;/p&gt;

&lt;p&gt;For the first two bugs, that was enough. Neither needed a valid handshake or any secret key, and the sender only had to get the packet length right.&lt;/p&gt;

&lt;p&gt;The rate limiter was a little different. Packets had to pass MAC1 validation first, but MAC1 doesn't authenticate a configured peer: its key is derived from the receiving device's public key, so anyone who knows that public key can build a packet with a valid MAC1 without holding any peer's private key.&lt;/p&gt;

&lt;p&gt;Keep that in mind. It comes back later.&lt;/p&gt;

&lt;p&gt;None of this gave me a way to decrypt traffic, extract keys or run code. These are availability bugs, and what they have in common is that unauthenticated traffic could reach resources the whole device depends on.&lt;/p&gt;




&lt;h2&gt;
  
  
  Bug 1: Zero bytes, one dead receiver
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Linux&lt;/strong&gt; · &lt;a href="https://github.com/mullvad/gotatun/security/advisories/GHSA-6gxq-8xp9-742r" rel="noopener noreferrer"&gt;GHSA-6gxq-8xp9-742r&lt;/a&gt; · High, CVSS 7.5 · fixed in 0.10.1&lt;/p&gt;

&lt;p&gt;On Linux, gotatun reads UDP packets in batches with &lt;code&gt;recvmmsg&lt;/code&gt;. That saves a syscall per packet, which is exactly what you want on a hot path like this.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;gotatun/src/udp/socket/linux.rs&lt;/code&gt; I found this line:&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="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;iovs&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="nf"&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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"we create exactly one IoSlice"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It looks harmless. The code creates exactly one &lt;code&gt;IoSlice&lt;/code&gt; per receive, so it expects to get exactly one back.&lt;/p&gt;

&lt;p&gt;It doesn't always. With the &lt;code&gt;nix&lt;/code&gt; 0.31.2 behavior described in the advisory, a UDP datagram with an empty payload can make &lt;code&gt;result.iovs().next()&lt;/code&gt; return &lt;code&gt;None&lt;/code&gt;, and &lt;code&gt;expect()&lt;/code&gt; then does precisely what it was written to do: it panics.&lt;/p&gt;

&lt;p&gt;An empty UDP datagram is perfectly legal. UDP allows zero-length payloads, and unlike a zero-length read on a TCP stream it doesn't mean EOF; it's a complete datagram that just happens to contain nothing, and the receiver has to cope with it.&lt;/p&gt;

&lt;p&gt;WireGuard could simply have thrown it away. It never got the chance.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why one packet was enough
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;expect()&lt;/code&gt; sat inside gotatun's shared UDP receive task. That single task receives traffic for every peer on the device.&lt;/p&gt;

&lt;p&gt;When the empty datagram arrived, the iterator returned &lt;code&gt;None&lt;/code&gt;, the task panicked, and the channel feeding packets to the device handler closed behind it. Every packet after that had nowhere to go, and reception for the whole device stayed gone until someone restarted or reconfigured it.&lt;/p&gt;

&lt;p&gt;One empty datagram. That's all it took.&lt;/p&gt;

&lt;p&gt;I want to be precise about the scope, though. What I showed is that the device's receive path dies; I didn't show that every application embedding gotatun crashes, and I wouldn't claim that without testing the embedding process separately.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reproducing it
&lt;/h3&gt;

&lt;p&gt;The Linux loopback reproduction in the report sends two things. First an empty datagram, then a normal control message.&lt;/p&gt;

&lt;p&gt;The second message is the real test. In the vulnerable version the producer task panics, the buffered receiver eventually reports a broken pipe because its channel has closed, and the control message never makes it through.&lt;/p&gt;

&lt;p&gt;No configured peer is needed. No key either, because the bug fires long before any of that matters.&lt;/p&gt;

&lt;h3&gt;
  
  
  The fix
&lt;/h3&gt;

&lt;p&gt;Mullvad fixed it in &lt;a href="https://github.com/mullvad/gotatun/pull/204" rel="noopener noreferrer"&gt;pull request #204&lt;/a&gt;. The unconditional &lt;code&gt;expect()&lt;/code&gt; is gone, replaced with a check that handles an empty iterator:&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="kc"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;iov&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;iovs&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="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;cold_path&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;cfg!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;debug_assertions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;tracing&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;trace!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Received empty datagram from IoSlice"&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="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;If there's no I/O slice, gotatun skips the result and moves on, and debug builds log what happened. That's really all a receiver needs to do with an empty datagram: no rebuilding the device, no touching peer state, no effect on whatever arrives next.&lt;/p&gt;

&lt;p&gt;The patch also adds a regression test. That matters more than it sounds, because "the panic is gone" is only half the story.&lt;/p&gt;

&lt;p&gt;The receiver has to survive the empty datagram &lt;strong&gt;and&lt;/strong&gt; deliver the next normal one.&lt;/p&gt;




&lt;h2&gt;
  
  
  Bug 2: A packet Windows forgave and gotatun didn't
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt; · &lt;a href="https://github.com/mullvad/gotatun/security/advisories/GHSA-fc57-wfhg-7c2w" rel="noopener noreferrer"&gt;GHSA-fc57-wfhg-7c2w&lt;/a&gt; · High, CVSS 7.5 · fixed in 0.10.0&lt;/p&gt;

&lt;p&gt;The Windows bug looked nothing like the Linux one. There was no panic and no empty iterator, just a socket error that gotatun took far more seriously than Windows did.&lt;/p&gt;

&lt;p&gt;It affects the built-in Windows transport without the optional &lt;code&gt;windows-gro&lt;/code&gt; feature. In that path, the buffered receiver uses a default packet buffer of 4,096 bytes.&lt;/p&gt;

&lt;p&gt;When a UDP datagram is bigger than the buffer passed to &lt;code&gt;recvfrom&lt;/code&gt;, Windows returns &lt;code&gt;WSAEMSGSIZE&lt;/code&gt;, error 10040. According to Microsoft's &lt;a href="https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recvfrom" rel="noopener noreferrer"&gt;&lt;code&gt;recvfrom&lt;/code&gt; documentation&lt;/a&gt;, the data gets truncated and the excess is discarded.&lt;/p&gt;

&lt;p&gt;The socket itself is fine. I checked that on native Windows: after an oversized datagram produced the expected error, a direct receive on the same socket returned the next, shorter message without complaint.&lt;/p&gt;

&lt;p&gt;Windows had moved on. Gotatun hadn't.&lt;/p&gt;

&lt;h3&gt;
  
  
  Following the error
&lt;/h3&gt;

&lt;p&gt;I traced the error into &lt;code&gt;BufferedUdpReceive::new&lt;/code&gt;, where a producer task receives packets and sends them through a channel to a consumer:&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="kc"&gt;Ok&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="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;udp_rx&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;recv_many_from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;recv_many_buf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;recv_pool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;packet_bufs&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="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// TODO&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="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;return&lt;/code&gt; is the bug. The &lt;code&gt;// TODO&lt;/code&gt; right above it says a lot.&lt;/p&gt;

&lt;p&gt;Any error from &lt;code&gt;recv_many_from()&lt;/code&gt; made the producer exit, whether the socket was truly broken or Windows had just dropped one datagram that didn't fit. Exiting dropped the sending side of the channel, and once the consumer had drained whatever was already queued, the device's receive loop ended.&lt;/p&gt;

&lt;p&gt;It ended quietly, too. &lt;code&gt;DeviceState::handle_incoming&lt;/code&gt; finished with &lt;code&gt;Ok(())&lt;/code&gt;, so nothing reported a fatal error and nothing restarted the receiver.&lt;/p&gt;

&lt;p&gt;The operating system hadn't disabled the socket. The library had simply stopped asking it for packets.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two devices, one big packet
&lt;/h3&gt;

&lt;p&gt;I tested this on native Windows 11. First at the socket and buffered-receiver layers, then with two peered gotatun devices talking to each other.&lt;/p&gt;

&lt;p&gt;For the device test I used real loopback UDP sockets and in-process TUN channels, so traffic went through gotatun's actual data path. Before the trigger, ordinary traffic flowed in both directions on both the patched and the unpatched build.&lt;/p&gt;

&lt;p&gt;Then I sent one 8,192-byte UDP datagram to the listening port of one device.&lt;/p&gt;

&lt;p&gt;On the unpatched build, the next packet didn't reach that device within five seconds. With only the Windows receive patch applied, the exact same test kept passing traffic both ways.&lt;/p&gt;

&lt;p&gt;That was the comparison I wanted. Same devices, same traffic, and the only thing that changed the outcome was the receive error hitting the vulnerable code.&lt;/p&gt;

&lt;p&gt;This result has limits. I didn't test a complete VPN product or every recovery path, so it covers the gotatun data path I exercised and not how a particular application behaves after rebuilding its device. The optional Windows GRO path uses a larger batch buffer and different code, and Linux is another implementation entirely, so I wouldn't stretch this finding to either one without separate evidence.&lt;/p&gt;

&lt;h3&gt;
  
  
  The fix
&lt;/h3&gt;

&lt;p&gt;The patch I sent with the report handles the error where it's actually understood: inside the Windows socket's own receive method. Here's &lt;code&gt;UdpSocket::recv_datagram&lt;/code&gt; as it shipped in &lt;a href="https://github.com/mullvad/gotatun/blob/v0.10.0/gotatun/src/udp/socket/windows.rs" rel="noopener noreferrer"&gt;gotatun 0.10.0&lt;/a&gt;:&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="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;recv_datagram&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="nc"&gt;PacketBufPool&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Packet&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;SocketAddr&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;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;buf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;match&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;socket&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="nf"&gt;recv_from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;buf&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="p"&gt;{&lt;/span&gt;
            &lt;span class="kc"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&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;src&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="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;truncate&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="p"&gt;;&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;Ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map_src&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;src&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;// Winsock discards the remainder of an oversized datagram. The socket&lt;/span&gt;
            &lt;span class="c1"&gt;// remains usable; never pass its truncated contents to the protocol.&lt;/span&gt;
            &lt;span class="kc"&gt;Err&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;if&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;raw_os_error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;WinSock&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;WSAEMSGSIZE&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="n"&gt;tokio&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;task&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;yield_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="k"&gt;await&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="kc"&gt;Err&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;Err&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;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A successful receive returns the packet as before. On &lt;code&gt;WSAEMSGSIZE&lt;/code&gt; the method knows Windows has already thrown the datagram away, so it yields to the executor with &lt;code&gt;tokio::task::yield_now().await&lt;/code&gt; and tries again.&lt;/p&gt;

&lt;p&gt;Every other error still propagates. I wanted to keep it that way, because some receive errors really do mean the socket or transport is broken, and swallowing those would only hide a different problem.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;WSAEMSGSIZE&lt;/code&gt; isn't one of them. Now one oversized datagram gets dropped, and reception carries on.&lt;/p&gt;




&lt;h2&gt;
  
  
  Bug 3: The cleanup nobody called
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Rate limiter&lt;/strong&gt; · &lt;a href="https://github.com/mullvad/gotatun/security/advisories/GHSA-m2rr-7rr7-vmp7" rel="noopener noreferrer"&gt;GHSA-m2rr-7rr7-vmp7&lt;/a&gt; · Moderate · fixed in 0.10.1&lt;/p&gt;

&lt;p&gt;The third bug lives in gotatun's handshake rate limiter. It counts handshake packets per source IP address and uses those counters to decide whether a source has gone over the configured threshold.&lt;/p&gt;

&lt;p&gt;The counting happens after MAC1 validation. That sounds sensible at first, since at least something has been checked before the code starts creating state.&lt;/p&gt;

&lt;p&gt;But remember what MAC1 is. Its key comes from the device's public key, so a sender who has never authenticated as a peer can still push a packet far enough into handshake processing to reach the rate limiter.&lt;/p&gt;

&lt;p&gt;Here's the counter update from &lt;a href="https://github.com/mullvad/gotatun/blob/v0.9.2/gotatun/src/noise/rate_limiter.rs" rel="noopener noreferrer"&gt;gotatun 0.9.2&lt;/a&gt;:&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="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;is_under_load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;src_addr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;IpAddr&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="kd"&gt;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;ip_counts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ip_counts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lock&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;let&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ip_counts&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="nf"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;src_addr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;or_insert&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="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;self&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Lock the map, find or create the entry for the source IP, increment, compare. Simple enough.&lt;/p&gt;

&lt;p&gt;The catch is the difference between many packets from one address and packets from many addresses. The first case keeps updating a single entry, while the second adds a fresh counter for every new IP, and the per-IP threshold does nothing to cap how many IPs end up in the map.&lt;/p&gt;

&lt;p&gt;So the obvious next question was how entries ever leave it.&lt;/p&gt;

&lt;h3&gt;
  
  
  A reset that existed but never ran
&lt;/h3&gt;

&lt;p&gt;There was a reset method, and it looked fine:&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="k"&gt;pub&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;try_reset_count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;current_time&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Instant&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&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="kd"&gt;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;ip_counts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ip_counts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;current_time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;duration_since&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ip_counts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_reset&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="no"&gt;RESET_PERIOD&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;ip_counts&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="nf"&gt;clear&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;ip_counts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_reset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;current_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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It checks how long it's been since the last reset. If the interval has passed, it clears the map and updates the timestamp.&lt;/p&gt;

&lt;p&gt;A reset only helps if something calls it. I followed the call path and found that the usual reset ran through the peer timer logic, and that logic skipped every peer without an endpoint.&lt;/p&gt;

&lt;p&gt;That's an awkward combination. A gotatun device can listen for handshakes while none of its configured peers has a known endpoint, so incoming packets keep creating source-IP entries while the code that's supposed to clear them skips every peer and never gets there.&lt;/p&gt;

&lt;p&gt;The map keeps growing, long after the reset interval has passed.&lt;/p&gt;

&lt;p&gt;The counters belonged to the device. Their cleanup depended on peer state that might not exist.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the test shows, and what it doesn't
&lt;/h3&gt;

&lt;p&gt;The public advisory includes a reproduction that doesn't even need sockets. It builds handshake packets with valid MAC1 values for 2,048 synthetic source IP addresses, splits them into two groups and processes them across the normal reset interval.&lt;/p&gt;

&lt;p&gt;The entries stay in the map until the reset is called by hand.&lt;/p&gt;

&lt;p&gt;Together with the device timer's control flow, that demonstrates the missing cleanup: time passes, new entries arrive, and the reset still doesn't happen when no peer has a known endpoint.&lt;/p&gt;

&lt;p&gt;I'm not going to turn that into "an attacker can exhaust memory on any affected machine." Filling the map takes traffic from many distinct source IPs, and whether someone can produce that depends on the network, on filtering and on anti-spoofing protections, so the test proves that entries survive when they shouldn't, not how fast memory would run out in a real deployment.&lt;/p&gt;

&lt;h3&gt;
  
  
  A side note on &lt;code&gt;clear()&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;While reading the reset code I noticed one more thing. Rust's &lt;a href="https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.clear" rel="noopener noreferrer"&gt;&lt;code&gt;HashMap::clear()&lt;/code&gt;&lt;/a&gt; removes every entry but keeps the allocated capacity.&lt;/p&gt;

&lt;p&gt;So even after a successful reset, an empty map can still hold on to memory from when it was full.&lt;/p&gt;

&lt;p&gt;That isn't necessarily wrong. Reusing capacity is often faster than freeing and reallocating, and for a map that gets cleared and refilled on a schedule it can be the right call; it just means entry count and retained capacity are two separate things to measure if you care about resource exhaustion.&lt;/p&gt;

&lt;p&gt;The bug I reported was about the reset not running. Whether the map should also shrink is a different decision.&lt;/p&gt;

&lt;h3&gt;
  
  
  The fix
&lt;/h3&gt;

&lt;p&gt;Mullvad fixed this in &lt;a href="https://github.com/mullvad/gotatun/pull/205" rel="noopener noreferrer"&gt;pull request #205&lt;/a&gt; by attempting the reset during the device's periodic maintenance:&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="k"&gt;if&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="kc"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rate_limiter&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;device&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rate_limiter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;as_ref&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;rate_limiter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;try_reset_count&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;The device can now clear the counters even when no peer has a known endpoint. The peer-side reset is still there, but cleanup no longer depends on it alone.&lt;/p&gt;

&lt;p&gt;The patch doesn't touch &lt;code&gt;HashMap::clear()&lt;/code&gt; or add a shrinking policy. It makes sure the reset finally gets a chance to run.&lt;/p&gt;




&lt;h2&gt;
  
  
  Test the packet after the bad one
&lt;/h2&gt;

&lt;p&gt;Working through these bugs changed how I think about tests for receive paths. Checking that an invalid packet gets rejected tells you surprisingly little about whether the service survives it.&lt;/p&gt;

&lt;p&gt;On Linux, the empty datagram should be dropped and the receiver must still be alive afterward. On Windows, the OS is allowed to report an oversized datagram, but that's no reason for gotatun to stop receiving altogether.&lt;/p&gt;

&lt;p&gt;For both receive-path bugs, the most useful regression test is almost boring. Send the bad datagram, then send a normal one, and if the normal one arrives you've confirmed that the receive task is still running, the channel still works and packets still make it through the device.&lt;/p&gt;

&lt;p&gt;The rate limiter needs a different kind of test. Its failure depends on time and device state, so I'd set up a listening device with no known peer endpoints, create source-IP entries with qualifying handshake traffic, move past the reset interval and check that the entries are gone, and I'd measure retained capacity separately if memory was what I cared about.&lt;/p&gt;

&lt;p&gt;And test on every platform. A Linux test says nothing about how the Windows socket wrapper handles &lt;code&gt;WSAEMSGSIZE&lt;/code&gt;, and a passing test on the Windows non-GRO path says nothing about the GRO one.&lt;/p&gt;

&lt;p&gt;In both receive-path bugs, the platform-specific code is exactly where things went wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you use gotatun
&lt;/h2&gt;

&lt;p&gt;Update to &lt;strong&gt;0.10.1&lt;/strong&gt; or later. Version 0.10.0 already contains the Windows fix, but 0.10.1 is the first release with all three.&lt;/p&gt;

&lt;p&gt;If you're checking an application that embeds gotatun, look at the resolved dependency version and the build you actually ship, not just what the manifest says. Check the target OS and which transport features are enabled too, because an advisory proves that a vulnerable code path exists, not that every application exposes it in its own configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I look for now
&lt;/h2&gt;

&lt;p&gt;When I review UDP code these days, I start right at the receive boundary. Can an empty datagram reach an &lt;code&gt;expect()&lt;/code&gt; or an assertion? Does the code assume a buffer holds data just because it handed one to the operating system? How are receive errors classified, and can one unexpected result make a shared producer task exit?&lt;/p&gt;

&lt;p&gt;If the producer does exit, what then? Does the consumer notice, does the device restart reception, or does the task end quietly while the rest of the application carries on as if nothing happened?&lt;/p&gt;

&lt;p&gt;And when unauthenticated traffic can create state, I want to know what bounds it and what cleans it up, especially when the device has no active peers or known endpoints. The rate limiter is a good reminder to follow the call to a cleanup function instead of only reading the function itself. Its logic was fine, but the path that called it depended on peer state that could be missing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;I went into gotatun to see what happens around WireGuard's authentication boundary. I came out with three different ways unauthenticated input could take availability away from an otherwise healthy device: an empty datagram that panicked a shared task, an oversized one that made a producer give up on a socket that still worked, and a cleanup that waited for peers who weren't there.&lt;/p&gt;

&lt;p&gt;None of them needed to break any cryptography. The fixes were small as well: skip the empty result, handle &lt;code&gt;WSAEMSGSIZE&lt;/code&gt; where it's understood, and give the rate limiter a cleanup path that doesn't need a peer endpoint.&lt;/p&gt;

&lt;p&gt;A packet doesn't have to pass authentication to cause trouble. It only has to reach code that makes the wrong assumption about its input, about a socket error, or about the state of the device.&lt;/p&gt;

&lt;p&gt;So don't stop at asking whether the bad packet gets rejected. Ask whether the next good one still gets through.&lt;/p&gt;

&lt;p&gt;Thanks to the Mullvad team for fixing these, shipping the patches and publishing the advisories.&lt;/p&gt;

</description>
      <category>security</category>
      <category>rust</category>
      <category>wireguard</category>
      <category>networking</category>
    </item>
    <item>
      <title>Two ways to stall quinn, Rust's QUIC library</title>
      <dc:creator>zerox80</dc:creator>
      <pubDate>Thu, 05 Nov 2026 20:10:34 +0000</pubDate>
      <link>https://dev.to/zerox80/two-ways-to-stall-quinn-rusts-quic-library-3150</link>
      <guid>https://dev.to/zerox80/two-ways-to-stall-quinn-rusts-quic-library-3150</guid>
      <description>&lt;p&gt;An oversized UDP datagram and an ordinary-looking pair of transport parameters were enough to expose two very different denial-of-service bugs in &lt;a href="https://github.com/quinn-rs/quinn" rel="noopener noreferrer"&gt;quinn&lt;/a&gt;, a QUIC implementation in Rust.&lt;/p&gt;

&lt;p&gt;I reported both to the maintainers, and both are fixed. The first lives below QUIC in &lt;code&gt;quinn-udp&lt;/code&gt;: a receive fallback can keep retrying a nonblocking socket instead of returning control to the runtime. The second lives in &lt;code&gt;quinn-proto&lt;/code&gt;: a peer-supplied minimum ACK delay can violate the precondition of &lt;code&gt;Duration::clamp&lt;/code&gt; and cause a panic.&lt;/p&gt;

&lt;p&gt;Their prerequisites are different, so it is useful to keep them separate from the start:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Finding&lt;/th&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Required condition&lt;/th&gt;
&lt;th&gt;First patched release&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Receive loop spins after truncation&lt;/td&gt;
&lt;td&gt;&lt;code&gt;quinn-udp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Unix &lt;code&gt;recv_single&lt;/code&gt; fallback and a datagram larger than its receive buffer&lt;/td&gt;
&lt;td&gt;0.5.16 in the 0.5 line; 0.6.3 in the 0.6 line&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ACK-delay calculation panics&lt;/td&gt;
&lt;td&gt;&lt;code&gt;quinn-proto&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sending ACK_FREQUENCY enabled, plus peer parameters that invert the calculated bounds&lt;/td&gt;
&lt;td&gt;0.11.18&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The UDP bug happens before QUIC packet authentication. The ACK-delay bug is reached while processing a connection with the relevant extension enabled; sending ACK_FREQUENCY is disabled by default. Neither finding should be read as a claim that every quinn endpoint has the same exposure.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. recv_single() spins after a truncated datagram
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/quinn-rs/quinn/security/advisories/GHSA-6pp4-4cxf-xf88" rel="noopener noreferrer"&gt;GHSA-6pp4-4cxf-xf88&lt;/a&gt; · High · &lt;code&gt;quinn-udp&lt;/code&gt; · fixed in 0.5.16 and 0.6.3&lt;/p&gt;

&lt;h3&gt;
  
  
  Why returning WouldBlock matters
&lt;/h3&gt;

&lt;p&gt;The affected function is the Unix &lt;code&gt;recv_single&lt;/code&gt; fallback in &lt;code&gt;quinn-udp/src/unix.rs&lt;/code&gt;. It receives one datagram at a time using &lt;code&gt;recvmsg&lt;/code&gt;, rather than the ordinary Linux batched receive path.&lt;/p&gt;

&lt;p&gt;Production callers include OpenBSD and other Unix/Apple fallback configurations. Windows uses a different implementation. A test that explicitly calls the fallback on Linux is therefore evidence about that function, not proof that Linux's normal production path is vulnerable.&lt;/p&gt;

&lt;p&gt;The socket is nonblocking. When there is no datagram available, the receive call should return an error such as &lt;code&gt;EAGAIN&lt;/code&gt; or &lt;code&gt;EWOULDBLOCK&lt;/code&gt;, which the Rust layer exposes as &lt;code&gt;WouldBlock&lt;/code&gt;. That is how the receiver tells its caller to stop trying immediately and wait for readiness again.&lt;/p&gt;

&lt;p&gt;If the function keeps retrying without receiving data, reaching an await point, or returning that signal, it can occupy the runtime thread that is driving the endpoint. The connection logic above it cannot fix the problem because control has not returned there.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two reasonable-looking decisions combine badly
&lt;/h3&gt;

&lt;p&gt;The old code had two relevant properties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It inspected &lt;code&gt;MSG_TRUNC&lt;/code&gt; before handling a negative &lt;code&gt;recvmsg&lt;/code&gt; result.&lt;/li&gt;
&lt;li&gt;It initialized the &lt;code&gt;msghdr&lt;/code&gt; once, outside the retry loop.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;msghdr&lt;/code&gt; contains both input information and output fields. Among the outputs, &lt;code&gt;msg_flags&lt;/code&gt; can indicate that a received datagram was truncated because the payload did not fit in the buffer.&lt;/p&gt;

&lt;p&gt;Discarding such a datagram is reasonable. Reusing a structure can also look harmless when the next successful call is expected to replace its output fields. The problem appears when the next call fails and the code still reads those fields as fresh output.&lt;/p&gt;

&lt;p&gt;Here is the vulnerable &lt;code&gt;recv_single&lt;/code&gt; function from the &lt;a href="https://github.com/quinn-rs/quinn/blob/65a87d40c22e0818e50adfa277611610d792a43d/quinn-udp/src/unix.rs" rel="noopener noreferrer"&gt;reviewed source revision&lt;/a&gt;. The imports and crate-local helper definitions live in the same module:&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="k"&gt;pub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;crate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;recv_single&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;SockRef&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&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="n"&gt;bufs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;IoSliceMut&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&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="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;RecvMeta&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="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;usize&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;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MaybeUninit&lt;/span&gt;&lt;span class="o"&gt;::&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;libc&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sockaddr_storage&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;::&lt;/span&gt;&lt;span class="nf"&gt;uninit&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;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;ctrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cmsg&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Aligned&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;MaybeUninit&lt;/span&gt;&lt;span class="o"&gt;::&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;u8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;cmsg&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;LEN&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;uninit&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;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;hdr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;unsafe&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;zeroed&lt;/span&gt;&lt;span class="o"&gt;::&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;libc&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;msghdr&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="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;prepare_recv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;bufs&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="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&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;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;ctrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;hdr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;unsafe&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;libc&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;recvmsg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;as_raw_fd&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="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;hdr&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="p"&gt;;&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;hdr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;msg_flags&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;libc&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;MSG_TRUNC&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;continue&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;n&lt;/span&gt; &lt;span class="o"&gt;&amp;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;break&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;last_os_error&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;match&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;kind&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;// Retry receiving&lt;/span&gt;
            &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;ErrorKind&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Interrupted&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;Err&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&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="n"&gt;meta&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="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;decode_recv&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;name&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;hdr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;usize&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="kc"&gt;Ok&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The error branch is unreachable whenever the old truncation flag remains set. A flag describing the previous successful receive takes priority over the current call's failure.&lt;/p&gt;

&lt;h3&gt;
  
  
  The sequence that gets stuck
&lt;/h3&gt;

&lt;p&gt;Suppose a datagram is larger than the receive buffer. The first &lt;code&gt;recvmsg&lt;/code&gt; succeeds with a truncated message and sets &lt;code&gt;MSG_TRUNC&lt;/code&gt;. The receiver discards that message and retries.&lt;/p&gt;

&lt;p&gt;Now the queue is empty. The next nonblocking &lt;code&gt;recvmsg&lt;/code&gt; fails with &lt;code&gt;EAGAIN&lt;/code&gt;. Under the relevant semantics, that failed call can leave the previous output flags unchanged. Since the code checks &lt;code&gt;MSG_TRUNC&lt;/code&gt; first, it interprets the stale flag as another truncated receive and immediately loops again.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Attempt&lt;/th&gt;
&lt;th&gt;Current receive result&lt;/th&gt;
&lt;th&gt;Flag observed by the old code&lt;/th&gt;
&lt;th&gt;Decision&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;First&lt;/td&gt;
&lt;td&gt;Oversized datagram received&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;MSG_TRUNC&lt;/code&gt; set&lt;/td&gt;
&lt;td&gt;Discard and retry&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Second&lt;/td&gt;
&lt;td&gt;No queued data; &lt;code&gt;EAGAIN&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Previous &lt;code&gt;MSG_TRUNC&lt;/code&gt; still set&lt;/td&gt;
&lt;td&gt;Retry instead of returning &lt;code&gt;WouldBlock&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Following attempts&lt;/td&gt;
&lt;td&gt;Still no queued data&lt;/td&gt;
&lt;td&gt;Same stale flag&lt;/td&gt;
&lt;td&gt;Keep retrying&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A later successful, non-truncated receive can release the loop. That limits the claim: this is not necessarily an irreversible endpoint failure. It can still prevent useful runtime work while the loop is spinning, and its trigger occurs before any QUIC authentication.&lt;/p&gt;

&lt;p&gt;The receive buffer must be smaller than the incoming datagram. Platform selection and buffer sizing are therefore part of the exposure assessment, rather than incidental details to leave out of the advisory.&lt;/p&gt;

&lt;h3&gt;
  
  
  How I reproduced it without hanging the test suite
&lt;/h3&gt;

&lt;p&gt;I used a bounded localhost regression test that calls &lt;code&gt;recv_single&lt;/code&gt; directly. It queues a 16-byte datagram for an 8-byte receive buffer and expects the function to discard the truncated message, observe the empty queue, and return &lt;code&gt;WouldBlock&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The unpatched function does not finish that sequence in time. The test sends a valid cleanup message if the call has not finished within one second, allowing the stuck receiver to escape before the test reports failure. This is useful when testing a synchronous busy loop: the regression must detect the lack of progress without leaving the test process spinning indefinitely.&lt;/p&gt;

&lt;p&gt;A second test covers truncation followed by a valid message and verifies both the payload and the source address. This catches a related class of mistakes where the function returns but carries stale receive metadata forward.&lt;/p&gt;

&lt;p&gt;Those tests ran under Linux/WSL with the fallback explicitly enabled for unit testing. I also checked the relevant OpenBSD kernel receive semantics in source. I did not run the reproduction on native OpenBSD, and the test setup should not be presented as native platform confirmation.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/quinn-rs/quinn/security/advisories/GHSA-6pp4-4cxf-xf88" rel="noopener noreferrer"&gt;public advisory&lt;/a&gt; records the before-and-after result: the regression fails before the fix and passes after it. It also records passing &lt;code&gt;quinn-udp&lt;/code&gt; suites on Linux and Windows.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fix the ordering and reset the whole header
&lt;/h3&gt;

&lt;p&gt;The fix I proposed returns receive errors before inspecting the output flags. It also initializes the receive header inside the &lt;code&gt;retry_if_interrupted&lt;/code&gt; closure, before each syscall attempt.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/quinn-rs/quinn/commit/462865a6c33039c26076f7077c7cd7e2f997b9cd" rel="noopener noreferrer"&gt;fix commit&lt;/a&gt; replaces it with this function:&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="k"&gt;pub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;crate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;recv_single&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;SockRef&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&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="n"&gt;bufs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;IoSliceMut&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&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="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;meta&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;RecvMeta&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="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kt"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;usize&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;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MaybeUninit&lt;/span&gt;&lt;span class="o"&gt;::&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;libc&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;sockaddr_storage&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;::&lt;/span&gt;&lt;span class="nf"&gt;uninit&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;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;ctrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cmsg&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Aligned&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;MaybeUninit&lt;/span&gt;&lt;span class="o"&gt;::&amp;lt;&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;u8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;cmsg&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;LEN&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;uninit&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;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;hdr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;unsafe&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;mem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;zeroed&lt;/span&gt;&lt;span class="o"&gt;::&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;libc&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;msghdr&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="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;loop&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;retry_if_interrupted&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="nf"&gt;prepare_recv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;bufs&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="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&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;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;ctrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;hdr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;unsafe&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;libc&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;recvmsg&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;as_raw_fd&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="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;hdr&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="p"&gt;}&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;if&lt;/span&gt; &lt;span class="n"&gt;hdr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;msg_flags&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;libc&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;MSG_TRUNC&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;break&lt;/span&gt; &lt;span class="n"&gt;n&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;meta&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="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;decode_recv&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;name&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;hdr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;usize&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="kc"&gt;Ok&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;?&lt;/code&gt; after &lt;code&gt;retry_if_interrupted&lt;/code&gt; returns a receive error before the code can inspect &lt;code&gt;hdr.msg_flags&lt;/code&gt;. The helper retries &lt;code&gt;Interrupted&lt;/code&gt; errors but returns other errors, including &lt;code&gt;WouldBlock&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Resetting the complete header matters because the flags are not its only reusable fields. Address and control-buffer lengths also participate in the input/output contract. A fix that only clears &lt;code&gt;MSG_TRUNC&lt;/code&gt; risks preserving a similar assumption somewhere else in the structure.&lt;/p&gt;

&lt;p&gt;The result is a receive loop with an explicit progress rule: after successfully receiving a truncated message it may try again, but an empty nonblocking socket returns control to the caller.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. A peer can make clamp() panic
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/quinn-rs/quinn/security/advisories/GHSA-3g6h-r5qx-f6hq" rel="noopener noreferrer"&gt;GHSA-3g6h-r5qx-f6hq&lt;/a&gt; / &lt;a href="https://rustsec.org/advisories/RUSTSEC-2026-0340.html" rel="noopener noreferrer"&gt;RUSTSEC-2026-0340&lt;/a&gt; · High, CVSS 7.5 · &lt;code&gt;quinn-proto&lt;/code&gt; · fixed in 0.11.18&lt;/p&gt;

&lt;p&gt;The second bug does not need a malformed UDP receive. It comes from combining peer transport parameters with a locally calculated round-trip-time bound.&lt;/p&gt;

&lt;p&gt;QUIC endpoints acknowledge received packets. When quinn is configured to send ACK_FREQUENCY frames, it calculates a delay to request from the peer. That calculation needs to account for the minimum delay the peer advertises as well as the local policy for choosing a useful delay.&lt;/p&gt;

&lt;h3&gt;
  
  
  The interval that stops being an interval
&lt;/h3&gt;

&lt;p&gt;In &lt;code&gt;AckFrequencyState::candidate_max_ack_delay&lt;/code&gt;, the &lt;a href="https://github.com/quinn-rs/quinn/blob/d6acf44667c06334530e9d4d1fb8511fd499b575/quinn-proto/src/connection/ack_frequency.rs" rel="noopener noreferrer"&gt;vulnerable implementation&lt;/a&gt; converts the peer minimum to a &lt;code&gt;Duration&lt;/code&gt; and uses it as the lower bound of &lt;code&gt;clamp&lt;/code&gt;:&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="k"&gt;pub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;candidate_max_ack_delay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;rtt&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;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nc"&gt;AckFrequencyConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;peer_params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nc"&gt;TransportParameters&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="nc"&gt;Duration&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Use the peer's max_ack_delay if no custom max_ack_delay was provided in the config&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;min_ack_delay&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_micros&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;peer_params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;min_ack_delay&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map_or&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="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;into&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="n"&gt;config&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;max_ack_delay&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unwrap_or&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;peer_max_ack_delay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;min_ack_delay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rtt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;MIN_AUTOMATIC_ACK_DELAY&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 candidate itself comes from an explicitly configured maximum delay, or from the peer's maximum ACK delay when no override is configured.&lt;/p&gt;

&lt;p&gt;The missing invariant is that the lower bound must not exceed the upper bound. &lt;code&gt;clamp&lt;/code&gt; does not resolve contradictory bounds by choosing a compromise: it panics when &lt;code&gt;min &amp;gt; max&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The peer can advertise these values and pass the transport-parameter validator:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Input&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Converted duration&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;min_ack_delay&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;100,000 microseconds&lt;/td&gt;
&lt;td&gt;100 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;max_ack_delay&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;100 milliseconds&lt;/td&gt;
&lt;td&gt;100 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Current RTT used by the calculation&lt;/td&gt;
&lt;td&gt;5 milliseconds&lt;/td&gt;
&lt;td&gt;5 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The unit conversion is worth making explicit. These two transport parameters use different units, but the example minimum and maximum both represent 100 ms. Their relationship is acceptable to the validator.&lt;/p&gt;

&lt;p&gt;The upper bound comes from the current RTT and &lt;code&gt;MIN_AUTOMATIC_ACK_DELAY&lt;/code&gt;, which is 25 ms. At a 5 ms RTT, that produces a 25 ms upper bound against the peer's 100 ms lower bound.&lt;/p&gt;

&lt;p&gt;The values have passed one validation boundary and still violate a precondition at another. Checking each field, or even the relationship between the two advertised parameters, is insufficient when a later calculation combines them with local state.&lt;/p&gt;

&lt;h3&gt;
  
  
  A small illustration of the panic
&lt;/h3&gt;

&lt;p&gt;The following standalone example demonstrates the violated Rust precondition. It is an arithmetic illustration, not a network reproduction:&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="k"&gt;use&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Duration&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&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;let&lt;/span&gt; &lt;span class="n"&gt;peer_minimum&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_millis&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;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;rtt&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_millis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;automatic_floor&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_millis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;local_upper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;rtt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;automatic_floor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;candidate&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_millis&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;span class="c1"&gt;// Panics because the minimum is greater than the maximum.&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;candidate&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;peer_minimum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;local_upper&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;Changing the candidate alone cannot repair an inverted interval. This explains why both automatic and explicitly configured maximum ACK delays could reach the bug: the problematic relationship belongs to the bounds.&lt;/p&gt;

&lt;h3&gt;
  
  
  The configuration and impact limits
&lt;/h3&gt;

&lt;p&gt;Reaching this path requires &lt;code&gt;TransportConfig::ack_frequency_config(Some(...))&lt;/code&gt;. Sending ACK_FREQUENCY is disabled by default, so an endpoint that has not enabled it does not reach this finding's affected calculation through that feature.&lt;/p&gt;

&lt;p&gt;The demonstrated failure is a panic while driving the connection. What happens to the embedding application depends on its panic strategy and runtime behavior. I did not verify a process-wide crash, and the advisory explicitly preserves that limitation.&lt;/p&gt;

&lt;p&gt;That distinction matters operationally. A panic in a connection-driving task can be serious, but it should not automatically be reported as every quinn deployment terminating its process on receipt of these parameters.&lt;/p&gt;

&lt;h3&gt;
  
  
  The fix defines which bound wins
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://github.com/quinn-rs/quinn/pull/2868" rel="noopener noreferrer"&gt;published fix in PR #2868&lt;/a&gt; replaces the &lt;code&gt;clamp&lt;/code&gt; with explicit minimum and maximum operations. This is the corrected method from the &lt;a href="https://github.com/quinn-rs/quinn/blob/981d88eccb36ae5e8585bcd3145debb00969a462/quinn-proto/src/connection/ack_frequency.rs" rel="noopener noreferrer"&gt;merged source&lt;/a&gt;:&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="k"&gt;pub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;candidate_max_ack_delay&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;rtt&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;config&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nc"&gt;AckFrequencyConfig&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;peer_params&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nc"&gt;TransportParameters&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="nc"&gt;Duration&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;min_ack_delay&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_micros&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;peer_params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;min_ack_delay&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map_or&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="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;into&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;// Use the peer's max_ack_delay if no custom max_ack_delay was provided in the config&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;candidate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;max_ack_delay&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unwrap_or&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;peer_max_ack_delay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Must be no smaller than the `min_ack_delay` advertised by the peer&lt;/span&gt;
    &lt;span class="nc"&gt;Ord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="c1"&gt;// Should be less than the RTT (itself at least `MIN_AUTOMATIC_ACK_DELAY`)&lt;/span&gt;
        &lt;span class="nc"&gt;Ord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;candidate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Ord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rtt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;MIN_AUTOMATIC_ACK_DELAY&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;min_ack_delay&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 ordering expresses the policy. Apply the local preferred upper bound first, then ensure the result is at least the minimum advertised by the peer. If the peer's minimum exceeds that local preference, the peer minimum wins. The function can return a duration without requiring the two bounds to form a valid &lt;code&gt;clamp&lt;/code&gt; interval.&lt;/p&gt;

&lt;p&gt;For the example above, the result is 100 ms. This is more precise than saying the fix simply removes a panic: it defines the behavior for a combination of valid inputs that the old expression could not represent.&lt;/p&gt;

&lt;p&gt;The public patch also includes regression tests that encode and read the transport parameters before calling the calculation. Here is the first test, from the same module:&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="cp"&gt;#[test]&lt;/span&gt;
&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;peer_min_ack_delay_can_exceed_rtt&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;let&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;TransportParameters&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;min_ack_delay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;Some&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100_000u32&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;into&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;max_ack_delay&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100u32&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;into&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="nc"&gt;TransportParameters&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;default&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;let&lt;/span&gt; &lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;encoded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;Vec&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&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;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;encoded&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;TransportParameters&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Side&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="kd"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;encoded&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;as_slice&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="nf"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"peer parameters must pass wire-level validation"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AckFrequencyState&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;new&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="nf"&gt;from_millis&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;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;delay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;candidate_max_ack_delay&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="nf"&gt;from_millis&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&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="nc"&gt;AckFrequencyConfig&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;default&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="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;params&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="nf"&gt;assert_eq!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;delay&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="nf"&gt;from_millis&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;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 second test uses the same minimum with a 200 ms maximum. At a 5 ms RTT, both expect a 100 ms result.&lt;/p&gt;

&lt;p&gt;Passing the values through the wire-level validator is useful evidence. A test that only invents an impossible internal state might protect a helper function while saying little about remote reachability. Here the tests preserve the connection between accepted input and the arithmetic that consumes it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reviewing the two failures together
&lt;/h2&gt;

&lt;p&gt;Both bugs appear at boundaries where one part of the system assumes another has established more than it actually has.&lt;/p&gt;

&lt;p&gt;In the receive loop, the code treats an output flag as current before establishing that the syscall succeeded. The missing question is whether that output belongs to this attempt.&lt;/p&gt;

&lt;p&gt;In the ACK-delay calculation, the code treats accepted parameters as safe bounds for a later operation. The missing question is whether they still satisfy the required relationship after combining them with RTT and local policy.&lt;/p&gt;

&lt;p&gt;These suggest two concrete review techniques. For syscall wrappers, trace a successful unusual result followed by a failure, including all reused output fields. For protocol arithmetic, trace accepted extreme values all the way to the operation that uses them, including relationships with changing local state.&lt;/p&gt;

&lt;p&gt;The tests should follow the same distinction. A receive regression needs to prove that control returns or a later valid packet is delivered. An arithmetic regression needs to assert the intended result for contradictory preferences, rather than only asserting that execution avoids a panic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Updating downstream applications
&lt;/h2&gt;

&lt;p&gt;For these findings, the patched component versions are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;quinn-udp&lt;/code&gt; 0.5.16 or later in the 0.5 line, or 0.6.3 or later in the 0.6 line.&lt;/strong&gt; Version 0.6.0 is newer than 0.5.16 but is still within the affected 0.6 range.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;quinn-proto&lt;/code&gt; 0.11.18 or later containing the ACK-delay fix.&lt;/strong&gt; RustSec lists versions below 0.11.0 as unaffected by this particular finding.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check the resolved versions of those components, including transitive dependencies and duplicate versions, rather than relying only on the top-level &lt;code&gt;quinn&lt;/code&gt; declaration. The platform receive implementation, buffer size, and ACK-frequency configuration then determine which of the described paths a deployed application can reach.&lt;/p&gt;

&lt;p&gt;Disabling ACK_FREQUENCY transmission removes the prerequisite for the second finding while an update is being prepared. It does not address the UDP receive loop, which sits below that protocol feature. Each fix belongs to its own component and needs to reach the build that is actually deployed.&lt;/p&gt;

&lt;p&gt;Thanks to the quinn maintainers for handling the reports, shipping the fixes, and crediting the work in the advisories.&lt;/p&gt;

</description>
      <category>security</category>
      <category>rust</category>
      <category>quic</category>
      <category>networking</category>
    </item>
  </channel>
</rss>
