Bug 618574 (CVE-2010-2221) - VUL-0: CVE-2010-2221: multiple buffer overflows in iSCSI
Summary: VUL-0: CVE-2010-2221: multiple buffer overflows in iSCSI
Status: RESOLVED FIXED
Alias: CVE-2010-2221
Product: SUSE Security Incidents
Classification: Novell Products
Component: General (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Deadline: 2010-08-18
Assignee: Security Team bot
QA Contact: E-mail List
URL:
Whiteboard: maint:released:11.1:34991 maint:relea...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-30 06:40 UTC by Sebastian Krahmer
Modified: 2016-04-15 11:57 UTC (History)
2 users (show)

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


Attachments
scsi-target-utils-CVE-2010-2221.tar.bz2 (3.22 KB, application/x-bzip2)
2010-06-30 06:44 UTC, Sebastian Krahmer
Details
0001-iscsi-fix-isns_attr_query-and-send_scn_rsp-buffer-ov.patch (1.63 KB, text/plain)
2010-06-30 06:45 UTC, Sebastian Krahmer
Details
0001-iscsi-fix-the-handling-of-bogus-tlv-length.patch (1.20 KB, text/plain)
2010-06-30 06:45 UTC, Sebastian Krahmer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Krahmer 2010-06-30 06:40:13 UTC
They report that various vendors are affected, but its likely
that our iscsitarget is affected as well. Could you check?

Date: Tue, 29 Jun 2010 10:28:59 -0600
From: Vincent Danen <vdanen@redhat.com>
To: vendor-sec@lst.de

We had reported to us two buffer overflow flaws in scsi-target-utils and
upon further investigation, upstream found two more.  We have also
identified that IET and SCST are affected by these issues
(iscsi-initiator-utils is not).

We have assigned CVE-2010-2221 to this issue.

Unfortunately, when dealing with one of the upstream projects they
committed a fix to their public svn so the embargo we had hoped to set
has been cut quite short.  The other upstream projects will be
committing fixes shortly (they had initially wanted to tomorrow, but I'm
requesting they hold off until 20100701 14:00 UTC).

The first two flaws were found by the Vulnerability Research Team at
TELUS Security Labs, the second two flaws were found by Fujita Tomonori
(from scsi-target-utils).

Describing in reverse because TELUS' report is longer (included below in
its entirety).  Fujita's comments for the second two overflows:

"print_scn_pdu() and qry_rsp_handle() wrongly assume that tlv->length is
sane.  Sending invalid tlv->length pdu can crash the target. This patch
fixes it."

I'm attaching patches for scsi-target-utils (should apply to STSC and
IET without too much difficulty), and the reproducer tool Fujita
provided, with wrappers, to assist in testing.

My apologies for the short notice, but with this public already, we are
stuck with a short embargo.  The SCST commit that is public is here:

http://scst.svn.sourceforge.net/viewvc/scst?view=revision&revision=1793

The report from TELUS Security Labs follows:

- Title:

iSCSI target Multiple Implementations Stack Buffer Overflow

- Affected Vendor:
iSCSI Enterprise Project
tgt project (scsi-target-utils)
SCST project
Red Hat Software

- Tested Affected Products:

RHEL Cluster-Storage (v. 5 server)
scsi-target-utils-0.0-6.20091205snap.el5_5.2

- Affected Components:

tgtd

- Vulnerability Details:
iSCSI Initiators can locate appropriate storage resources using the Internet
Storage Name Service (iSNS) protocol. This protocol allows automated
discovery,
management and configuration of iSCSI devices on a TCP/IP network. The iSNS
standard is defined by its four components: the iSNS protocol, iSNS clients,
iSNS servers and iSNS databases. It provides four services:

* Name Registration and Storage Resource Discovery: iSCSI targets and
initiators can register with the iSNS database, and inquire about other
initiators and targets.

* Discovery Domains and Login Control: administrators can use the Discovery
Domains to divide storage nodes into manageable, non-exclusive groups.

* State Change Notification (SCN): allows an iSNS Server to issue
notifications
about each event that affects storage nodes on the managed network.

* Bidirectional Mappings Between Fibre Channel and iSCSI Devices.

The structure of an iSNS message is as follows:

Offset Size Description
--------------------------------------------------------------------
0x0000 2 bytes Version
0x0002 2 bytes Message Type
0x0004 2 bytes Length N
0x0006 2 bytes Flags
0x0008 2 bytes Transaction ID
0x000A 2 bytes Sequence ID
0x000C N bytes Payload


iSCSI initiators will query the iSNS server to discover the presence and
location of iSCSI target devices. iSCSI targets allow themselves to be
discovered by iSCSI initiators by registering their presence with the iSNS
server. After registration an iSCSI target may also register for SCNs in
order
to detect the addition or removal of initiators, the iSCSI target will open a
random TCP port in order to receive the SCNs from the iSNS server.

One of the types of iSNS messages is an SCN message, the Message Type for
this
message is 0x0008 and its payload has the following structure:

Offset Size Description
--------------------------------------------------------------------
0x0000 4 bytes Attribute Tag
0x0004 4 bytes Attribute Length N
0x0008 N bytes Attribute

ne of the types of supported attributes is Name, the Attribute Tag for a
Name
attribute is 32 (0x00000020).

A stack buffer overflow vulnerability exists in multiple implementations of
iSCSI target. The vulnerability is caused by missing bounds checks when
handling SCN messages. The vulnerable code prepares the reply packet by
copying
iSCSI Name into the fixed-length stack buffer. When the iSCSI Name string is
longer than 1008 bytes, the buffer overflows that could lead to corruption of
sensitive stack data such as function return addresses.

Following is the vulnerable source code, comments added by TELUS Security
labs.

static void send_scn_rsp(char *name, uint16_t transaction)
{
char buf[1024]; // Fixed length stack buffer
struct isns_hdr *hdr = (struct isns_hdr *) buf; // Here and further: cast
pointers
struct isns_tlv *tlv;
uint16_t flags, length = 0;
int err;

memset(buf, 0, sizeof(buf));
*((uint32_t *) hdr->pdu) = 0;
tlv = (struct isns_tlv *) ((char *) hdr->pdu + 4);
length +=4;

length += isns_tlv_set_string(&tlv, ISNS_ATTR_ISCSI_NAME, name); // Copy
string
to stack buffer

[... truncated/reordered for readability ...]

static int isns_tlv_set_string(struct isns_tlv **tlv, uint32_t tag, char
*str)
{
return isns_tlv_set(tlv, tag, strlen(str) + 1, str); // Copy string based on
src string length
}

[... truncated/reordered for readability ...]

static int isns_tlv_set(struct isns_tlv **tlv, uint32_t tag, uint32_t length,
void *value)
{
if (length)
memcpy((*tlv)->value, value, length); // Buffer overflow here


--
Vincent Danen / Red Hat Security Response Team
Comment 1 Sebastian Krahmer 2010-06-30 06:42:59 UTC
Note there is also a planned update for open-iscsi (bnc#423648).
Comment 2 Sebastian Krahmer 2010-06-30 06:44:26 UTC
Created attachment 372759 [details]
scsi-target-utils-CVE-2010-2221.tar.bz2

...
Comment 3 Sebastian Krahmer 2010-06-30 06:45:16 UTC
Created attachment 372760 [details]
0001-iscsi-fix-isns_attr_query-and-send_scn_rsp-buffer-ov.patch

...
Comment 4 Sebastian Krahmer 2010-06-30 06:45:36 UTC
Created attachment 372761 [details]
0001-iscsi-fix-the-handling-of-bogus-tlv-length.patch

...
Comment 5 Marcus Meissner 2010-07-02 09:03:03 UTC
(also check tgt and iscsitarget I guess)
Comment 6 Sebastian Krahmer 2010-07-05 08:55:06 UTC
* [2010-06-29 10:28:59 -0600] Vincent Danen wrote:

>We had reported to us two buffer overflow flaws in scsi-target-utils and
>upon further investigation, upstream found two more.  We have also
>identified that IET and SCST are affected by these issues
>(iscsi-initiator-utils is not).
>
>We have assigned CVE-2010-2221 to this issue.
>
>Unfortunately, when dealing with one of the upstream projects they
>committed a fix to their public svn so the embargo we had hoped to set
>has been cut quite short.  The other upstream projects will be
>committing fixes shortly (they had initially wanted to tomorrow, but I'm
>requesting they hold off until 20100701 14:00 UTC).

We have opened our bug on this issue:

https://bugzilla.redhat.com/show_bug.cgi?id=593877

Patches for scsi-target-utils are available attached to the bug; they
should apply quite straightforward to the other affected packages (SCST,
IET).
Comment 7 Hannes Reinecke 2010-07-29 10:18:41 UTC
This only affects iscsitarget and tgtd. open-iscsi is not affected.
Comment 8 Hannes Reinecke 2010-08-04 09:41:31 UTC
Updated tgt rpm submitted for SLES11 and SLES11 SP1. SLES10 is not affected; tgt is not present.
Comment 9 Hannes Reinecke 2010-08-04 09:42:52 UTC
Sorry, forgot to include patch from comment #4.
Comment 10 Hannes Reinecke 2010-08-04 09:49:31 UTC
New tgt package submitted for SLES11 and SLES11 SP1 containing fixes from comment #3 and comment #4.
Comment 11 Hannes Reinecke 2010-08-04 10:31:45 UTC
For iscsitarget this is fixed by svn commit 367.
Comment 12 Hannes Reinecke 2010-08-04 11:05:03 UTC
New iscsitarget packages submitted for SLES10 SP3, SLES11, and SLES11 SP1.
Do you need updates for OpenSUSE as well?
And if so, which versions?
Comment 13 Swamp Workflow Management 2010-08-04 12:06:37 UTC
The SWAMPID for this issue is 34961.
This issue was rated as moderate.
Please submit fixed packages until 2010-08-18.
When done, please reassign the bug to security-team@suse.de.
Patchinfo will be handled by security team.
Comment 14 Thomas Biege 2010-08-04 12:16:34 UTC
(In reply to comment #12)
> New iscsitarget packages submitted for SLES10 SP3, SLES11, and SLES11 SP1.
> Do you need updates for OpenSUSE as well?
> And if so, which versions?

Are more packages/distros affected?
Comment 15 Thomas Biege 2010-08-04 12:17:46 UTC
(In reply to comment #12)
> New iscsitarget packages submitted for SLES10 SP3, SLES11, and SLES11 SP1.
> Do you need updates for OpenSUSE as well?
> And if so, which versions?

Uh, I should have read it completely.

Yes, also opensuse since 11.1.
Comment 16 Thomas Biege 2010-08-04 14:00:30 UTC
CVE-2010-2221: CVSS v2 Base Score: 5.0 (MEDIUM) (AV:N/AC:L/Au:N/C:N/I:N/A:P)
CVE-2010-2221: Buffer Errors (CWE-119)
Comment 17 Hannes Reinecke 2010-08-04 14:52:12 UTC
Submitreq for 11.1:  44525
Comment 18 Hannes Reinecke 2010-08-05 09:47:34 UTC
Submitreq for 11.2: 618574
Comment 19 Hannes Reinecke 2010-08-05 10:04:33 UTC
Submitreq for 11.3: 44566

iscsitarget is finished.
Comment 20 Hannes Reinecke 2010-08-05 10:14:03 UTC
Submitreq for tgt on 11.3: 44569
Comment 21 Hannes Reinecke 2010-08-05 10:20:34 UTC
Submitreq for tgt on 11.2: 44570
Comment 22 Hannes Reinecke 2010-08-05 10:25:31 UTC
Submitreq for tgt on 11.1: 44571

tgt is finished.
Comment 23 Thomas Biege 2010-08-05 11:28:03 UTC
reopen for tracking
Comment 24 Thomas Biege 2010-08-05 11:28:59 UTC
Hannes,
what about the open-iscsi update? We can release it together with tgt and iscsitarget.
Comment 25 Hannes Reinecke 2010-08-05 11:43:52 UTC
Cf comment #7.
Comment 26 Swamp Workflow Management 2010-09-13 13:37:39 UTC
Update released for: iscsitarget, iscsitarget-debuginfo, iscsitarget-debugsource, iscsitarget-kmp-debug, iscsitarget-kmp-debug-debuginfo, iscsitarget-kmp-default, iscsitarget-kmp-default-debuginfo, iscsitarget-kmp-desktop, iscsitarget-kmp-desktop-debuginfo, iscsitarget-kmp-ec2, iscsitarget-kmp-pae, iscsitarget-kmp-pae-debuginfo, iscsitarget-kmp-trace, iscsitarget-kmp-vmi, iscsitarget-kmp-xen, iscsitarget-kmp-xen-debuginfo
Products:
openSUSE 11.1 (debug, i586, ppc, x86_64)
openSUSE 11.2 (debug, i586, x86_64)
openSUSE 11.3 (debug, i586, x86_64)
Comment 27 Swamp Workflow Management 2010-09-13 13:37:49 UTC
Update released for: tgt, tgt-debuginfo, tgt-debugsource
Products:
openSUSE 11.1 (debug, i586, ppc, x86_64)
openSUSE 11.2 (debug, i586, x86_64)
openSUSE 11.3 (debug, i586, x86_64)
Comment 28 Swamp Workflow Management 2010-09-13 13:38:10 UTC
released
Comment 29 Swamp Workflow Management 2010-09-13 15:52:09 UTC
Update released for: tgt, tgt-debuginfo, tgt-debugsource
Products:
SLE-DEBUGINFO 11 (i386, ia64, ppc64, s390x, x86_64)
SLE-SERVER 11 (i386, ia64, ppc64, s390x, x86_64)
Comment 30 Swamp Workflow Management 2010-09-13 15:59:01 UTC
Update released for: tgt, tgt-debuginfo, tgt-debugsource
Products:
SLE-DEBUGINFO 11-SP1 (i386, ia64, ppc64, s390x, x86_64)
SLE-SERVER 11-SP1 (i386, ia64, ppc64, s390x, x86_64)
SLES4VMWARE 11-SP1 (i386, x86_64)
Comment 31 Swamp Workflow Management 2010-09-13 16:25:31 UTC
Update released for: iscsitarget, iscsitarget-debuginfo
Products:
SLE-DEBUGINFO 10-SP3 (i386, ia64, ppc, s390x, x86_64)
SLE-SAP-APL 10-SP3 (x86_64)
SLE-SDK 10-SP3 (i386, ia64, ppc, s390x, x86_64)
SLE-SERVER 10-SP3 (i386, ia64, ppc, s390x, x86_64)
Comment 32 Swamp Workflow Management 2010-09-13 16:52:25 UTC
Update released for: iscsitarget, iscsitarget-debuginfo, iscsitarget-debugsource, iscsitarget-kmp-debug, iscsitarget-kmp-default, iscsitarget-kmp-ec2, iscsitarget-kmp-pae, iscsitarget-kmp-ppc64, iscsitarget-kmp-trace, iscsitarget-kmp-vmi, iscsitarget-kmp-xen
Products:
SLE-DEBUGINFO 11 (i386, ia64, ppc64, s390x, x86_64)
SLE-SERVER 11 (i386, ia64, ppc64, s390x, x86_64)
Comment 33 Swamp Workflow Management 2010-09-15 16:51:01 UTC
Update released for: iscsitarget, iscsitarget-debuginfo, iscsitarget-debugsource, iscsitarget-kmp-debug, iscsitarget-kmp-default, iscsitarget-kmp-ec2, iscsitarget-kmp-pae, iscsitarget-kmp-ppc64, iscsitarget-kmp-rt, iscsitarget-kmp-rt_debug, iscsitarget-kmp-rt_trace, iscsitarget-kmp-trace, iscsitarget-kmp-vmi, iscsitarget-kmp-xen
Products:
SLE-DEBUGINFO 11-SP1 (i386, ia64, ppc64, s390x, x86_64)
SLE-DESKTOP 11-SP1 (i386, x86_64)
SLE-RT 11-SP1 (x86_64)
SLE-SERVER 11-SP1 (i386, ia64, ppc64, s390x, x86_64)
Comment 34 Bernhard Wiedemann 2016-04-15 11:57:17 UTC
This is an autogenerated message for OBS integration:
This bug (618574) was mentioned in
https://build.opensuse.org/request/show/44525 11.1 / iscsitarget
https://build.opensuse.org/request/show/44565 11.2:Test / iscsitarget
https://build.opensuse.org/request/show/44566 11.3 / iscsitarget