Skip to content

Instantly share code, notes, and snippets.

@LouisdeLooze
Last active September 9, 2025 14:43
Show Gist options
  • Select an option

  • Save LouisdeLooze/5ac21a88ead57e747569cdb08bd60011 to your computer and use it in GitHub Desktop.

Select an option

Save LouisdeLooze/5ac21a88ead57e747569cdb08bd60011 to your computer and use it in GitHub Desktop.
Hotfix for CVE-2025-54236
diff --git a/vendor/magento/framework/Webapi/ServiceInputProcessor.php b/vendor/magento/framework/Webapi/ServiceInputProcessor.php
index ba58dc2bc7acf..06919af36d2eb 100644
--- a/vendor/magento/framework/Webapi/ServiceInputProcessor.php
+++ b/vendor/magento/framework/Webapi/ServiceInputProcessor.php
@@ -246,6 +246,13 @@ private function getConstructorData(string $className, array $data): array
if (isset($data[$parameter->getName()])) {
$parameterType = $this->typeProcessor->getParamType($parameter);
+ // Allow only simple types or Api Data Objects
+ if (!($this->typeProcessor->isTypeSimple($parameterType)
+ || preg_match('~\\\\?\w+\\\\\w+\\\\Api\\\\Data\\\\~', $parameterType) === 1
+ )) {
+ continue;
+ }
+
try {
$res[$parameter->getName()] = $this->convertValue($data[$parameter->getName()], $parameterType);
} catch (\ReflectionException $e) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment