CWE-470 - Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
- Abstraction:Base
- Structure:Simple
- Status:Draft
- Release Date:2006-07-19
- Latest Modification Date:2023-10-26
Weakness Name
Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
Description
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.
Common Consequences
Scope: Integrity, Confidentiality, Availability, Other
Impact: Execute Unauthorized Code or Commands, Alter Execution Logic
Notes: The attacker might be able to execute code that is not directly accessible to the attacker. Alternately, the attacker could call unexpected code in the wrong place or the wrong time, possibly modifying critical system state.
Scope: Availability, Other
Impact: DoS: Crash, Exit, or Restart, Other
Notes: The attacker might be able to use reflection to call the wrong code, possibly with unexpected arguments that violate the API (CWE-227). This could cause the product to exit or hang.
Scope: Confidentiality
Impact: Read Application Data
Notes: By causing the wrong code to be invoked, the attacker might be able to trigger a runtime error that leaks sensitive information in the error message, such as CWE-536.
Related Weaknesses
CWE-20Improper Input ValidationHigh
CWE-610Externally Controlled Reference to a Resource in Another Sphere
CWE-913Improper Control of Dynamically-Managed Code Resources
Microsoft Credits EncryptHub, Hacker Behind 618+ Breaches, for Disclosing Windows Flaws
Coinbase to fix 2FA account activity entry freaking out users
North Korean Hackers Deploy BeaverTail Malware via 11 Malicious npm Packages
WinRAR flaw bypasses Windows Mark of the Web security alerts
Malicious Python Packages on PyPI Downloaded 39,000+ Times, Steal Sensitive Data
Port of Seattle says ransomware breach impacts 90,000 people
PoisonSeed phishing campaign behind emails with wallet seed phrases
Australian pension funds hit by wave of credential stuffing attacks
Europcar GitLab breach exposes data of up to 200,000 customers
OpenAI's $20 ChatGPT Plus is now free for students until the end of May
CVE-2025-22224 VMware ESXi and Workstation TOCTOU Race Condition Vulnerability
CVE-2020-29574 CyberoamOS (CROS) SQL Injection Vulnerability
CVE-2022-43769 Hitachi Vantara Pentaho BA Server Special Element Injection Vulnerability
CVE-2018-19410 Paessler PRTG Network Monitor Local File Inclusion Vulnerability
CVE-2022-43939 Hitachi Vantara Pentaho BA Server Authorization Bypass Vulnerability
CVE-2024-40890 Zyxel DSL CPE OS Command Injection Vulnerability
CVE-2025-2783 Google Chromium Mojo Sandbox Escape Vulnerability
CVE-2017-0148 Microsoft SMBv1 Server Remote Code Execution Vulnerability
CVE-2018-8639 Microsoft Windows Win32k Improper Resource Shutdown or Release Vulnerability
CVE-2024-49035 Microsoft Partner Center Improper Access Control Vulnerability
LowStrict-Transport-Security Multiple Header Entries (Non-compliant with Spec)
InformationalInformation Disclosure - Sensitive Information in URL
InformationalVerification Request Identified
InformationalBase64 Disclosure
InformationalEmail address found in WebSocket message