Skip to content

Commit 1c69f4b

Browse files
committed
[Security] prevent user to input multiline value
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
1 parent fb06570 commit 1c69f4b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Classes/DirectMailUtility.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,6 +1625,14 @@ public static function updatePagesTSconfig($id, array $pageTs, $tsConfPrefix, $i
16251625
}
16261626
$set = array();
16271627
foreach ($pageTs as $f => $v) {
1628+
// only get the first line of input and ignore the rest
1629+
$v = strtok(trim($v), "\r\n");
1630+
// if token is not found (false)
1631+
if ($v === false) {
1632+
// then set empty string
1633+
$v = '';
1634+
}
1635+
16281636
$f = $tsConfPrefix . $f;
16291637
if ((!isset($impParams[$f]) && trim($v)) || strcmp(trim($impParams[$f]), trim($v))) {
16301638
$set[$f] = trim($v);

ext_emconf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'description' => 'Advanced Direct Mail/Newsletter mailer system with sophisticated options for personalization of emails including response statistics.',
1616
'category' => 'module',
1717
'shy' => 0,
18-
'version' => '6.0.2',
18+
'version' => '6.0.3',
1919
'dependencies' => 'cms,tt_address',
2020
'conflicts' => 'sr_direct_mail_ext,it_dmail_fix,plugin_mgm,direct_mail_123',
2121
'priority' => '',

0 commit comments

Comments
 (0)