Bug 828117 - (CVE-2013-2236) VUL-0: CVE-2013-2236: quagga: local network stack overflow
(CVE-2013-2236)
VUL-0: CVE-2013-2236: quagga: local network stack overflow
Status: RESOLVED FIXED
Classification: Novell Products
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents
unspecified
Other Other
: P3 - Medium : Major
: ---
Assigned To: Security Team bot
Security Team bot
maint:running:53559:important maint:...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-04 07:51 UTC by Marcus Meissner
Modified: 2014-07-09 10:31 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Meissner 2013-07-04 07:51:18 UTC
is public, via oss-sec

CVE-2013-2236

From: David Lamparter <equinox@diac24.net>
Date: Wed, 3 Jul 2013 23:14:11 +0200
Subject: [oss-security] CVE request: Quagga OSPF-API stack overrun

Hi,

I guess I need a CVE number for this, we've discovered a local network
exploitable stack overrun in Quagga's ospfd.

Reference:
http://lists.quagga.net/pipermail/quagga-dev/2013-July/010621.html

Cheers,

-David
(Quagga maintainer)
Comment 1 Marcus Meissner 2013-07-04 07:52:06 UTC
From: Charlet, Ricky
Sent: Tuesday, July 02, 2013 11:09 AM
To: quagga-dev at lists.quagga.net
Subject: ospfd, new_msg_lsa_change_notify: looks like a buffer overflow


Howdy,

        I'm gonna describe an ospfd bug that happened to me and a proposed patch. But at the top of this email, I want to say that I'm really not familiar enough with this code to suggest that this patch is "the right thing".  I'm looking for some double checking here. On the other hand, I think it is important. This is an on-stack, buffer overflow susceptible to input from the network in code that implements, what seems to me, to be a very minor feature.

        I setup a network that, upon a single network event, sent over router LSAs representing 150 networks. The actual traffic broke down into about 100 ls-update packets, many of which are len=1480, and some of which are ip-fragmented. The ls-updates tend to grow in size. The largest (re-assembled) one was the last one at 1840 bytes.

While processing the received LSAs, we crash with  gdb backtrace points to memcpy called from new_msg_lsa_change_notify. By code review, I see that we memcpy into a buffer with a length we learned from the input, not governed by the length of the available buffer. In my patch, I suggest that we govern the memcpy by the length of the available buffer.

<patch>
Index: ospfd/ospf_api.c
===================================================================
--- ospfd/ospf_api.c    (revision 10875)
+++ ospfd/ospf_api.c    (working copy)
@@ -639,7 +639,7 @@
   nmsg->area_id = area_id;
   nmsg->is_self_originated = is_self_originated;
   memset (&nmsg->pad, 0, sizeof (nmsg->pad));
-  memcpy (&nmsg->data, data, ntohs (data->length));
+  memcpy (&nmsg->data, data, sizeof(struct lsa_header));

   return msg_new (msgtype, nmsg, seqnum, len);
 }</patch>

        I tested the above, passing in the same large router-lsa's and it survives/passes.

Sssooo.... I'm not one to pretend I understand what 'clients' might be interested in this lsa-update message. I looked at the ospfclient.c: lsa_update_callback() and it apparently does not care about anything beyond the header.  Certianly, in our implementation, we have no clients at all listening for these messages.   Is it apprpriate to trunkate this ls-update message to the header only, or should a solution be built for passing arbitrarily large messages to clients?


Additionally, how about the code that is sending the ls-updates?  I did not look into it myself. But we may be a poor citizen if we are sending ls-updates which need to be reassembled into large buffers.
Comment 2 Swamp Workflow Management 2013-07-04 22:00:15 UTC
bugbot adjusting priority
Comment 5 Bo Yang 2013-08-19 04:11:01 UTC
patch submitted to SUSE:SLE-9-SP3:Update:Teradata:Test, SUSE:SLE-10-SP3:Update:Test, SUSE:SLE-11-SP1:Update:Test.

reassign to maintenance team.
Comment 7 Swamp Workflow Management 2013-09-19 11:04:22 UTC
Update released for: quagga
Products:
SUSE-CORE 9-SP3-TERADATA (x86_64)
Comment 8 Swamp Workflow Management 2013-09-19 11:05:09 UTC
Update released for: quagga, quagga-debuginfo, quagga-debugsource, quagga-devel
Products:
SLE-SERVER 11-SP1-TERADATA (x86_64)
Comment 9 Swamp Workflow Management 2013-09-19 12:51:48 UTC
Update released for: quagga, quagga-debuginfo, quagga-debugsource, quagga-devel
Products:
SLE-DEBUGINFO 11-SP3 (i386, ia64, ppc64, s390x, x86_64)
SLE-SDK 11-SP3 (i386, ia64, ppc64, s390x, x86_64)
SLE-SERVER 11-SP3 (i386, ia64, ppc64, s390x, x86_64)
SLES4VMWARE 11-SP3 (i386, x86_64)
Comment 10 Swamp Workflow Management 2013-09-19 13:01:28 UTC
Update released for: quagga, quagga-debuginfo, quagga-debugsource, quagga-devel
Products:
SLE-DEBUGINFO 11-SP2 (i386, ia64, ppc64, s390x, x86_64)
SLE-SDK 11-SP2 (i386, ia64, ppc64, s390x, x86_64)
SLE-SERVER 11-SP2 (i386, ia64, ppc64, s390x, x86_64)
SLES4VMWARE 11-SP2 (i386, x86_64)
Comment 11 Swamp Workflow Management 2013-09-19 13:04:17 UTC
Update released for: quagga, quagga-debuginfo, quagga-devel
Products:
SLE-SERVER 10-SP3-TERADATA (x86_64)
Comment 12 Marcus Meissner 2013-10-25 13:02:17 UTC
released
Comment 13 Swamp Workflow Management 2014-06-20 13:10:57 UTC
An update workflow for this issue was started.
This issue was rated as moderate.
Please submit fixed packages until 2014-07-04.
When done, reassign the bug to security-team@suse.de.
https://swamp.suse.de/webswamp/wf/57975
Comment 14 Swamp Workflow Management 2014-07-08 19:48:03 UTC
Update released for: quagga, quagga-debuginfo, quagga-devel
Products:
SLE-DEBUGINFO 10-SP3 (i386, s390x, x86_64)
SLE-SERVER 10-SP3-LTSS (i386, s390x, x86_64)
Comment 15 Swamp Workflow Management 2014-07-08 19:50:41 UTC
Update released for: quagga, quagga-debuginfo, quagga-devel
Products:
SLE-DEBUGINFO 10-SP4 (i386, s390x, x86_64)
SLE-SERVER 10-SP4-LTSS (i386, s390x, x86_64)
Comment 16 Swamp Workflow Management 2014-07-08 20:45:33 UTC
Update released for: quagga, quagga-debuginfo, quagga-debugsource, quagga-devel
Products:
SLE-DEBUGINFO 11-SP1 (i386, s390x, x86_64)
SLE-SERVER 11-SP1-LTSS (i386, s390x, x86_64)
Comment 17 Swamp Workflow Management 2014-07-09 00:04:46 UTC
SUSE-SU-2014:0879-1: An update that fixes two vulnerabilities is now available.

Category: security (moderate)
Bug References: 822572,828117
CVE References: CVE-2013-0149,CVE-2013-2236
Sources used:
SUSE Linux Enterprise Server 11 SP1 LTSS (src):    quagga-0.99.15-0.14.11
SUSE Linux Enterprise Server 10 SP4 LTSS (src):    quagga-0.99.9-14.17.12
SUSE Linux Enterprise Server 10 SP3 LTSS (src):    quagga-0.99.9-14.17.12