SiteShadow
Back to vulnerability library

CWE-104 Struts Form Bean Without Validation

What this means

SiteShadow flagged a "form object" / request model being used without proper server-side validation. While the CWE name references Struts, the core issue applies to any framework: unvalidated form fields flow into business logic and sensitive sinks.

Why it matters

Unvalidated form input can lead to injection or logic issues.

Safer examples

1) Validate request bodies with a schema (JavaScript/TypeScript)

import { z } from "zod";

const Schema = z.object({
  email: z.string().email(),
  quantity: z.number().int().min(1).max(100),
});

const data = Schema.parse(req.body);

2) Validate required fields and ranges (Python)

import re

if not re.fullmatch(r"[^@]+@[^@]+\.[^@]+", email):
    raise ValueError("Invalid email")
if quantity < 1 or quantity > 100:
    raise ValueError("Invalid quantity")

3) Recompute sensitive values server-side

Don't accept role/price/state from forms; compute them from trusted server state (see CWE-454 / CWE-642).

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Request access View coverage