SiteShadow
Back to vulnerability library

CWE-99 Resource Injection

What this means

SiteShadow flagged resource identifiers (filenames, URLs, bucket keys, template names) being constructed from untrusted input, allowing an attacker to select unexpected resources.

Why it matters

Attackers can access unexpected resources or files.

Safer examples

1) Use allowlists for resource selection

const allowed = { summary: "/reports/summary.json", invoice: "/reports/invoice.csv" };
const key = req.query.type in allowed ? req.query.type : "summary";
const path = allowed[key];

2) Enforce base directories / trusted hosts

For paths: normalize and enforce base directories. For URLs: allowlist hosts (see CWE-23/36 and CWE-918).

3) Add authorization at the resource level

Even if a resource exists, verify the requester is allowed to access it.

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Request access View coverage