diff --git a/ChangeLog b/ChangeLog index 45cffd23507..edc1c0a139d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,7 +31,9 @@ The following changes may create regressions for some external modules, but were ***** ChangeLog for 23.0.3 compared to 23.0.2 ***** FIX: IDOR on messaging.php - credit Aksoum Abderrahmane FIX: Some remaining cross-customer object creation on API (proposal, orders) - credit Mitch311 -FIX: Set the default seed key EVENTORGANIZATION_SECUREKEY at module - credit Shunsuke Hashimoto (@futabato) +SEC: Set the default seed key EVENTORGANIZATION_SECUREKEY at module install - credit Shunsuke Hashimoto (@futabato) +SEC: Better sanitization param for GETPOST of htmlheader of website page - See commit bbbbb56c6455514dcd0acca53afc17a92ed21bb9 + ***** ChangeLog for 23.0.2 compared to 23.0.1 ***** diff --git a/htdocs/admin/security_headers_http.php b/htdocs/admin/security_headers_http.php index 0787bcba321..4260f5b43de 100644 --- a/htdocs/admin/security_headers_http.php +++ b/htdocs/admin/security_headers_http.php @@ -168,7 +168,9 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { $securitycspstring = ""; if ($sourcetype == "data") { $forceCSPArr[$directivecsp][] = "data:".$sourcedatacsp; - } elseif ($sourcetype == "input") { + } elseif (isset($sourcetype) && $sourcetype == "blob") { + $forceCSPArr[$directivecsp][] = "blob:".$sourcedatacsp; + } elseif (isset($sourcetype) && $sourcetype == "input") { if (empty($forceCSPArr[$directivecsp])) { $forceCSPArr[$directivecsp] = array(); } diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index b9d14ac8333..f4ce72329c7 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -527,7 +527,7 @@ class DolEditor $out .= 'jQuery(document).ready(function() {'; $out .= ' jQuery(".buttonforacesave").click(function() { - console.log("We click on savefile button for component '.dol_escape_js($this->htmlname).'"); + console.log("We click on button (with class .buttonforacesave) that must fill ace fields for component '.dol_escape_js($this->htmlname).'"); var aceEditor = window.ace.edit("'.dol_escape_js($this->htmlname).'aceeditorid"); if (aceEditor) { var cursorPos = aceEditor.getCursorPosition(); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index c88880cde0c..998baf7ac74 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1516,6 +1516,7 @@ class FormMail extends Form * @param string $htmlContent HTML name of WYSIWYG field to fill once layout has been chosen * @param string $showlinktolayout Show link to layout * @return string HTML for model email boxes + * @see getContentPageTemplate() */ public function getEmailLayoutSelector($htmlContent = 'message', $showlinktolayout = 'email') { diff --git a/htdocs/core/class/html.formwebsite.class.php b/htdocs/core/class/html.formwebsite.class.php index 9bc9d5fe8e1..f2ac69198f6 100644 --- a/htdocs/core/class/html.formwebsite.class.php +++ b/htdocs/core/class/html.formwebsite.class.php @@ -349,6 +349,7 @@ class FormWebsite * * @param string $htmlContent HTML name of WYSIWYG field * @return string HTML for model page boxes + * @see getEmailLayoutSelector() */ public function getContentPageTemplate($htmlContent = 'message') { @@ -359,8 +360,12 @@ class FormWebsite require_once DOL_DOCUMENT_ROOT.'/core/lib/emaillayout.lib.php'; $listofsamples = dol_dir_list(DOL_DOCUMENT_ROOT.'/website/samples', 'files', 0, '^page-sample-.*\.html$'); - $arrayofsamples = array(); - $arrayofsamples['empty'] = 'EmptyPage'; // Always this one first + + // Define list of layouts to use + $arrayofsamples = array( + 'empty' => 'EmptyPage', + ); + foreach ($listofsamples as $sample) { $reg = array(); if (preg_match('/^page-sample-(.*)\.html$/', $sample['name'], $reg)) { @@ -391,7 +396,7 @@ class FormWebsite $contentHtml = file_exists($pathtoTemplateFile) ? make_substitutions(@file_get_contents($pathtoTemplateFile), $substitutionarray) : ''; $out .= '
'; - $out .= ''.$template.''; + $out .= ''.$template.''; $out .= ''.($template != 'text' ? ucfirst($template) : ucfirst($templateFunction)).''; $out .= '
'; } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 517ddd6e271..6411daa27cd 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -2245,6 +2245,7 @@ function GetContentPolicySources() // Fetch directives "fetch" => array( "*" => array("label" => "*", "data-sourcetype" => "select"), + "blob" => array("label" => "blob:", "data-sourcetype" => "blob"), "data" => array("label" => "data:", "data-sourcetype" => "data"), "self" => array("label" => "self", "data-sourcetype" => "quoted"), "unsafe-eval" => array("label" => "unsafe-eval", "data-sourcetype" => "quoted"), diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index e628c3d3791..5fb1dbbfa93 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -625,12 +625,12 @@ if ($conf->use_javascript_ajax) { } print ''; -if (getDolGlobalInt('STRIPE_AUTO_RECORD_PAYOUT')) { - print ''; - print $langs->trans("StripeUserAccountForActions").''; - print img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers(getDolGlobalString('STRIPE_USER_ACCOUNT_FOR_ACTIONS'), 'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0); - print ''; +print ''; +print $langs->trans("StripeUserAccountForActions").''; +print img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers(getDolGlobalString('STRIPE_USER_ACCOUNT_FOR_ACTIONS'), 'STRIPE_USER_ACCOUNT_FOR_ACTIONS', 0); +print ''; +if (getDolGlobalInt('STRIPE_AUTO_RECORD_PAYOUT')) { print ''; print $langs->trans("BankAccountForBankTransfer").''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index b3583a45f9c..4a66a7f97d6 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -279,13 +279,28 @@ class WebsitePage extends CommonObject // Remove spaces and be sure we have main language only $this->lang = preg_replace('/[_-].*$/', '', trim($this->lang)); // en_US or en-US -> en + // Check there is no PHP into HTML header + $dataposted = trim($this->htmlheader); // Must accept tags like '