CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
The product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code.
If the product uses external inputs to determine which class to instantiate or which method to invoke, then an attacker could supply values to select unexpected classes or methods. If this occurs, then the attacker could create control flow paths that were not intended by the developer. These paths could bypass authentication or access control checks, or otherwise cause the product to behave in an unexpected manner. This situation becomes a doomsday scenario if the attacker can upload files into a location that appears on the product's classpath (CWE-427) or add new entries to the product's classpath (CWE-426). Under either of these conditions, the attacker can use reflection to introduce new, malicious behavior into the product.
Consequences
- Integrity, Confidentiality, Availability, Other: Execute Unauthorized Code or Commands, Alter Execution Logic
- Availability, Other: DoS: Crash, Exit, or Restart, Other
- Confidentiality: Read Application Data
How to prevent it
- Architecture and Design: Refactor your code to avoid using reflection.
- Architecture and Design: Do not use user-controlled inputs to select and load classes or code.
- Implementation: Apply strict input validation by using allowlists or indirect selection to ensure that the user is only selecting allowable classes or code.
Recent advisories
- GHSA-26p8-2jq9-3vq9 — MLflow vulnerable to remote code execution on unauthenticated servers via third-party scorer deserialization importing caller-placed artifact modules
- GHSA-2wqp-q3c6-ccj5 — MLflow: SSRF on unauthenticated MLflow servers via third-party scorer kwargs in the scorer invoke, register, and GenAI evaluate endpoints
- GHSA-5wcm-3v2w-8362 — Laravel relationship inclusion can trigger unauthorized data destruction
- DRUPAL-CORE-2026-014 — A remote code execution vulnerability exists within the Field UI module in Drupal core.
- GHSA-wjgm-6hv5-3cvf — jackson-databind: Path Deserialization Missing Scheme Allowlist for FileSystemProvider Resolution
- GHSA-73mf-m39p-wpm9 — Yamcs vulnerable to Remote Code Execution via instance-template argument YAML injection (createInstance)
- CVE-2026-82078 — An unsafe dynamic class loading vulnerability exists in the database connection utilities of PaperCut MF and PaperCut NG.
- GHSA-j2vp-f2pv-5rj4 — Statamic: Unsafe method invocation via Antlers template resolution allows data destruction
- GHSA-7pgq-cr25-xvc8 — Grav: Incomplete callable validation in blueprint dynamic fields allows arbitrary static method invocation and file disclosure
- GHSA-337j-9hxr-rhxg — React Router: Arbitrary Constructor Injection via deserializeErrors() in React Router SSR Hydration
- GHSA-c4wf-2xxc-68qm — Grav: FlexDirectory::dynamicDataField() executes arbitrary callables from blueprint data with no validation
- GHSA-m92m-r54r-x8r2 — Statamic CMS's unsafe method invocation via collection sorting allows data destruction
- GHSA-x746-7m8f-x49c — Starlette: Arbitrary HTTP method dispatched to `HTTPEndpoint` attributes via `getattr`
- GHSA-vmwp-vh32-rj75 — Yamcs Vulnerable to Remote Code Execution via Mission Database algorithm override
- GHSA-86rh-h242-j8xp — Kirby CMS has an Arbitrary Method Call via REST API Search and Collection Query Endpoints
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor