Skip to content

Commit 6b21de8

Browse files
committed
AC-10815 - API Input validation
1 parent 6225e64 commit 6b21de8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ private function getConstructorData(string $className, array $data): array
247247
$parameterType = $this->typeProcessor->getParamType($parameter);
248248

249249
try {
250+
if (strtolower($parameter->getName()) === "sourcedata" && $parameterType === "\Magento\Framework\Simplexml\Element") {
251+
throw new InputException(new Phrase('Request method is invalid.'));
252+
}
253+
250254
$res[$parameter->getName()] = $this->convertValue($data[$parameter->getName()], $parameterType);
251255
} catch (\ReflectionException $e) {
252256
// Parameter was not correclty declared or the class is uknown.

0 commit comments

Comments
 (0)