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:~] $ memcached -p 2300 -m 64 -c 1024 -r -vv 2>&1 | grep 'Deleting' Deleting ABCDEF Deleting xyzDEF Expected results: [jsowden:~] $ 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
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
Created memcached tracking bugs for this issue Affects: epel-5 [bug 895139] Affects: fedora-all [bug 895140]
CVE request: http://www.openwall.com/lists/oss-security/2013/01/14/4
This was assigned CVE-2013-0179.
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.
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.