Skip to content
OpenAdvisories

Weakness (CWE)

CWE-470: Use of Externally-Controlled Input to Select Classes or Code

Base Draft

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.

More detail

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.

How to prevent it (3 mitigations)
  1. Architecture and Design

    Refactor your code to avoid using reflection.

  2. Architecture and Design

    Do not use user-controlled inputs to select and load classes or code.

  3. Implementation

    Apply strict input validation by using allowlists or indirect selection to ensure that the user is only selecting allowable classes or code.

Source: MITRE CWE-470

144 results · Feed

  • High 7.8

    Telerik Reporting Insecure Expression Evaluation

    In Progress Telerik Reporting versions prior to 2024 Q3 (18.2.24.924), a code execution attack is possible using object injection via insecure expression evaluation.

  • High 8.8

    Telerik Reporting EntityDataSource Insecure Type Resolution

    In Progress Telerik Reporting versions prior to 2024 Q3 (18.2.24.924), a code execution attack is possible through object injection via an insecure type resolution vulnerability.

  • High 8.8

    Unsafe Deserialization Vulnerability

    In Progress® Telerik® Reporting versions prior to 18.1.24.709, a code execution attack is possible through object injection via an insecure type resolution vulnerability.

  • Medium 6.7

    Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') vulnerability in the licensing featu…

  • Medium 6.1

    CVE-2024-22258: PKCE Downgrade in Spring Authorization Server

    Spring Authorization Server versions 1.0.0 - 1.0.5, 1.1.0 - 1.1.5, 1.2.0 - 1.2.2 and older unsupported versions are susceptible to a PKCE Downgrade Attack for Confidential Clients. Specifically, an application is vulnerable when a Confidential Client uses PKC…

  • High 8.8

    Reflex arbitrary method call in stimulus_reflex

    stimulus_reflex is a system to extend the capabilities of both Rails and Stimulus by intercepting user interactions and passing them to Rails over real-time websockets. In affected versions more methods than expected can be called on reflex instances. Being a…

  • Critical 9.8

    Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') vulnerability in Mitsubishi Electric…

  • High 7.2
    CVE-2024-0200 Scanner template EPSS 72%

    Unsafe Reflection in Github Enterprise Server leading to Command Injection

    An unsafe reflection vulnerability was identified in GitHub Enterprise Server that could lead to reflection injection. This vulnerability could lead to the execution of user-controlled methods and remote code execution. To exploit this bug, an actor would nee…

  • Unscored —

    In multiple locations, there is a possible way to import contacts belonging to other users due to a confused deputy. Th…

  • High 8.8

    Sitecore Experience Platform (XP) v9.3 was discovered to contain an authenticated remote code execution (RCE) vulnerabi…

  • High 8.3

    Possible unsafe reflection / partial denial of service in avo

    Avo is an open source ruby on rails admin panel creation framework. The polymorphic field type stores the classes to operate on when updating a record with user input, and does not validate them in the back end. This can lead to unexpected behavior, remote co…

  • Critical 9.0

    SailPoint IdentityIQ Unsafe use of Reflection Vulnerability

    IdentityIQ 8.3 and all 8.3 patch levels prior to 8.3p3, IdentityIQ 8.2 and all 8.2 patch levels prior to 8.2p6, IdentityIQ 8.1 and all 8.1 patch levels prior to 8.1p7, IdentityIQ 8.0 and all 8.0 patch levels prior to 8.0p6 allow an authenticated user to invok…

  • Medium 5.1

    Remote code execution in YouTube Android Player API SDK

    The YouTube Embedded 1.2 SDK binds to a service within the YouTube Main App. After binding, a remote context is created with the flags Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY. This allows the client app to remotely load code from YouTub…

  • High 8.0
    CVE-2022-41853 Public exploit

    Remote code execution in HyperSQL DataBase

    Those using java.sql.Statement or java.sql.PreparedStatement in hsqldb (HyperSQL DataBase) to process untrusted input may be vulnerable to a remote code execution attack. By default it is allowed to call any static method of any Java class in the classpath re…

  • Unscored —

    Check Point Endpoint before version E86.50 failed to protect against specific registry change which allowed to disable …

  • Medium —

    Apache Kylin unsafe class loading

    Kylin can receive user input and load any class through Class.forName(...). This issue affects Apache Kylin 2 version 2.6.6 and prior versions; Apache Kylin 3 version 3.1.2 and prior versions; Apache Kylin 4 version 4.0.0 and prior versions.

  • Critical 9.8
    CVE-2021-21985 Exploited · Ransomware Public exploit Scanner template EPSS 100%

    The vSphere Client (HTML5) contains a remote code execution vulnerability due to lack of input validation in the Virtua…

    KEV Nov 3, 2021
  • High 7.5

    A vulnerability of XPlatform could allow an unauthenticated attacker to execute arbitrary command. This vulnerability e…

  • High 7.5

    Use of Externally-Controlled Input to Select Classes or Code in Infinispan

    A vulnerability was found in Infinispan such that the invokeAccessibly method from the public class ReflectionUtil allows any application class to invoke private methods in any class with Infinispan's privileges. The attacker can use reflection to introduce n…

  • Medium 5.6

    It was found that the fix for CVE-2014-0114 had been reverted in JBoss Operations Network 3 (JON). This flaw allows att…

  • Critical 9.8

    Sandbox bypass vulnerability in Jenkins Script Security Plugin

    A sandbox bypass vulnerability in Jenkins Script Security Plugin 1.55 and earlier allows attackers to invoke arbitrary constructors in sandboxed scripts.

  • Critical 9.8

    Sandbox bypass vulnerability in Jenkins Pipeline: Groovy Plugin

    A sandbox bypass vulnerability in Jenkins Pipeline: Groovy Plugin 2.64 and earlier allows attackers to invoke arbitrary constructors in sandboxed scripts.

  • Critical 9.8

    Deserialization of Untrusted Data in Bouncy castle

    Legion of the Bouncy Castle Legion of the Bouncy Castle Java Cryptography APIs 1.58 up to but not including 1.60 contains a CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') vulnerability in XMSS/XMSS^MT private key d…

  • High 7.0

    Privilege Escalation in Hibernate Validator

    In Hibernate Validator 5.2.x before 5.2.5 final, 5.3.x, and 5.4.x, it was found that when the security manager's reflective permissions, which allows it to access the private members of the class, are granted to Hibernate Validator, a potential privilege esca…