Use of Externally-Controlled Input to Select Classes or Code
CWE-470
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.
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.
We track 102 vulnerabilities of this type. 100% are rated high or critical, and the average CVSS score is 8.5. 2 have been exploited in real attacks.
How this weakness is prevented
- 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.
Latest Use of Externally-Controlled Input to Select Classes or Code vulnerabilities
- 7.1 High severity
amazon-braket-schemas: Use of Externally-Controlled Input to Select Classes or Code
Unsafe reflection in the error mitigation schema validation in Amazon Braket Schemas before 1.32.2 might allow a remote authenticated user with S3 write access to the quantum task output location to execute arbitrary code on any machine that retrieves the quan
- 8.1 High severity
Apache Storm Nimbus: Use of Externally-Controlled Input to Select Classes or Code
Description Nimbus instantiates the class named by a topology's `topology.scheduler.strategy` when scheduling it. The allowlist intended to constrain that choice, `nimbus.scheduler.strategy.class.whitelist`, was treated as "allow any class" when unset, and it
- 9.8 Critical severity
Apache Axis 1.x (EOL): Use of Externally-Controlled Input to Select Classes or Code
** UNSUPPORTED WHEN ASSIGNED ** Deserialization of an inbound SOAP fault in Apache Axis 1.x allows unauthenticated remote class instantiation. When a SOAP <Fault> carries a <detail><exceptionName> element, Axis loads the named class and, if a String <data> ele
- 7.5 High severity
Apache OFBiz: Use of Externally-Controlled Input to Select Classes or Code
Improper Authorization in ContentWorker in Apache OFBiz 24.09 before 24.09.08 on all platforms allows a remote unauthenticated attacker to trigger arbitrary OFBiz service invocation with attacker-controlled parameters, resulting in arbitrary file write, arbitr
- 10.0 Critical severity
Apache Juneau: Use of Externally-Controlled Input to Select Classes or Code
Improper control of dynamically-loaded code vulnerability in Apache Juneau. When Apache Juneau parses a value into a property of type java.lang.Class (including parameterized forms), the default class swap loaded the named class with initialization enabled, so
- 8.1 High severity
amazon-redshift-jdbc-driver: Use of Externally-Controlled Input to Select Classes or Code
Unsafe reflection in the connection parameter and credentials profile handling of Amazon Redshift JDBC Driver before 2.3.0 might allow an actor who can influence the JDBC connection URL or the AWS credentials profile to execute arbitrary code in the applicatio
- 9.8 Critical severity
System Manager: Improper Control of Generation of Code
Remote Code Execution in the `IModular.exe` URI handler in INFINITT Healthcare Co., Ltd. INFINITT PACS allows a remote unauthenticated attacker to invoke unintended application functionality and potentially execute arbitrary code via a crafted `imodular:// URI
- 7.8 High severity
MONAI: Use of Externally-Controlled Input to Select Classes or Code
MONAI from 1.6.0 before 1.6.1 contains a remote code execution vulnerability in Auto3DSeg algo_from_json() that allows attackers to run Python code via a crafted work directory's algo_object.json. Attackers can ship a malicious algorithm_templates module plus
- 8.1 High severity
Entity List: Use of Externally-Controlled Input to Select Classes or Code
Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') vulnerability in Drupal Entity List allows Reflection Injection. This issue affects Entity List versions: from 0.0.0 to 3.0.10.
- 8.1 High severity
Drupal core: Use of Externally-Controlled Input to Select Classes or Code
Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') vulnerability in Drupal Drupal core allows Reflection Injection. This issue affects Drupal core versions: from 8.9.0 to 10.6.19, from 11.0.0 to 11.3.19, from 11.4.0 to 11.4.10,
- 8.1 High severity
agno: Use of Externally-Controlled Input to Select Classes or Code
Agno through 3.1.11 contains an unsafe reflection vulnerability in PandasTools that allows attackers to invoke arbitrary pandas functions by supplying model-controlled function names to getattr(). Attackers can use prompt injection to make the agent call panda
- 9.8 Critical severity
mlflow: Improper Control of Generation of Code
MLflow is an open source AI engineering platform for agents, large language models, and machine learning models. From 3.12.0rc0 until 3.17.0, third-party scorer deserialization in mlflow/genai/scorers/base.py accepts request-selected descendants of THIRD_PARTY
- 9.9 Critical severity
postiz-app: External Control of File Name or Path
Postiz lets a signed-in user ask the backend to run a function on one of their connected channels. The backend did not restrict which functions can be requested, so a user could call internal helper functions that were never meant to be reachable from the web
- 7.6 High severity
Royal Elementor Addons: Use of Externally-Controlled Input to Select Classes or Code
Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') vulnerability in WProyal Royal Elementor Addons royal-elementor-addons allows Code Injection.This issue affects Royal Elementor Addons: from n/a through 1.7.1068.
- 8.8 High severity
CrewAI: Use of Externally-Controlled Input to Select Classes or Code
CrewAI crewAI Framework Agent Loading Unsafe Reflection Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of CrewAI crewAI. User interaction is required to exploit this vulnerabi
- 7.3 High severity
speaches: Use of Externally-Controlled Input to Select Classes or Code
A security vulnerability has been detected in speaches-ai speaches up to 0.9.0-rc.3. This vulnerability affects the function PyannoteDiarizationModelManager._load_fn of the file src/speaches/executors/pyannote_diarization.py of the component Pyannote Diarizati
- 9.8 Critical severity
Apache Johnzon: Use of Externally-Controlled Input to Select Classes or Code
Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') vulnerability in Apache Johnzon. ClassConverter loads & static-initializes an attacker-named class from untrusted JSON. This issue affects Apache Johnzon: from 1.0.0 before 2.2.
- 7.0 High severity
openGauss-connector-jdbc: Use of Externally-Controlled Input to Select Classes or Code
在 openGauss-connector-jdbc 的 pgjdbc/src/main/java/org/postgresql/log/LogFactory.java 中,LogFactory 根据 JDBC 连接参数中的 logger 类名调用 Class.forName 加载类后,直接反射调用以 String 为参数的构造函数,再转换为 Log。缺少 asSubclass(Log.class) 校验,非 Log 实现类也会在类型检查前被实例化。因此,当攻击者可控制 JDBC URL 或连接属性中的 logge
- 8.5 High severity
tuxguitar: Improper Control of Generation of Code
TuxGuitar is an open-source guitar tablature editor. Prior to 2.1.0, an untrusted .tg file can set gervil.soundbank.path to reference an on-disk archive, including the .tg file itself, whose META-INF/services/javax.sound.midi.Soundbank entry names an attacker-
- 8.8 High severity
openPDC: Use of Externally-Controlled Input to Select Classes or Code
A component loading mechanism in openPDC and openHistorian will construct and run any specified type, which may be an invalid component to load. An attacker with an authenticated user account and the ability to place a file on the host filesystem can use this
- 7.7 High severity
backstage: Permissive List of Allowed Inputs
Backstage is an open framework for building developer portals. Prior to 1.14.6, the @backstage/plugin-techdocs-node package is affected by remote code execution via crafted markdown_extensions in techdocs mkdocs.yml. An authenticated user who can register cata
- 7.8 High severity
hydra: Use of Externally-Controlled Input to Select Classes or Code
Hydra is a framework for elegantly configuring complex applications. From 1.2.0 until 1.3.0 and 1.4.0.dev10, the hydra-optuna-sweeper package accepts a configuration-controlled dotted path in hydra.sweeper.custom_search_space, resolves it with hydra.utils.get_
- 8.5 High severity
hydra: Use of Externally-Controlled Input to Select Classes or Code
Hydra is a framework for elegantly configuring complex applications. From 1.3.4 until 1.3.7 and 1.4.0.dev10, Hydra stores legacy instantiate target blocklists and related execution-policy collections in mutable module-level state. An attacker who controls mult
- 7.5 High severity
scrapy: Use of Externally-Controlled Input to Select Classes or Code
Scrapy is a high-level web crawling and scraping framework for Python. From 1.4.0 until 2.14.2, RefererMiddleware in scrapy/spidermiddlewares/referer.py treated a Referrer-Policy response-header value that resembled a Python import path as a referrer policy cl
- 7.2 High severity
Email Protection Gateway: Use of Externally-Controlled Input to Select Classes or Code
Kiteworks Email Protection Gateway before version 9.5.0 is vulnerable to Unsafe Reflection and does not sufficiently restrict the code that the mail-processing pipeline could load from an imported rule configuration. An authenticated administrator with mail-ru
- 10.0 Critical severity
kobako: Improper Control of Generation of Code
Kobako is a Ruby gem that embeds a Wasm-isolated mruby interpreter inside applications, allowing execution of untrusted Ruby scripts (LLM-generated code, user formulas, student submissions, third-party plugins) in-process without giving them access to host mem
- 7.8 High severity
gluonts: Use of Externally-Controlled Input to Select Classes or Code
Deserialization of untrusted data in the model loading component in Amazon GluonTS before 0.17.0 might allow context-dependent attackers to execute arbitrary operating system commands with the privileges of the loading process via a crafted serialized model di
- 8.2 High severity
Red Hat JBoss Enterprise Application Platform…: Use of Externally-Controlled Input to Select Classes or Code
Apache ActiveMQ Artemis before 2.34.0 contains an unsafe reflection vulnerability in FederationStreamConnectMessage.getFederationPolicy(). The method calls Class.forName(clazz).getConstructor().newInstance() where clazz is read directly from the CORE protocol
- 7.5 High severity
Financial Transaction Manager (FTM) for RedHat…: Use of Externally-Controlled Input to Select Classes or Code
IBM Financial Transaction Manager (FTM) for RedHat OpenShift could allow a remote attacker to cause a denial of service due to the improper use of reflection with externally controlled input.
- 8.8 High severity
Apache Calcite Avatica: Use of Externally-Controlled Input to Select Classes or Code
Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') vulnerability in Apache Calcite Avatica. Plugin instantiation (via AvaticaUtils#instantiatePlugin and other methods) initializes arbitrary classes via unrestricted calls to Clas
- 9.8 Critical severity
Mongoid: Use of Externally-Controlled Input to Select Classes or Code
Mongoid contains an unsafe reflection weakness in the query path used for embedded documents. An application that passes an externally supplied field name to certain in-memory query methods may allow an unauthenticated party to obtain unintended disclosure of
- 9.1 Critical severity
Mongoid: Use of Externally-Controlled Input to Select Classes or Code
Mongoid contains an unsafe reflection weakness in the document persistence layer of its object-document mapping code. Input whose keys are passed through from an unauthenticated party by an embedding application can cause unintended internal method invocation
- 8.8 High severity
MQ: Use of Externally-Controlled Input to Select Classes or Code
IBM MQ could allow an authenticated attacker with cluster access to cause a denial of service or potentially execute arbitrary code due to improper validation of cluster command message lengths.
- 7.5 High severity
Dell OpenManage Server Administrator Managed…: Use of Externally-Controlled Input to Select Classes or Code
Dell OpenManage Server Administrator, versions prior to 11.1.0.3, contains a Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') vulnerability. An unauthenticated attacker with remote access could potentially exploit this vulnera
- 8.8 High severity
djust: Use of Externally-Controlled Input to Select Classes or Code
djust provides Phoenix LiveView-style reactive server-side rendering for Django with Rust-powered performance. Prior to version 1.0.7, the djust live transport resolves the LiveView to mount from a client-supplied dotted path by calling `__import__(module_path
- 8.4 High severity
RestrictedPython: Exposure of Sensitive Information to an Unauthorized Actor
RestrictedPython is a tool that helps define a subset of the Python language for accepting program input in a trusted environment. Prior to 8.4, RestrictedPython could allow a sandbox escape when a custom import policy or globals exposed the standard library s
- 8.5 High severity
Jenkins Script Security Plugin: Use of Externally-Controlled Input to Select Classes or Code
Jenkins Script Security Plugin 1415.v9a_f9b_3a_c253d and earlier does not reject @Builder annotations whose builderStrategy member names an arbitrary class, allowing attackers with permission to define and run sandboxed scripts, including Pipelines, to execute
- 8.8 High severity
Apache Airflow Apache Kafka provider: Use of Externally-Controlled Input to Select Classes or Code
Apache Airflow Apache Kafka provider versions 1.15.0 before 2.0.0 resolve dotted-path strings found in a Kafka connection's `extra` field into Python callables via `import_string`, with no allowlist, and hand them to the confluent-kafka client which invokes th
- 9.8 Critical severity
OpenAM: Improper Control of Generation of Code
Open Access Management (OpenAM) is an access management solution. Prior to 16.1.2, the pre-authentication /authservice PLL endpoint accepts a CustomCallback XML element whose className value selects an arbitrary Java class for AuthXMLUtils to load and instanti
- 8.8 High severity
cms: Use of Externally-Controlled Input to Select Classes or Code
A remote, authenticated, non-admin Craft CMS Control Panel user with only the accessCp permission can execute operating system commands as the PHP web worker.