F-2025-0005·input-validation

Unvalidated profile fields written to DB (shape and size constraints missing)

Fixedpentesttypescriptbackend
TL;DR

User profile fields were written to MongoDB without shape or size constraints, allowing oversized strings, unexpected types, or injected structures to land in the database.

Severity
MEDIUM
Impact
MEDIUM
Likelihood
MEDIUM
Method
MManual review
CAT.
Complexity
LOW
Exploitability
MEDIUM
02Section · Description

Description

The profile update path persisted incoming fields to MongoDB without enforcing shape (allowed keys, types) or size constraints (maximum string length, max document size). Adversarial inputs could grow document size, inject unexpected fields, or set values that broke downstream consumers.

03Section · Impact

Impact

  • Storage and bandwidth amplification: oversized fields inflate document size and downstream egress.
  • Downstream consumer failures: code that assumes a particular field type or length crashes on adversarial data.
  • Increased risk of injection-style issues at consumer points that do not re-validate.
04Section · Recommendation

Recommendation

Add schema-level validation on the profile model (mongoose schema, zod, or equivalent). Enforce a closed list of allowed keys, type constraints, and per-field length caps. Reject unknown keys at the API layer before writing to the database.

Ipal Network: Confirmed. Zealynx: Fixed.

Status
Fixed
F-2025-0005