Bug 132707

Summary: VUL-0: AUDIT-0: CASA
Product: [Novell Products] SUSE Security Incidents Reporter: Marcus Meissner <meissner>
Component: IncidentsAssignee: Cameron Mashayekhi <cmashayekhi>
Status: RESOLVED DUPLICATE QA Contact: Security Team bot <security-team>
Severity: Major    
Priority: P5 - None CC: joe, meissner, security-team, soo.choi
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on: 222012    
Bug Blocks:    
Attachments: 1.5 design doc in ppt form
crypto related doc
Ref Guide
Additional design doc
rats_output.txt
rats_output.txt
flawfinder_output.txt
CASA RPC verbs document
casa-report.pdf

Description Marcus Meissner 2005-11-08 14:09:46 UTC
casa is a credential sharing / syncing framework which 
is supposed to be Novells solution ongoing ... 

It is written in C#. 

It integrates somehow with kwallet, gnome-keyring and similar...

So we need to take a look at it, especially on if the secrets can be leaked
Comment 1 Baber Amin 2005-11-18 22:04:43 UTC
Created attachment 57770 [details]
1.5 design doc in ppt form
Comment 2 Baber Amin 2005-11-18 22:05:07 UTC
Created attachment 57771 [details]
crypto related doc
Comment 3 Baber Amin 2005-11-18 22:05:53 UTC
Created attachment 57772 [details]
Ref Guide
Comment 4 Baber Amin 2005-11-18 22:06:16 UTC
Created attachment 57773 [details]
Additional design doc
Comment 5 Baber Amin 2005-11-18 22:07:05 UTC
Attached docs that were used in the SRB process in Provo and might help with the audit.
Comment 6 Marcus Meissner 2005-11-21 10:39:26 UTC
Created attachment 57854 [details]
rats_output.txt

(rats output)

>>> Cameron Mashayekhi 10/21/2005 9:45:37 am >>>

Here is the buffer overflow analysis for CASA as required by the SRB.

Thanks,
Cameron
Comment 7 Marcus Meissner 2005-11-21 10:39:44 UTC
Created attachment 57855 [details]
rats_output.txt

(rats output)

http://www.mirrors.wiretapped.net/security/development/auditing/rats/
Comment 8 Marcus Meissner 2005-11-21 10:41:05 UTC
Created attachment 57856 [details]
flawfinder_output.txt

flawfinder output

http://www.dwheeler.com/flawfinder/
Comment 9 Thomas Biege 2005-12-08 11:29:59 UTC
I'll look at it after the holidays.
Comment 10 Thomas Biege 2006-02-03 12:36:29 UTC
I am on it...
Comment 11 Thomas Biege 2006-02-08 13:04:22 UTC
Baber,
is there a description available for the protocol miCASA uses with client communicating via the unix domain socket?

Comment 12 Baber Amin 2006-02-08 18:49:22 UTC
We will have a written description available by EOD Monday.

Tschoe
-Baber
Comment 13 Baber Amin 2006-02-17 20:23:41 UTC
Created attachment 69131 [details]
CASA RPC verbs document

CASA RPC verbs document as requested in comment # 11.
Comment 14 Thomas Biege 2006-02-23 08:53:19 UTC
Thanks.
Comment 15 Thomas Biege 2006-03-07 13:02:48 UTC
Created attachment 71550 [details]
casa-report.pdf

Audit Report
Comment 16 Thomas Biege 2006-03-07 13:03:48 UTC
Hello Baber,
I reassign it to you to handle further actions. Thanks.
Comment 17 Baber Amin 2006-03-07 16:35:55 UTC
Thanks Thomas, I will get the doc to the engineering team here.  We might ask you for guidance on some things.  Thanks for your help.

Tschoe
-Baber
Comment 18 Thomas Biege 2006-04-21 09:47:16 UTC
Hello,
when the fixing of CASA is finished can you attach the relevant patches here please?

Comment 19 Baber Amin 2006-04-21 14:11:18 UTC
Hi Thomas, the fixes are going in as bug fixes and are in final test phase.  They should be checked in with the next build of CASA.  I will post final progress here.

Cheers
-Baber
Comment 20 Thomas Biege 2006-05-22 12:31:39 UTC
>>> Thomas Biege <thomas@suse.de> 4/26/06 8:09 AM >>>
> These are all in version 1.6 slated for sled10.   I would like to
hear
> your recommendation as to whether we should create patches for the
1.5
> release also.  We did create one patch for 1.5 that fixed the buffer
> overflow, but are these significant enough to patch 1.5, or do we
see
> enough sled10 adoption/migration that CASA 1.5 which was in nld9 sp3
can
> be left un patched till the next service pack.  What is your
opinion?

Hi.

>From the report the following bugs should be patched: 5.2, 5.9, 4.3,
4.4
Comment 21 Thomas Biege 2006-05-22 12:32:32 UTC
These bugs should be patched (online update) for the released products (NLD, OES).
Comment 22 Thomas Biege 2006-05-22 12:38:13 UTC
for 4.4 only the FileStream() bug.
Comment 23 Thomas Biege 2006-05-22 12:53:47 UTC
MaintenanceTracker-4404
Comment 24 Baber Amin 2006-05-22 20:31:21 UTC
Hi guys, what is a MaintenanceTracker?  I am not familiar with this or what to do with it?

-baber
Comment 25 Thomas Biege 2006-05-26 12:09:26 UTC
You have to provide update packages for the affected products. We handle the rest. :)
Comment 26 Thomas Biege 2006-05-31 09:11:06 UTC
I got some CVE numbers from Mitre (cve.mitre.org). Try to include them in changelogs and update texts to have a common cross-reference please.


>       + other users password storage can be accessed through links
>         to execute dictionary attack on corresponding  'master passcode'

CVE-2006-2619

>       + local user can mimic the CASA daemon to steal the 'master password'
>         from another user

CVE-2006-2620

>       + several possible buffer overflow that can be exploited locally

CVE-2006-2621
Comment 27 Kyle Bullock 2006-06-12 15:53:20 UTC
Are there still issues from the audit that still need to be implemented, thus requiring us to keep the defect open to track them.  Or can this defect be closed?
Comment 28 Thomas Biege 2006-06-26 10:02:39 UTC
We will keep it open until we pushed out the update packes to our customers. That is the common procedure we use.

thomas@spiral:~> /work/src/bin/is_maintained CASA
Package is on CD sled10.i386
        Distribution: sles10-i386
        Distributionstring: SUSE-Linux-SLES-i386
        Marketing-Name: SUSE SLED 10 for x86
Package is on CD sled10.x86_64
        Distribution: sles10-x86_64
        Distributionstring: SUSE-Linux-SLES-x86-64
        Marketing-Name: SUSE SLED 10 for AMD64 and Intel EM64T
Package is on CD sles9-nld.i386
        Distribution: sles9-sld-i386
        Distributionstring: SLES9-SLD-i386
        Marketing-Name: Novell Linux Desktop 9 for x86
Package is on CD sles9-nld.x86_64
        Distribution: sles9-sld-x86_64
        Distributionstring: SLES9-SLD-x86_64
        Marketing-Name: Novell Linux Desktop 9 for x86_64
Package is on CD sles9-oes.i386
        Distribution: sles9-i386
        Distributionstring: Novell-Open-Enterprise-Server-i386
        Marketing-Name: Open Enterprise Server
thomas@spiral:~>

Comment 29 Thomas Biege 2006-09-06 10:06:46 UTC
Are the updates submitted now?
Comment 30 Thomas Biege 2006-09-19 16:39:56 UTC
We need sles9 and sles10 updates. TIA.
Comment 31 Thomas Biege 2006-10-09 09:54:11 UTC
ping
Comment 32 Thomas Biege 2006-11-09 06:16:58 UTC
Hello, someone?
Comment 33 Cameron Mashayekhi 2006-11-14 16:44:46 UTC
We addressed all of the issues that were in the security review list. All of the fixes went into 1.6 and moving forward to 1.7. If you look at the CASA.changes file in autobuild all of the changes have been described and documented there. As it was mandated at the time we povided a patch to solve the critical buffer overflow defect in 1.5 to retrofit the product and the patch was shipped as well.

If there are any additional issues before our next security review for 1.7 that needs to be addressed then let us know..

-- Cameron
Comment 34 Thomas Biege 2007-01-08 16:14:29 UTC
What about CASA 1.5 in sles9?

For SLES10 it seems to be fixed in the repository. But it is hard to spot because the CASA.changes file does not list this Bug-ID nor does it list a CVE-ID.

Was this fixed CASA 1.6 package part of a SLES10 ServicePack we released?

Comment 35 Thomas Biege 2007-01-08 16:23:20 UTC
(In reply to comment #34)
> What about CASA 1.5 in sles9?

To clarify I looked at 
/work/SRC/old-versions/9.1/SLD/all/CASA/CASA.changes
and
/work/SRC/old-versions/9.1/SLES/arch/i386/CASA/CASA.changes

The patch is not mentioned there AFAICS.

The only buffer overflow listed there is:
-------------------------------------------------------------------
Wed Feb 15 14:45:22 MST 2006 - cmashayekhi@novell.com

- Bug 143940. pam_sscs.c patch for the buffer overflow applied to
  version 1.5.

-------------------------------------------------------------------

Is this the one you mean? This one has nothing to do with this bug/audit report.
Comment 36 Cameron Mashayekhi 2007-01-08 17:43:25 UTC
You are correct. We were mandated to apply the audit patch requirements only to version 1.6 because the 1.5 was older version that was not in popular use and in a worst case scenario CASA 1.5 could be upgraded to 1.6 on an older OS. However, We were required to patch the critical buffer overflow bug that was reported to us by you that is the one you have listed here. We retrofitted the fix as a patch into version 1.5 because it was critical, and this was done right when we were going through with the security review when you performed the code review. 

--Cameron
Comment 37 Thomas Biege 2007-01-09 09:45:38 UTC
Thanks for the answer.

> in a worst case scenario CASA 1.5 could be upgraded to 1.6 on an older OS.

How is this upgrade done.

If I write a security-advisory I can add this information there to inform customers about the problem.


> However, We were required to patch the critical buffer overflow bug that was
> reported to us by you that is the one you have listed here.
> We retrofitted the fix as a patch into version 1.5 because it was critical...

To avoid confusions can you directly point me to the buffer overflow bug you mean and the patch you applied?

BTW, what will be done with CASA 1.0 for SL 10.0? Was this code shipped?

And the most important question: Did we ever released fixes via a ServicePack?

I need to find out what really got fixed and for what SL version to provide updates for our customers.

Comment 38 Cameron Mashayekhi 2007-01-09 21:11:10 UTC

Our builds (rpms) are available at:
http://forge.novell.com/modules/xfmod/project/?casa
for public download and use.

Installing 1.6 or newer might require some dependencies to be updated as well but when they start updating the rpm they will (rpm -Uvh) get prompted if they need to update anything.

On how the patch was released to 1.5 you need to contact Ruedieger Ortel(rudi@suse.com) he knows how that was delivered.

Our Build Manager Soo Choi will provide the patch build information separately.

Version 1.0 was only caching secrets for the session and did not have any advanced features that would require any of these patches.

--Cameron
Comment 39 Soo Choi 2007-01-09 23:07:05 UTC
The patch builds are the following and available at forge site.
CASA-1.5.305-0.i586.rpm 		
CASA-devel-1.5.305-0.i586.rpm 		
CASA-gui-1.5.305-0.i586.rpm

The changes are in svn r305
jnorman | 2006-02-15 13:51:17 -0700 (Wed, 15 Feb 2006) | 1 line
Changed paths:
   M /branches/Patch_1.5/login_capture/PAM/pam_sscs.c
Buffer overflow patch for NLD9

--Soo
Comment 40 Thomas Biege 2007-01-10 12:26:43 UTC
Thanks for this information.

We need to push out the updates via YaST Online Update. An URL to our forge site is not what our customers expect.

Therefore my last question: Are the patches complete for the package of SLE(D)10 ? Especially the fixes for CVE-2006-2620 and CVE-2006-2621 are important (see comment#26).

I have to ask this so explicitly because these bugs are easy to exploit and it is not clear for me by reading the CASA.changes file if they are fixed or not.

(BTW, mentioning the Bug-ID and/or CVE-ID in the changes file would make this locatable more easily.)
Comment 41 Thomas Biege 2007-01-24 11:33:43 UTC
from CASA.changes:

-------------------------------------------------------------------
Wed Apr 26 15:50:00 MDT 2006 - jnorman@novell.com

-	Security Audit Recap:	
-	Item 4.1, File: c_micasad/lss/Rfc2898DeriveBytes.c 
	1.	This item is awaiting licensing on a portable random number 
		generator received through a contribution to the the project.
-	Item 4.2 File: c_micasad/cache/KeyValue.c
	1.	Fix is in line 202 of the file. We improved XOR algorithm by 
		increasing the size of the key to equate the value.
-	Item 4.3 File: c_micasad/lss/LocalStorage.cs
	1.	Now files are checked for ownership before being removed. 
		New methods added and there are changes through out the file to support this.
-	Item 4.4 File: c_micasad/lss/CASACrypto.cs
	1.	IV fix will be checked in as soon as the item No. 1 above is approved.
	2.	For this item now we testing the file to make sure it is not a 
		symbolic link. (line 454, 455 in the file.)
	3.	This was a low priority item and we are investigating this.
	4.	This function was not used hence removed.
	5.	The default behavior of the file creation was modified to set the 
		rights at creation time.
-	Item 5.1 File: c_micasad/communication/UnixCommunication
	1.	This was fixed by checking to see if the root was not the owner 
		of the socket to remove the file.
-	Item 5.2 File: c_micasad/lib/communication/UnixIPCClientChannel.cs
	1.	This was fixed by validating the owner of the socket before use.
-	Item 5.3 File: c_micasad/lib/communication/UnixIPCClientChannel.cs
	1.	This was fixed by validating the buffer size before allocation of memory.
-	Item 5.4 File: c_micasad/lss/CASACrypto.cs
	1.	This was fixed by checking for minimum length.
	2.	We can't check for upper limit for memory for maximum file size because 
		we don't know how big the file can get. System will swap the pages out 
		of the cache if it gets big and those pages are fragments of the encrypted 
		cache. The original decrypted cache will be subject to garbage collection 
		by Mono or .Net. We have added the forced garbage collection after 
		finishing the decryption operation.
-	Item 5.5 File: c_micasad/verbs/ObjectSerializtion.cs
	1.	The memory size checks have been added to the code for validation.
-	Item 5.6 File: c_micasad/verbs/OpenSecretStore.cs
	1.	The buffer size validation is added.
	2.	MsgId 0x1001 is not correct.
-	Item 5.7 File: c_micasad/verbs/SetMasterPasscode.cs
	1.	The buffer size validation is added.
-	Item 5.8 File: c_micasad/common/SessionManager.cs
	1.	We are running as root so $PATH is root's $PATH.
	2.	We can go through he while loop twice that is the reason we used the loop.
-	Item 5.9 File: c_micasad/sscs_ndk.c
	1.	All of the instances of  strcpy, strcmp, strcat, strlen, were replaced 
		with strncpy, strncmp, strncat and strlen was eliminated. 
	2.	TheUtf8 macros were modified to force a null at the end of the string 
		buffer where the length was declared.
	3.	All of the buffer lengths for upper bounds are being validated before use.
	4.	sscsshs_ChkEscapeString was fixed.
-	Item 5.10 File: auth_token/kbr5_token/linux/get.c
	1.	This file is not build as a part of CASA 1.6 yet and is supposed to be 
		completed and shipped in CASA 1.7. The fix will be applied later.
-	Item 5.11 File: c_micasacache/sscs_ipc
	1.	Handling of the end files has been added to the code.
-	Item 5.12 File: c_micasacache/sscs_unx_ipc_client.c
	1.	Tokenize function has been fixed.
	2.	Validation of the buflen is added where applicable.
-	Item 5.13 File: c_adlib/ad_gk/native.c
	1.	The validation of the buffer length has been added to the code.

-------------------------------------------------------------------
Comment 42 Thomas Biege 2007-01-24 14:03:15 UTC
unfortunately not all bugs are fixed properly. more on this later (new audit report)
Comment 43 Cameron Mashayekhi 2007-01-24 22:01:20 UTC
Thomas,

Is possible to get a set of defects assigned for whats needed to be fixed in addition to your audit report? This would be useful for tracking them and fixing them.

That comment #26 is not specific to what these issues have been is it possible to get a more specific description on the problem, are they going to be in your report?

Thanks,
Cameron
Comment 44 Thomas Biege 2007-01-25 08:18:21 UTC
(In reply to comment #43)
> Thomas,
> 
> Is possible to get a set of defects assigned for whats needed to be fixed in
> addition to your audit report? This would be useful for tracking them and
> fixing them.

Regarding CASA 1.6 all defects I found are in the report.

For CASA/CASA_auth_token 1.7 all defects I'll find will be in the report attached to bug #222012. But I am not done yet.


> That comment #26 is not specific to what these issues have been is it possible
> to get a more specific description on the problem, are they going to be in your
> report?

They are in the report I attached here.

excerpt:
- CVE-2006-2619: is not fixed. using /home/.casa/<username> does not help. but the "attack window" is narrowed

- CVE-2006-2620: seems to be fixed but I need to verify it (maybe there is a "race condition")

- CVE-2006-2621: seems to be fixed, except for one or two cases.

Not all (but most) bugs mentioned in comment #41 are fixed. The complete list will be in the new audit report. For example, the salt generation for passwords is still vulnerable to a code book attack... but now the attack can be prepared 15 times faster.


 

Comment 45 Cameron Mashayekhi 2007-03-14 15:49:43 UTC
Since we have two defects open for this I am marking this as a dupliate for bug 222012 and close it so we can continue tracking the progress in the other defect.

Thanks,
Cameron

*** This bug has been marked as a duplicate of bug 222012 ***