Bug 22068 - memcached new security issue CVE-2017-9951
Summary: memcached new security issue CVE-2017-9951
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 6
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL:
Whiteboard: MGA5TOO MGA5-32-OK MGA5-64-OK MGA6-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2017-11-22 19:30 CET by David Walser
Modified: 2017-12-02 00:14 CET (History)
13 users (show)

See Also:
Source RPM: memcached-1.4.25-2.mga6.src.rpm
CVE:
Status comment:


Attachments

Description David Walser 2017-11-22 19:30:43 CET
Fedora has issued an advisory today (November 22):
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/EGQ5CRXRSHTKFUB5MCASDOTTZT7YR6IR/

The issue was fixed upstream in 1.4.39.

Mageia 5 and Mageia 6 are also affected.
David Walser 2017-11-22 19:30:51 CET

Whiteboard: (none) => MGA6TOO, MGA5TOO

Comment 1 Marja Van Waes 2017-11-22 20:55:02 CET
Assigning to all packagers collectively, since there is no registered maintainer for this package.

Also CC'ing some committers.

CC: (none) => luis.daniel.lucio, mageia, marja11, oe, olav, shlomif, tmb
Assignee: bugsquad => pkg-bugs

Comment 2 Stig-Ørjan Smelror 2017-11-25 15:25:54 CET
Hi.

Updated memcached version 1.4.39 for MGA5 and MGA6 pushed to updates_testing.

New version for Cauldron, 1.5.3, pushed to core/release.

Cheers,
Stig

CC: (none) => smelror

Comment 3 David Walser 2017-11-25 18:00:28 CET
Advisory:
========================

Updated memcached packages fix security vulnerability:

The try_read_command function in memcached.c in memcached before 1.4.39 allows
remote attackers to cause a denial of service (segmentation fault) via a request
to add/set a key, which makes a comparison between signed and unsigned int and
triggers a heap-based buffer over-read (CVE-2017-9951).

References:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9951
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/EGQ5CRXRSHTKFUB5MCASDOTTZT7YR6IR/
========================

Updated packages in core/updates_testing:
========================
memcached-1.4.39-1.mga5
memcached-devel-1.4.39-1.mga5
memcached-1.4.39-1.mga6
memcached-devel-1.4.39-1.mga6

from SRPMS:
memcached-1.4.39-1.mga5.src.rpm
memcached-1.4.39-1.mga6.src.rpm

Version: Cauldron => 6
Whiteboard: MGA6TOO, MGA5TOO => MGA5TOO
Assignee: pkg-bugs => qa-bugs

Comment 4 Herman Viaene 2017-11-27 12:10:03 CET
MGA5-32 on Dell Latitude D600
No installation issues.
Tried to follow test as per bug 12156, after installing php, but get
$ php memcac.php 
PHP Fatal error:  Class 'Memcached' not found in /home/tester5/Documenten/memcac.php on line 4
Apparently something still missing in this new setup, but that will have to wait until tomorrow.

CC: (none) => herman.viaene

Comment 5 Herman Viaene 2017-11-27 21:00:28 CET
Found out that I needed to install the package php-memcached.
Once this in place, the test as mentioned above runs OK:
$ php memcac.php 
my test data : SUCCESS

Whiteboard: MGA5TOO => MGA5TOO MGA5-32-OK

Lewis Smith 2017-11-28 11:20:22 CET

Keywords: (none) => advisory

Comment 6 Lewis Smith 2017-11-28 11:58:01 CET
Trying M6/64

Installing from issued repos 'memcached-1.4.25-2.mga6.x86_64'.

UPDATEd to: memcached-1.4.39-1.mga6'
Using the quick test given in
 https://bugs.mageia.org/show_bug.cgi?id=12156#c8
which (comment 5) needs also 'php-memcached'.
Problem: wrong output
 $ php memcachedtest.php 
                         [blank line, the final \n I suppose]
 $

 For reference:
$ cat memcachedtest.php 
#!/bin/php
<?php

$m = new Memcached();
$m->addServer('127.0.0.1', 11211);
$m->set('test', 'my test data : SUCCESS');
echo $m->get('test') . "\n";
?>
 I added the final '?>' line, but with or without it, the result was the same.
Tried adding also memcached-devel-1.4.39-1.mga6.x86_64, which made no difference. Am I doing something silly?

CCing Samuel [test author] in case he can advise.

CC: (none) => lewyssmith, stormi

Comment 7 Lewis Smith 2017-11-28 12:39:58 CET
Continuing M6/64
Downgraded memcached to PREupdate version 1.4.25-2, and got the same test non-result as above; so it is at least not due to the update.
Comment 8 Herman Viaene 2017-11-28 16:13:21 CET
@ Lewis: Copy of my test #!/bin/php
<?php

$m = new Memcached();
$m->addServer('127.0.0.1', 11211);
$m->set('test', 'my test data : SUCCESS');
echo $m->get('test') . "\n";file that did OK:

Did you check the package php-memcached?
Comment 9 Lewis Smith 2017-11-29 20:55:40 CET
(In reply to Herman Viaene from comment #8)
> Did you check the package php-memcached?
Yes: php-memcached-2.2.0-2.mga6

I copied the script you gave above (which looked exactly the same as what I had); still no joy (here after the update):
memcached-1.4.39-1.mga6
 $ ./memcachedtest.php 

 $
Will ask around.
Comment 10 PC LX 2017-11-29 22:18:27 CET
Installed and tested without issues.

System: Mageia 5, x86_64, Intel CPU.

$ php memcachetest.php
my test data : SUCCESS
$
$ cat memcachetest.php 
<?php
$m = new Memcached();
$m->addServer('127.0.0.1', 11211);
$m->set('test', 'my test data : SUCCESS');
echo $m->get('test') . "\n";
$
$ uname -a
Linux marte 4.4.92-desktop-1.mga5 #1 SMP Thu Oct 12 20:14:45 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$
$ rpm -qa | grep memcached | sort
lib64memcached11-1.0.17-6.mga5
memcached-1.4.39-1.mga5
php-memcached-2.2.0-0.0.RC1.4.mga5

Whiteboard: MGA5TOO MGA5-32-OK => MGA5TOO MGA5-32-OK MGA5-64-OK
CC: (none) => mageia

Comment 11 Lewis Smith 2017-11-30 08:20:56 CET
(In reply to Lewis Smith from comment #9)
>  $ ./memcachedtest.php 
> 
>  $
This was not correct. It should have been (and was previously in c.6, and now):
 $ php memcachedtest.php 

 $
@PC_LX: Thank you for confirming Mageia 5 x64.
Comment 12 PC LX 2017-11-30 10:24:59 CET
In my comment I forgot to mention that the memcached must be installed and running. If memcached is not running then the test script memcachedtest.php will output nothing.

I used the following commands to install, enable, start and check the status of the memcached service.
# urpmi memcached
# systemctl enable memcached@11211
# systemctl start memcached@11211
# systemctl status memcached@11211
Comment 13 Lewis Smith 2017-11-30 11:04:08 CET
Brilliant! That is all it was. It had not occured to me that a daemon was involved and might not be running; normally when daemons are installed, they are started.

Testing M6x64 post update: memcached-1.4.39-1.mga6

 # systemctl enable memcached@11211
Created symlink /etc/systemd/system/memcached.target.wants/memcached@11211.service → /usr/lib/systemd/system/memcached@.service.
 # systemctl start memcached@11211
 # systemctl status memcached@11211
● memcached@11211.service - Memcached NoSQL key+value store on port 11211
   Loaded: loaded (/usr/lib/systemd/system/memcached@.service; enabled; vendor p
   Active: active (running) since Iau 2017-11-30 10:54:24 CET; 24s ago
...
 $ php memcachedtest.php
 my test data : SUCCESS
So thanks to PC_LX, a Mageia 6 OK. Validating.

Keywords: (none) => validated_update
CC: (none) => sysadmin-bugs
Whiteboard: MGA5TOO MGA5-32-OK MGA5-64-OK => MGA5TOO MGA5-32-OK MGA5-64-OK MGA6-64-OK

Comment 14 Mageia Robot 2017-12-02 00:14:30 CET
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGASA-2017-0441.html

Resolution: (none) => FIXED
Status: NEW => RESOLVED


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