Unrestricted Resource Consumption

Unrestricted Resource Consumption in Node.js (Express) [CVE-2026-33538]

[Updated Mar 2026] Updated CVE-2026-33538

Overview

Unrestricted Resource Consumption vulnerabilities enable attackers to exhaust backend resources by crafting requests that trigger expensive operations. CVE-2026-33538 describes a DoS in Parse Server, a Node.js-based backend, where an unauthenticated client can send authentication requests containing arbitrary, unconfigured provider names. For each unconfigured provider, the server executes a database query; because the database lacks an index on such provider names, these queries can incur full collection scans. When an attacker issues many such requests in parallel, database resources can be saturated, degrading or denying service for legitimate users.\n\nExploitation is straightforward in real deployments: an attacker submits many auth requests with bogus provider names. The server loops over the unconfigured names and issues a query for each, causing heavy, uncontrolled loads on the database. This is particularly dangerous in multi-tenant or large-user datasets where collection scans consume substantial CPU and I/O. The root cause is unrestricted resource consumption (CWE-400) due to unvalidated inputs and unindexed queries. CVE-2026-33538 and its patch illustrate how validating inputs and ensuring appropriate indexing can mitigate such DoS vectors.\n\nIn Node.js with Express, this class of vulnerability manifests as a DoS at the application layer that can propagate to the database layer. To fix, validate and whitelist provider values early, avoid performing heavy queries for unknown providers, and enforce proper indexing and rate limiting. Parse Server's patch (versions 8.6.58 and 9.6.0-alpha.52) demonstrates the right approach: disallow unconfigured providers quickly and ensure queries are served by indexed fields. Apply these same principles to your own Node.js (Express) services to mitigate similar DoS risks.

Affected Versions

Parse Server versions prior to 8.6.58 and 9.6.0-alpha.52

Code Fix Example

Node.js (Express) API Security Remediation
// Vulnerable pattern and then Fixed pattern side-by-side

// Vulnerable
const express = require('express');
const mongoose = require('mongoose');
const app = express();
app.use(express.json());

const userSchema = new mongoose.Schema({ provider: String, name: String });
const User = mongoose.model('User', userSchema);

app.post('/auth', async (req, res) => {
  const allowed = ['google','facebook','github'];
  const inputProvider = req.body.provider;
  // If provider is unconfigured, perform many heavy queries for potential unconfigured providers
  if (!allowed.includes(inputProvider)) {
    const unconfigured = req.body.unconfiguredProviders || [];
    // Vulnerable: no index and unbounded queries per provider
    for (const p of unconfigured) {
      await User.find({ provider: p }).exec(); // full collection scan for unindexed provider
    }
    return res.status(400).send('Unknown provider');
  }
  // Normal flow
  const user = await User.findOne({ provider: inputProvider }).exec();
  if (!user) return res.status(401).send('Unauthorized');
  res.send('OK');
});

// Fixed
// 1) Add index on provider
// 2) Validate early and use indexed queries
// 3) Optional rate limiting
User.collection.createIndex({ provider: 1 }).then(() => console.log('Provider index ensured'));

const rateLimit = require('express-rate-limit');
const limiter = rateLimit({ windowMs: 15 * 60 * 1000, max: 100 });
app.post('/auth', limiter, async (req, res) => {
  const allowed = new Set(['google','facebook','github']);
  const inputProvider = (req.body.provider || '').trim();
  if (!inputProvider || !allowed.has(inputProvider)) {
    return res.status(400).send('Unknown provider');
  }
  // Now queries are fast thanks to the index
  const user = await User.findOne({ provider: inputProvider }).maxTimeMS(1000).exec();
  if (!user) return res.status(401).send('Unauthorized');
  res.send('OK');
});

app.listen(3000, () => console.log('Server listening'));

CVE References

Choose which optional cookies to allow. You can change this any time.