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

  • Medium 4.3

    IBM WebSphere Application Server Liberty prior to 26.0.0.11 is affected by multiple vulnerabilities

    IBM WebSphere Application Server Liberty 17.0.0.3 through 26.0.0.10 is affected by an information disclosure vulnerability due to unsafe class reflection in the JMX REST connector body parser.

  • Medium 6.8

    OpenAM before 16.1.4 Insufficient Response Validation in Internal SOAP Channel

    OpenAM before 16.1.4 and its client SDK fail to sufficiently validate responses on the internal server-to-server SOAP channel, allowing network-positioned attackers to affect integrity and availability. Attackers who intercept unencrypted traffic or control a…

  • Unscored —

    Apache Axis 1.x (EOL): unauthenticated remote class instantiation via SOAP fault exceptionName

    ** 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> el…

  • Unscored —

    Apache OFBiz: Content renderer runs a service name stored on the row

    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, arbit…

  • Critical 10.0

    Apache Juneau: Unsafe reflection allows attacker-controlled class initialization during parsing

    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, s…

  • High 8.1

    Remote Code Execution via Unsafe Class Loading in Amazon Redshift JDBC Driver Connection Parameters

    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 applicati…

  • Critical 9.8

    CVE-2026-16306

    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:// UR…

  • High 7.8

    MONAI 1.6.0 before 1.6.1 Code Execution via Auto3DSeg algo_from_json()

    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…

  • High 8.1
    CVE-2026-108097 Public exploit

    Drupal core - Critical - Remote code execution - SA-CORE-2026-014

    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,…

  • High 8.1

    Entity List - Critical - Remote code execution - SA-CONTRIB-2026-218

    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.

  • High 8.1

    Agno through 3.1.11 Code Execution via PandasTools Unsafe Reflection

    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 pand…

  • Critical 9.8
    CVE-2026-116692 Public exploit

    MLflow: Remote code execution on unauthenticated MLflow servers via third-party scorer deserialization importing caller-placed artifact modules

    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_PART…

  • Critical 9.9

    Arbitrary file read and backend crash through unrestricted provider method calls

    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…

  • Medium 6.5

    MLflow: SSRF on unauthenticated MLflow servers via third-party scorer kwargs in the scorer invoke, register, and GenAI evaluate endpoints

    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, the scorer invoke, register, and GenAI evaluate endpoints, including unauthenticated POST /ajax-api/3.0/mlflow/scorer…

  • Low 3.3

    hydra-ray-launcher 1.1.0.dev1 before 1.2.2 and 1.4.0.dev4 before 1.4.0rc2 Arbitrary Module Import

    hydra-ray-launcher 1.1.0.dev1 before 1.2.2 and 1.4.0.dev4 before 1.4.0rc2 contains an arbitrary module import vulnerability via the ray_pkg_version OmegaConf resolver passing input to importlib.import_module(). Attackers controlling configuration values or co…

  • High 7.6

    WordPress Royal Elementor Addons plugin <= 1.7.1068 - Arbitrary Code Execution vulnerability

    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.

  • Medium 6.3

    Grav 2.0.0 before 2.2.5 Unauthorized Page Deletion via Flex Form Directives

    Grav from 2.0.0 before 2.2.5 contains an improper access control vulnerability in FlexDirectory::dynamicFlexField() that allows page authors to call arbitrary Flex object methods via flex-*@ directives in page frontmatter. When a user with page edit rights op…

  • Medium 6.5

    Laravel relationship inclusion can trigger unauthorized data destruction

    Laravel is a web application framework. From 12.45.0 until 12.68.0 and 13.27.0, crafted relationship inclusion on a read-only endpoint can trigger a destructive database operation on a related table instead of retrieving data. A user with read access but no w…

  • High 8.8

    CrewAI crewAI Framework Agent Loading Unsafe Reflection Remote Code Execution Vulnerability

    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 vulnerab…

  • High 7.3

    speaches-ai speaches Pyannote Diarization Model Loading pyannote_diarization.py PyannoteDiarizationModelManager._load_fn 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 Diarizat…

  • Critical 9.8

    Apache Johnzon: ClassConverter loads & static-initializes an attacker-named class from untrusted JSON

    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…

  • High 7.0

    JDBC LogFactory 任意类加载/构造导致潜在 RCE

    在 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 或连接属性中的 logg…

  • Medium 6.3

    unslothai unsloth sentence_transformer.py externally-controlled input to select classes or code

    A weakness has been identified in unslothai unsloth up to 0.1.501-beta. This affects the function FastSentenceTransformer._is_transformer_module_ref of the file unsloth/models/sentence_transformer.py. This manipulation of the argument Type causes use of exter…

  • High 8.5

    TuxGuitar: Arbitrary Code Execution via maliciously crafted `.tg` file

    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…

  • Medium 6.9

    Nexus Repository 3 - Unsafe Reflection in ExtDirect Repository Endpoint

    Sonatype Nexus Repository 3 allows an unauthenticated remote attacker to supply attacker-controlled input to a Java class loading call through an ExtDirect endpoint. This allows the attacker to learn whether specific classes are present in the application. Th…

  • High 8.8

    Grid Protection Alliance openPDC and openHistorian 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…

  • Medium 6.9

    Apache Jackrabbit: DavEx client runs Class.forName + (String)-constructor on server-controlled error bodies

    — Use of Externally-Controlled Input to Select Classes or Code vulnerability in Apache Jackrabbit's WebDAV/Davex client. A malicious WebDAV/DavEx server, or an attacker able to intercept the connection, can cause the client to instantiate arbitrary classes fr…

  • High 7.7

    Backstage: Remote code execution via crafted markdown_extensions in TechDocs mkdocs.yml

    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 cat…

  • High 7.8

    Hydra: Optuna custom_search_space can resolve and execute untrusted callables via get_method

    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…

  • High 8.5

    Hydra: Mutable instantiate policy sets allow target blocklist bypass

    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 mul…

  • High 7.5

    Scrapy: Arbitrary Module Import via Referrer-Policy Header in RefererMiddleware

    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 c…

  • Medium 6.5

    WordPress Unlimited Elements For Elementor (Free Widgets, Addons, Templates) plugin <= 2.0.22 - Broken Access Control vulnerability

    Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') vulnerability in Unlimited Elements Unlimited Elements For Elementor (Free Widgets, Addons, Templates) unlimited-elements-for-elementor allows Parameter Injection.This issue af…

  • Critical 9.1

    YAML versions before 1.30 for Perl allow a loaded document to trigger the DESTROY method of arbitrary classes

    YAML versions before 1.30 for Perl allow a loaded document to trigger the DESTROY method of arbitrary classes. A perl/hash:Class tag blesses a hash into the class it names. The document supplies the object's fields, and Perl calls DESTROY when it goes out of …

  • High 7.2

    Kiteworks Email Protection Gateway unsafe reflection

    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-r…

  • Critical 10.0

    Kobako Vulnerable to Sandbox Escape: guest eval reaches host RCE via method_missing → public_send (any bound Service)

    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 me…

  • Low 2.2

    Moodle: arbitrary class instantiation via report builder audience classname

    A flaw was found in Moodle. An authenticated attacker can supply an improperly validated audience class name to the Report Builder component, allowing arbitrary class instantiation. This vulnerability enables the unauthorized creation of internal program obje…

  • High 7.8

    GluonTS arbitrary command execution during model deserialization

    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 d…

  • Medium 6.5

    Streamshub/console: console-operator: streams for apache kafka console: unfiltered kafka client properties → sa-token exfiltration via config.providers

    A flaw was found in the StreamsHub Console for Apache Kafka. Tenant-supplied Kafka client properties from the Console custom resource are copied into the console-api AdminClient configuration without filtering security-sensitive keys, allowing a Console CR au…

  • High 8.2

    Artemis-core-client: unsafe reflection in apache activemq artemis federation message deserialization

    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…

  • Medium 6.4

    Frappe ERPNext before 16.34.1 Unauthorized Method Invocation

    Frappe ERPNext versions before 16.34.1 fail to validate that Financial Report Template calculation_formula values reference whitelisted methods before passing them to frappe.call(). Accounts Managers can supply arbitrary dotted Python paths to invoke non-whit…