Bug 895054 - (CVE-2013-0179) CVE-2013-0179 memcached: DoS due to buffer overrun when printing out keys to be deleted in verbose mode
CVE-2013-0179 memcached: DoS due to buffer overrun when printing out keys to ...
Status: NEW
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Product Security
impact=low,public=20130108,reported=2...
: Security
Depends On: 895139 895140
Blocks: 1052870
  Show dependency treegraph
 
Reported: 2013-01-14 07:10 EST by Jeremy Sowden
Modified: 2015-08-19 05:19 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 895072 (view as bug list)
Environment:
Last Closed:
Type: Bug
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 Jeremy Sowden 2013-01-14 07:10:54 EST
Description of problem:

When run with "-vv", on receipt of a binary-protocol deletion request, memcached prints out the key to be deleted in a way that can lead to a buffer overrun and crash.

Version-Release number of selected component (if applicable):

1.4.4, although this currently affects all later versions.

How reproducible:

Run memcached with "-vv", use memrm to send deletion requests and observe output.

Steps to Reproduce:

1. memcached -p 12345 -vv 2>&1 | grep '^Deleting'
2. memrm --servers localhost:12345 --binary ABCDEF xyz
3. Check the output from memcached.

Actual results:

[jsowden@enceladus.openbet:~] $ memcached -p 2300 -m 64 -c 1024 -r -vv 2>&1 | grep 'Deleting'
Deleting ABCDEF
Deleting xyzDEF

Expected results:

[jsowden@enceladus.openbet:~] $ memcached -p 2300 -m 64 -c 1024 -r -vv 2>&1 | grep 'Deleting'
Deleting ABCDEF
Deleting xyz

Additional info:

I've opened a bug report upstream: https://code.google.com/p/memcached/issues/detail?id=306
Comment 2 Vincent Danen 2013-01-14 11:59:20 EST
Proposed patch:

https://code.google.com/p/memcached/issues/attachmentText?id=306&aid=3060004000&name=0001-Fix-buffer-overrun-when-logging-key-to-delete-in-bin.patch&token=3GEzHThBL5cxmUrsYANkW03RrNY%3A1358179503096

However, I'm not sure if we would consider this a security flaw.  For one, you need to run memcached with -vv (probably not used in production but for testing).

It would also indicate that this would be a local-only flaw (or from other trusted source) as the docs explicitly say that you shouldn't expose memcached to untrusted users:

https://code.google.com/p/memcached/wiki/NewConfiguringServer#Networking

In particular:

"Memcached does not spend much, if any, effort in ensuring its defensibility from random internet connections. So you must not expose memcached directly to the internet, or otherwise any untrusted users. Using SASL authentication here helps, but should not be totally trusted."

I guess this could be considered a low-impact security flaw due to the conditions required to make an attack meaningful:

- start memcached with -vv (not the default)
- make it available to untrusted users (not recommended as per docs)
- memcached runs non-root and with FORTIFY_SOURCE/SSP any buffer overflow should be rendered a simple DoS
Comment 3 Vincent Danen 2013-01-14 12:08:28 EST
Created memcached tracking bugs for this issue

Affects: epel-5 [bug 895139]
Affects: fedora-all [bug 895140]
Comment 4 Vincent Danen 2013-01-14 12:09:23 EST
Statement:

The Red Hat Security Response Team has rated this issue as having low security impact. A future update may address this issue. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.
Comment 5 Vincent Danen 2013-01-14 12:14:13 EST
CVE request:

http://www.openwall.com/lists/oss-security/2013/01/14/4
Comment 6 Vincent Danen 2013-01-14 15:49:54 EST
This was assigned CVE-2013-0179.
Comment 7 Fedora Update System 2014-02-02 21:42:13 EST
memcached-1.4.17-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2014-02-02 21:48:57 EST
memcached-1.4.17-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

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