Skip to content

Commit 215346a

Browse files
committed
fix(proxy): validate request path before forwarding to ExApp
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
1 parent 878eeb2 commit 215346a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/Controller/ExAppProxyController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,12 @@ private function prepareProxy(
236236
string $appId, string $other, array &$route, array &$bruteforceProtection, int &$delay,
237237
): ?ExApp {
238238
$delay = 0;
239+
if (preg_match('#(?:^|/|%2[fF])(?:\.|%2[eE]){2}(?:/|%2[fF]|$)#', $other) === 1) {
240+
$this->logger->debug(
241+
sprintf('Returning status 404 for "%s": path contains a parent-directory segment.', $other)
242+
);
243+
return null;
244+
}
239245
$exApp = $this->exAppService->getExApp($appId);
240246
if ($exApp === null) {
241247
$this->logger->debug(

0 commit comments

Comments
 (0)