PatchClock

PHP security digest · 12 Nov 2026

code16/sharp: Arbitrary class instantiation through the embed_key API parameter

Medium CVE-2026-84974

Package
code16/sharp
Fixed in
9.23.0, 10.0.0-beta.4
Published
Thu 12 Nov 2026, 18:18 LisbonUpdated Tue 17 Nov 2026, 00:45 Lisbon
Installs on Packagist
71K

In plain words

An authenticated attacker can use the embed_key parameter on multiple API endpoints to make the Laravel container instantiate any class in the PHP application. This calls the class's constructor and resolves its constructor dependencies. The attacker cannot supply parameter values or call arbitrary methods.

Affected versions

PackageAffectedFixed in
code16/sharp< 9.23.09.23.0
code16/sharp>= 10.0.0-beta.1, < 10.0.0-beta.410.0.0-beta.4

How serious is it?

Medium is a CVSS score of 4.0 to 6.9: real impact, but the attacker needs something first, such as an account, a particular setting or a user who clicks a link. If your site meets that condition, treat it as High; if not, ship the fix in your next planned release.

code16/sharp has 71K installs on Packagist, so the advisory reaches a modest number of projects, which does not make yours any safer.

Am I affected?

Check the code16/sharp version in composer.lock: versions below 9.23.0, and versions from 10.0.0-beta.1 up to but not including 10.0.0-beta.4, are affected. The described attack requires authentication and uses the embed_key API parameter; no additional configuration or database condition is named. Fixed versions are 9.23.0 and 10.0.0-beta.4.

Did you install code16/sharp, or did a dependency?

Composer says why a package is in your project:

composer why code16/sharp

If the output names your own project, you required code16/sharp directly and the update is yours to make. If it names another package, code16/sharp came in through it, and that package's version constraint decides which release you can install. To see what stands between you and the fix, ask Composer directly:

composer why-not code16/sharp 9.23.0

Every line it prints is a constraint that blocks 9.23.0. Update the package it names, or raise your own constraint, and run it again until it prints nothing. If you stay on an older branch, ask about its fix instead: 10.0.0-beta.4.

What to do

Check which version you have, then update to a fixed release for your branch (9.23.0, 10.0.0-beta.4):

composer show code16/sharp | grep versions
composer update code16/sharp

If your version constraint in composer.json keeps you below a fixed release, raise it first. Whether your configuration is affected, and the exact version ranges, are in the advisory itself.

Check the whole project at once

Composer 2.4 and later can list every installed package with a known advisory, this one included once Packagist has it:

composer audit --locked

--locked reads composer.lock instead of the vendor folder, so you can run it on a release tag or in CI without installing anything. It exits with a non-zero code when it finds an advisory, which is enough to fail a build. Run it on every branch you still support, not only the newest: an older release your customers run is affected in the same way.

Under the Cyber Resilience Act

CRA Article 14 timeline: aware of exploitation at hour 0, early warning within 24 hours, notification within 72 hours, final report within 14 days after the fix.

No exploitation of this vulnerability is known, so on its own it does not start the Article 14 reporting clock, which covers actively exploited vulnerabilities. That changes if you learn it is being exploited through your product: then the 24-hour early warning applies.

Either way, if code16/sharp ships inside a product you sell, the CRA treats its vulnerabilities as yours. Article 13(5) asks for due diligence on the components you include, and from 11 December 2027 Annex I asks you to ship security fixes without delay and free of charge for the support period you declared. A short note in your changelog saying which release updated code16/sharp, and why, is the evidence you will want later.

What goes in each Article 14 report · Does the CRA apply to your product?

code16/sharp's record

This is one of 4 advisories for code16/sharp in the digest, the first published on 25 September 2026. A package with several advisories is not worse than one with none, which often just means nobody looked; it does tell you to keep it on your update list and to run composer audit after each update.

Other advisories for code16/sharp

  • CVE-2026-84987 · 12 Nov 2026 · Medium · fixed in 9.23.0, 10.0.0-beta.4 code16/sharp: Server-side request forgery through an unanchored autocomplete endpoint check
  • CVE-2026-61823 · 25 Sep 2026 · High · fixed in 9.22.5 code16 Sharp vulnerable to stored XSS via iframe srcdoc Attribute
  • CVE-2026-61825 · 25 Sep 2026 · High · fixed in 9.22.5 code16/sharp has a stored XSS via data-html-content Sanitizer Bypass

The advisory's description

Impact

An authenticated attacker can instantiate any class in the PHP application by using the embed_key parameter across multiple API endpoints. The instantiation is performed by the Laravel container. As a result, the __construct() method of the class is called and all constructor dependencies are resolved. The attacker cannot specify parameter values and cannot call any arbitrary method.

Patches

The problem has been patched in 9.23.0 and pre-release version 10.0.0-beta.4. An additional check was added to verify that embed_key is a class extending SharpFormEditorEmbed before any instantiation.

Workarounds

No known workarounds.

Weakness: CWE-470 Use of Externally-Controlled Input to Select Classes or Code. Reported by The4v1.

The advisory

From OSV.dev, which gathers the GitHub Advisory Database, FriendsOfPHP and Drupal security advisories; the summary is theirs. The description, affected versions, weakness and credits are from the GitHub Advisory Database (CC BY 4.0). "In plain words", "Am I affected?" and "If you cannot update yet" are based on that advisory, and checked to name no version it does not.