SiteShadow
Back to vulnerability library

CWE-74 Injection

What this means

SiteShadow flagged an "injection-shaped" pattern: untrusted input is being used to build something that will later be interpreted (SQL, commands, HTML, templates, headers, file paths).

Why it matters

Injection enables attackers to run unintended commands or queries.

Safer examples

1) Parameterize queries (don't concatenate)

await db.query("SELECT * FROM users WHERE id = $1", [id]);

2) Use safe APIs (avoid "interpret me" sinks)

Use textContent instead of innerHTML, argument arrays instead of shell strings, and allowlists for dynamic behavior.

3) Validate at trust boundaries

Validate inputs in request handlers and reject unexpected shapes/lengths (see CWE-20).

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Request access View coverage