SiteShadow
Back to vulnerability library
Detected byCWE-aware static analysisPro

CWE-470 Unsafe Reflection

Coverage: 21 rules in the SiteShadow rule registry target this CWE (registry v2.0.0). Regex 21 Also: Taint and heuristic analyzers may also detect related flows (see coverage for the authoritative list) Registry tagging shows intent, for sample-level behaviour and benchmarked gaps see known gaps.

What this means

SiteShadow flagged reflection or dynamic class/module loading that is influenced by untrusted input. Reflection is powerful, but if attackers can choose what gets loaded or invoked, they can often bypass intended restrictions.

Why it matters

Unsafe reflection can load unexpected classes or behaviors.

Safer examples

1) Replace reflection with allowlisted dispatch

handlers = {"create": create_user, "delete": delete_user}
handler = handlers.get(action)
if not handler:
    raise ValueError("Invalid action")
handler()

2) Don't build class/module names from user input

Map user input to known implementations instead.

3) Add authorization around dynamic dispatch

Even with allowlists, ensure the selected action is authorized for the caller.

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Catch this with SiteShadow Pro.

This vulnerability class is detected by SiteShadow's Pro-tier engines, two-pass interprocedural taint analysis, heuristic flow checks, AI-context scanning, and cross-file detection. The free tier catches OWASP Top 10 single-file patterns; Pro adds the data-flow depth that finds this class of bug.