Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1557840 - (CVE-2018-8741) CVE-2018-8741 SquirrelMail: Directory traversal flaw in Deliver.class.php can allow a remote attacker to retrieve or delete arbitrary files
CVE-2018-8741 SquirrelMail: Directory traversal flaw in Deliver.class.php can...
Status: CLOSED WONTFIX
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
high Severity high
: ---
: ---
Assigned To: Red Hat Product Security
impact=important,public=20180315,repo...
: Security
Depends On: 1557841 1557842 1560341 1560342
Blocks: 1557843
  Show dependency treegraph
 
Reported: 2018-03-18 23:56 EDT by Sam Fowler
Modified: 2018-03-26 11:44 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-03-26 11:44:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sam Fowler 2018-03-18 23:56:11 EDT
SquirrelMail through version 1.4.22 is vulnerable to a directory traversal flaw in the handling of the $message->att_local_name field in Deliver.class.php. A remote attacker that first authenticates to the application could exploit this to retrieve or delete arbitrary files via mail attachment.


External References:

https://insinuator.net/2018/03/squirrelmail-full-disclosure-troopers18/
http://www.openwall.com/lists/oss-security/2018/03/17/2


Upstream Issue:

https://sourceforge.net/p/squirrelmail/bugs/2846/
Comment 1 Sam Fowler 2018-03-18 23:56:34 EDT
Created squirrelmail tracking bugs for this issue:

Affects: fedora-all [bug 1557842]
Affects: epel-all [bug 1557841]
Comment 2 Pedro Yóssis Silva Barbosa 2018-03-23 17:09:52 EDT
Is it really a bug? The report states that 

"The reference to $message->att_local_name in line 284 is controlled by the attacker."

But I am not able to confirm that. The value of $message->att_local_name is generated randomly. In src/compose.php:

$localfilename = GenerateRandomString(32, '', 7);
$full_localfilename = "$hashed_attachment_dir/$localfilename";
while (file_exists($full_localfilename)) {
    $localfilename = GenerateRandomString(32, '', 7);
    $full_localfilename = "$hashed_attachment_dir/$localfilename";
}
$fp = fopen ("$hashed_attachment_dir/$localfilename", 'wb');

$message->att_local_name = $localfilename;

By default, these files are stored in /var/spool/squirrelmail/attach.
Comment 3 Doran Moppert 2018-03-25 20:51:50 EDT
In reply to comment 2:
> Is it really a bug? The report states that 
> 
> "The reference to $message->att_local_name in line 284 is controlled by the
> attacker."
> 
> But I am not able to confirm that. The value of $message->att_local_name is
> generated randomly. In src/compose.php:

att_local_name is generated randomly, but it then passes through attacker control as a hidden form field.

src/compose.php:
1356:        addHidden('attachments', serialize($attach_array)) : '').
..
114:sqgetGlobalVar('attachments',           $attachments,           SQ_POST);
320:        if (!empty($attachments)) 
321:            $attachments = unserialize($attachments);
Comment 4 Doran Moppert 2018-03-25 21:06:03 EDT
Statement:

Red Hat Enterprise Linux 5 is now in Extended Life Phase of the support and maintenance life cycle. This issue is not currently planned to be addressed in future updates. For additional information, refer to the Red Hat Enterprise Linux Life cycle: https://access.redhat.com/support/policy/updates/errata/.
Comment 5 Doran Moppert 2018-03-25 21:06:29 EDT
Created squirrelmail tracking bugs for this issue:

Affects: fedora-all [bug 1560341]
Affects: epel-all [bug 1560342]

Note You need to log in before you can comment on or make changes to this bug.