From f84233785ddeed01445fc855f3ae1e8a62f167e1 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 22 Nov 2016 10:42:50 +0100 Subject: [PATCH] Fix vulnerability in handling of mail()'s 5th argument --- CHANGELOG | 1 + program/lib/Roundcube/rcube.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 81dc529d9..8bc0fb631 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix vulnerability in handling of mail()'s 5th argument - Fix To: header encoding in mail sent with mail() method (#5475) - Fix flickering of header topline in min-mode (#5426) - Fix bug where folders list would scroll to top when clicking on subscription checkbox (#5447) diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php index 66601196e..69f799ab8 100644 --- a/program/lib/Roundcube/rcube.php +++ b/program/lib/Roundcube/rcube.php @@ -1689,7 +1689,7 @@ class rcube if (filter_var(ini_get('safe_mode'), FILTER_VALIDATE_BOOLEAN)) $sent = mail($to, $subject, $msg_body, $header_str); else - $sent = mail($to, $subject, $msg_body, $header_str, "-f$from"); + $sent = mail($to, $subject, $msg_body, $header_str, '-f ' . escapeshellarg($from)); } }