Broken Authentication

Broken Authentication in Node.js (Express) [Mar 2026] [CVE-2026-33042]

[Updated Mar 2026] Updated CVE-2026-33042

Overview

CVE-2026-33042 describes a broken authentication scenario in Parse Server where an empty authData object sent by a client is treated as present and can bypass standard username/password validation during new user creation. This allows an attacker to create authenticated sessions or accounts without providing valid credentials, even when anonymous access is disabled. The vulnerability is categorized under CWE-287 (Improper Authentication). In real-world Node.js (Express) deployments that rely on a Parse Server-like flow, an attacker can exfiltrate or impersonate accounts by sending authData: {} in a signup request, which the server may incorrectly route to an external provider flow without enforcing credential checks. The CVE notes that fixes were introduced in 9.6.0-alpha.29 (for the 9.x line) and 8.6.49 (for the 8.x line), where empty or non-actionable authData is treated as absent for credential validation during new user creation. The recommended workaround in those releases also highlighted Cloud Code beforeSave for _User to reject signups with empty authData when no username/password are provided. This guide maps those concrete fixes to Node.js/Express development patterns and shows both vulnerable and fixed implementations, plus actionable remediation steps for typical Express apps. CVE-2026-33042, CWE-287.

Affected Versions

Parse Server 9.5.x and earlier (9.6.0-alpha.29 fixes) and Parse Server 8.6.x and earlier (8.6.49 fixes); affected: before 9.6.0-alpha.29 and before 8.6.49.

Code Fix Example

Node.js (Express) API Security Remediation
// Node.js (Express) example showing vulnerable vs fixed signup handling
const express = require('express');
const app = express();
app.use(express.json());

// In-memory user store (demo only)
const users = [];
function generateId() { return 'u_' + Math.random().toString(36).slice(2, 9); }
function hashPassword(pw) { return 'hash(' + pw + ')'; }

// ----------------- Vulnerable pattern (allowed with empty authData) -----------------
app.post('/signup-vulnerable', (req, res) => {
  const { username, password, authData } = req.body;
  // Vulnerable: any presence of authData triggers provider flow; even empty object ({}).
  if (authData) {
    // Sign up via external provider data without validating credentials
    const user = { id: generateId(), authData };
    users.push(user);
    // pretend session establishment
    req.session = { userId: user.id };
    return res.json({ ok: true, userId: user.id, mode: 'vulnerable-auth' });
  }
  // Fallback: require credentials
  if (!username || !password) {
    return res.status(400).json({ error: 'Credentials required' });
  }
  const user = { id: generateId(), username, passwordHash: hashPassword(password) };
  users.push(user);
  req.session = { userId: user.id };
  res.json({ ok: true, userId: user.id, mode: 'credentials' });
});

// ----------------- Fixed pattern (empty authData treated as absent) -----------------
app.post('/signup-fixed', (req, res) => {
  const { username, password, authData } = req.body;
  // Fix: treat empty or non-actionable authData as absent
  const hasValidAuthData = !!authData && Object.keys(authData).length > 0;
  if (hasValidAuthData) {
    // Sign up via provider data
    const user = { id: generateId(), authData };
    users.push(user);
    req.session = { userId: user.id };
    return res.json({ ok: true, userId: user.id, mode: 'provider' });
  }
  // No valid authData: require credentials
  if (!username || !password) {
    return res.status(400).json({ error: 'Credentials required' });
  }
  const user = { id: generateId(), username, passwordHash: hashPassword(password) };
  users.push(user);
  req.session = { userId: user.id };
  res.json({ ok: true, userId: user.id, mode: 'credentials' });
});

// Start server (for demonstration)
app.listen(3000, () => {
  console.log('Demo server running on http://localhost:3000');
});

CVE References

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