Skip to content

Commit

Permalink
[Security] prevent user to input multiline value
Browse files Browse the repository at this point in the history
Since the configuration module write the value as tsconfig in the sysfolder,
it was possible for user to send multiline value through the module. This fix will
ignore multiline value and only saves first line as tsconfig value
  • Loading branch information
kartolo committed Nov 24, 2023
1 parent 3a9cef7 commit 634a54c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Classes/Utility/TsUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ public function updatePagesTSconfig(int $id, array $pageTs, string $tsConfPrefix
}
$set = [];
foreach ($pageTs as $f => $v) {
$v = trim($v);
// only get the first line of input and ignore the rest
$v = strtok(trim($v), "\r\n");
// if token is not found (false)
if ($v === false) {
// then set empty string
$v = '';
}
$f = $tsConfPrefix . $f;
$tempF = isset($impParams[$f]) ? trim($impParams[$f]) : '';
if (strcmp($tempF, $v)) {
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'author_company' => 'd.k.d Internet Service GmbH',
'state' => 'stable',
'clearcacheonload' => 0,
'version' => '9.5.1',
'version' => '9.5.2',
'constraints' => [
'depends' => [
'typo3' => '11.5.0-11.99.99',
Expand Down

0 comments on commit 634a54c

Please sign in to comment.