Urgent.News

What's breaking now, across thousands of outlets.

Tech

How I Found an SSR Cache Isolation Failure in a React Data Fetching Library

There's a certain kind of bug that only shows up when you stop thinking about what code does and start thinking about when it does it. Most security researchers spend their time asking "can an attacker make this code do something bad?" That's a fine question. But it misses an entire category of vulnerabilities that have nothing to do with malicious input. Sometimes the code does something bad all…

The incident described in the source involves a security vulnerability in a popular React data fetching library used in many Next.js projects. This library manages caching differently for client-side and server-side rendering. On the server, it uses a module-level variable—a single Map object—to store cached data. This approach is problematic because modules are shared across all incoming requests in a Node.js environment, including concurrent requests.

The vulnerability allows data from one user's request to be served to another user's request, even though the two users should be completely isolated in terms of data visibility. The library offers a way to isolate caches per request using a provider component, but this feature is not enabled by default. The default configuration shares cache state across all users, making it easier for data leakage to occur.

The author of the story discovered this issue while auditing the library and provided a proof of concept demonstrating the vulnerability. The fix involves enabling the cache isolation provider, which creates a fresh cache for each request, ensuring that users' data remains private and secure.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Four pull requests, four full suites, one answer

While the project was small, none of this mattered. It grew, and the suite grew with it. A great many tests need a great deal of machine time, and that becomes a choice where both answers cost: run…

  • Merge queue runs full suite per batch, not per pull request
  • Merge queue still runs full suite once per pull request in group
  • Subset of tests is only way to avoid running full suite

POO: Classes Concretas

Introdução Uma classe é concreta quando está 100% implementada. Nenhum membro fica pendurado sem corpo. É por isso, e so por isso que o compilador libera o new .

  • Concrete classes fully implemented without abstract members
  • Allow 'new' usage for concrete classes in compilation
  • Contain private fields, read-only properties, static members

More from Saturday 29 August →