Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') Affecting code16/sharp package, versions <9.23.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.43% (38th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PHP-CODE16SHARP-22606118
  • published19 Nov 2026
  • disclosed17 Nov 2026
  • creditAvinash Jangir

Introduced: 17 Nov 2026

NewCVE-2026-84974  (opens in a new tab)
CWE-470  (opens in a new tab)

How to fix?

Upgrade code16/sharp to version 9.23.0 or higher.

Overview

Affected versions of this package are vulnerable to Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') via the embed_key parameter in the getEmbedFromKey function within HandlesEmbed.php, which passes the attacker-supplied value directly to the Laravel service container without validating that it extends SharpFormEditorEmbed. An authenticated attacker can submit an arbitrary PHP class name to multiple embed API endpoints, causing the container to invoke that class's __construct() method and recursively resolve all constructor dependencies. This can result in unauthorized integrity or availability effects, though the attacker cannot supply constructor parameter values or invoke arbitrary methods beyond instantiation.

CVSS Base Scores

version 4.0
version 3.1