What Happens When You Move ERP Business Logic to React and Firebase
Over the past three years, an aggressive architectural anti-pattern has infected enterprise software development across European mid-market organizations. Pressed by high SaaS subscription fees and rigid proprietary work
Over the past three years, an aggressive architectural anti-pattern has infected enterprise software development across European mid-market organizations. Pressed by high SaaS subscription fees and rigid proprietary workflows, leadership teams increasingly commission boutique software agencies and rapid development studios to build "bespoke, lightweight ERP and CRM systems" within six to eight weeks.
On the surface, the deliverable appears stunning. Built on modern frontend toolchains like React, Next.js, and Vite, the user interface is snappy, visually polished, and responsive. It features dark-mode styling, drag-and-drop dispatch boards, real-time messaging, and interactive analytics. Executives frequently marvel at how quickly their custom operations platform went from wireframe to deployment without the perceived overhead of legacy enterprise platforms.
However, when our forensics team at dlab.md conducts pre-migration code reviews and infrastructure security audits on these environments, we uncover an alarming reality: these applications possess no server-side application tier.
Instead of routing operational commands through a hardened business logic layer, the development agency shifted the entire burden of data validation, authorization, and financial math directly into client-side JavaScript bundles running within the user's browser. The database (typically Google Cloud Firestore or Supabase) is exposed directly to the public internet, shielded only by trivial client-side UI filters and permissive declarative rules.
In a recent forensic engagement involving a commercial platform managing 42,825 customer records, 2,909 active purchase orders, and a workforce of 55 dispatch technicians, an unauthenticated external observer was separated from total database exfiltration and full administrative compromise by exactly two standard HTTP requests.
This technical whitepaper provides an exhaustive breakdown of the failure modes inherent in serverless thick-client enterprise architectures, analyzes the mechanics of Client-Side Mass Assignment (CWE-915) and Broken Object-Level Authorization (OWASP API1:2023), and demonstrates how Odoo 19 CE and PostgreSQL enforce immutable Zero Client-Side Trust at the kernel layer.
📊 Interactive Engineering Benchmark: Explore the live chart, matrix & dataset in the full report on Dlab.md →
The Anatomy of the Thick-Client Anti-Pattern
In enterprise systems engineering, the division between presentation, business logic, and persistence is non-negotiable. A robust architecture enforces Zero Client-Side Trust: the client browser is treated as an inherently hostile, untrusted terminal. The browser is responsible solely for rendering UI components and collecting user inputs. It has zero direct access to the database wire protocol, no knowledge of database schema constraints, and no authority to declare whether a financial balance is correct or whether a record modification is legitimate.
In a serverless thick-client architecture, this entire separation principle is discarded. To accelerate frontend velocity and bypass the engineering effort required to build a structured API gateway with strict transactional models, developers establish direct client-to-database connections.
📊 Interactive Engineering Benchmark: Explore the live chart, matrix & dataset in the full report on Dlab.md →
When an enterprise replaces an application server with direct client-side database calls, security boundaries dissolve. We documented this breakdown across four sequential attack vectors during our forensic investigation.
Unauthenticated Schema Discovery and BOLA (CWE-540 & CWE-639)
When a visitor navigates to the public login screen of a thick-client web application, the HTTP server responds with the pre-compiled JavaScript bundle. Because modern build pipelines bundle application route trees together unless complex code-splitting and dynamic imports are strictly architected, the client downloads the code for the entire administrative back-office before a single credential is submitted.
Inspecting the main bundle via standard browser developer tools immediately revealed the full enterprise administrative surface:
- The
PayrollPage.jsmodule contained complete compensation formulas, commission calculations, and disciplinary penalty structures. - The
FinancesPage.jsandfinance.service.jsfiles exposed accounting ledger schemas, payment gateway credentials, cash desk balances, and vendor reconciliation routines. - The
SettingsPage.jsbundle held infrastructure configurations, third-party webhook URLs, and telephony credentials.
Because query builders and collection names were declared directly within frontend service files, an external observer mapped all 36 database collections within sixty seconds.
Simultaneously, the frontend exposed a public order lookup function designed for customer self-service: https://app.client-domain.com/getOrder?orderNumber=ORD-202508-0117.
This endpoint suffered from classic Broken Object-Level Authorization (OWASP API1:2023 / CWE-639). The serverless function failed to authenticate incoming requests or verify whether the requester was authorized to view the specific order. Because purchase order numbers were generated as simple sequential integers padded with a date stamp, an automated shell script could enumerate every transaction in the enterprise database. In less than forty minutes, the entire history of 42,825 customer profiles (including physical residential addresses, telephone numbers, order totals, and dispatch notes) was vulnerable to systematic exfiltration.
Public Identity Provisioning and Identity Theft (CWE-250)
The standard defense mounted by proponents of serverless databases is declarative security rules: allow read, write: if request.auth != null;. Developers assume that as long as unauthenticated visitors cannot read the database directly, the data remains secure.
This assumption collapsed due to a developer convenience shortcut.
To allow administrators to onboard field dispatch personnel and contractors quickly from within the web interface, the original engineering agency implemented an inline registration modal. However, rather than writing a privileged server-side Cloud Function utilizing the administrative SDK (firebase-admin), the frontend developer directly invoked the client SDK method:
import { getAuth, createUserWithEmailAndPassword } from "firebase/auth";
export async function registerFieldTechnician(email, temporaryPassword) {
const auth = getAuth();
// Insecure client-side invocation requiring public registration to remain open
const userCredential = await createUserWithEmailAndPassword(auth, email, temporaryPassword);
return userCredential.user;
}
For this browser-side function to operate, the enterprise project's identity provider was required to keep public self-registration (accounts:signUp) permanently enabled.
Consequently, any external adversary could extract the public project configuration from the page source, construct an HTTP POST request to the identity provider endpoint with an arbitrary email address, and receive a cryptographically valid authentication token within 200 milliseconds.
The boundary condition request.auth != null was completely neutralized. An anonymous external entity instantly transformed into a recognized authenticated user on the corporate tenant.
📐 Continue Reading the Full Engineering Benchmark on Dlab.md
This architectural excerpt covers the core problem statement and primary failure modes. The complete engineering report on Dlab.md includes:
- Interactive Chart.js telemetry benchmarks & 36-month TCO comparison matrices;
- Production PostgreSQL / Odoo 19 implementation patterns and verification checklists;
- Executive CISO, CFO & Principal Architect technical FAQ.
👉 Read the Complete Engineering Breakdown & Interactive Charts on Dlab.md →
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.