1 |
From f84233785ddeed01445fc855f3ae1e8a62f167e1 Mon Sep 17 00:00:00 2001 |
2 |
From: Aleksander Machniak <alec@alec.pl> |
3 |
Date: Tue, 22 Nov 2016 10:42:50 +0100 |
4 |
Subject: [PATCH] Fix vulnerability in handling of mail()'s 5th argument |
5 |
|
6 |
--- |
7 |
program/lib/Roundcube/rcube.php | 2 +- |
8 |
1 files changed, 1 insertions(+), 1 deletion(-) |
9 |
|
10 |
diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php |
11 |
index 6660119..69f799a 100644 |
12 |
--- a/program/lib/Roundcube/rcube.php |
13 |
+++ b/program/lib/Roundcube/rcube.php |
14 |
@@ -1542,7 +1542,7 @@ public function deliver_message(&$message, $from, $mailto, &$error, &$body_file |
15 |
if (filter_var(ini_get('safe_mode'), FILTER_VALIDATE_BOOLEAN)) |
16 |
$sent = mail($to, $subject, $msg_body, $header_str); |
17 |
else |
18 |
- $sent = mail($to, $subject, $msg_body, $header_str, "-f$from"); |
19 |
+ $sent = mail($to, $subject, $msg_body, $header_str, '-f ' . escapeshellarg($from)); |
20 |
} |
21 |
} |
22 |
|