<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Most recent entries from all</title>
    <link>https://db.gcve.eu</link>
    <description>Contains only the most 10 recent entries.</description>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>python-feedgen</generator>
    <language>en</language>
    <lastBuildDate>Mon, 28 Sep 2026 23:55:43 +0000</lastBuildDate>
    <item>
      <title>GHSA-38f7-945m-qr2g — Effect `AsyncLocalStorage` context lost/contaminated inside Effect fibers under concurrent load with RPC</title>
      <link>https://db.gcve.eu/vuln/ghsa-38f7-945m-qr2g</link>
      <description>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; npm: effect&lt;/p&gt;
&lt;p&gt;## Versions&lt;/p&gt;
&lt;p&gt;- `effect`: 3.19.15
- `@effect/rpc`: 0.72.1
- `@effect/platform`: 0.94.2
- Node.js: v22.20.0
- Vercel runtime with Fluid compute
- Next.js: 16 (App Router)
- `@clerk/nextjs`: 6.x&lt;/p&gt;
&lt;p&gt;## Root cause&lt;/p&gt;
&lt;p&gt;Effect&amp;#39;s `MixedScheduler` batches fiber continuations and drains them inside a **single** microtask or timer callback. The `AsyncLocalStorage` context active during that callback belongs to whichever request first triggered the scheduler&amp;#39;s drain cycle — **not** the request that owns the fiber being resumed.&lt;/p&gt;
&lt;p&gt;### Detailed mechanism&lt;/p&gt;
&lt;p&gt;#### 1. Scheduler batching (`effect/src/Scheduler.ts`, `MixedScheduler`)&lt;/p&gt;
&lt;p&gt;```typescript
// MixedScheduler.starve() — called once when first task is scheduled
private starve(depth = 0) {
  if (depth &amp;gt;= this.maxNextTickBeforeTimer) {
    setTimeout(() =&amp;gt; this.starveInternal(0), 0)       // timer queue
  } else {
    Promise.resolve(void 0).then(() =&amp;gt; this.starveInternal(depth + 1)) // microtask queue
  }
}&lt;/p&gt;
&lt;p&gt;// MixedScheduler.starveInternal() — drains ALL accumulated tasks in one call
private starveInternal(depth: number) {
  const tasks = this.tasks.buckets
  this.tasks.buckets = []
  for (const [_, toRun] of tasks) {
    for (let i = 0; i &amp;lt; toRun.length; i++) {
      toRun[i]()  // ← Every fiber continuation runs in the SAME ALS context
    }
  }
  // ...
}
```&lt;/p&gt;
&lt;p&gt;`scheduleTask` only calls `starve()` when `running` is `false`. Subsequent tasks accumulate in `this.tasks` until `starveInternal` drains them all. The `Promise.then()` (or `setTimeout`…&lt;/p&gt;</description>
      <content:encoded>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; npm: effect&lt;/p&gt;
&lt;p&gt;## Versions&lt;/p&gt;
&lt;p&gt;- `effect`: 3.19.15
- `@effect/rpc`: 0.72.1
- `@effect/platform`: 0.94.2
- Node.js: v22.20.0
- Vercel runtime with Fluid compute
- Next.js: 16 (App Router)
- `@clerk/nextjs`: 6.x&lt;/p&gt;
&lt;p&gt;## Root cause&lt;/p&gt;
&lt;p&gt;Effect&amp;#39;s `MixedScheduler` batches fiber continuations and drains them inside a **single** microtask or timer callback. The `AsyncLocalStorage` context active during that callback belongs to whichever request first triggered the scheduler&amp;#39;s drain cycle — **not** the request that owns the fiber being resumed.&lt;/p&gt;
&lt;p&gt;### Detailed mechanism&lt;/p&gt;
&lt;p&gt;#### 1. Scheduler batching (`effect/src/Scheduler.ts`, `MixedScheduler`)&lt;/p&gt;
&lt;p&gt;```typescript
// MixedScheduler.starve() — called once when first task is scheduled
private starve(depth = 0) {
  if (depth &amp;gt;= this.maxNextTickBeforeTimer) {
    setTimeout(() =&amp;gt; this.starveInternal(0), 0)       // timer queue
  } else {
    Promise.resolve(void 0).then(() =&amp;gt; this.starveInternal(depth + 1)) // microtask queue
  }
}&lt;/p&gt;
&lt;p&gt;// MixedScheduler.starveInternal() — drains ALL accumulated tasks in one call
private starveInternal(depth: number) {
  const tasks = this.tasks.buckets
  this.tasks.buckets = []
  for (const [_, toRun] of tasks) {
    for (let i = 0; i &amp;lt; toRun.length; i++) {
      toRun[i]()  // ← Every fiber continuation runs in the SAME ALS context
    }
  }
  // ...
}
```&lt;/p&gt;
&lt;p&gt;`scheduleTask` only calls `starve()` when `running` is `false`. Subsequent tasks accumulate in `this.tasks` until `starveInternal` drains them all. The `Promise.then()` (or `setTimeout`…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://db.gcve.eu/vuln/ghsa-38f7-945m-qr2g</guid>
    </item>
  </channel>
</rss>
