Security Research
Showing results for 
Search instead for 
Do you mean 

Failed patches: Getting paid twice is nice

Shannon_Sabens ‎02-19-2014 04:54 PM - edited ‎02-20-2014 07:38 AM

Back in my ZDI contribution days, I always had a big question in mind, “What product should I audit?”

 

Of course, it stinks for a researcher to spend weeks auditing a certain product for bugs and in the end he/she gets a “not interested in the product” email.

 

To avoid disappointments, I tried as much as I could to target well-known vendors. Besides well-known vendors, I used to look at the “Upcoming” section in the ZDI website and check for vendors that interest ZDI.

 

One product that matched the “well-known vendor” category was Citrix. So, I started checking the applications available for download from their website. One of the products that I checked was Citrix Provisioning Services.

 

Citrix Patch Fail

Initially, I found a remote code execution bug in the streamprocess.  Citrix put out a patch as ZDI-11-023.  But the fun for me, was finding that the patch actually failed to fix the problem. I won’t cover the steps that I took to find the bug, I’ll just highlight the problem quickly. Here’s the initial bug that I found (from the report that I submitted to ZDI back then):

MOV  EDI,DWORD PTR DS:[ECX]

ADD  ECX,0C

MOV  DWORD PTR SS:[EBP-C], ECX

CMP  EDI,DWORD PTR SS:[EBP+8]

JA   SHORT XXXXX

PUSH EDI

MOV  EDX,ECX

MOV  ECX,ESI

CALL COPY_FUNCTION_

 

Basically, if you bypassed that CMP, the copy function will copy your buffer blindly to the stack. Eventually, Citrix “fixed” this bug and released version 5.6 sp1. Here’s what actually happened with the patch:

 

Bright. :)

 

The problem is that there is no NULL check here.  This allows us to put the zero back into this zero-day.

By supplying a NULL value, it bypasses the JA instruction and the LEA instruction will load 0xFFFFFFFF into EAX causing the overflow to still occur.  Patch fail.

 

When the execution reaches wcsncpy() the stack  would look like this:


 

The results looked like this:


 

And eventually, looked better:


 

This was reported to Citrix by ZDI. And Citrix addressed the bug correctly, the second time, as ZDI-13-018.  :)

 

I got paid for the initial bug and ZDI paid me for finding the patch bypass, as well.

 

A guest post by Abdul Aziz Hariri

HP ESP Senior Security Researcher

 

0 Kudos
About the Author

Shannon_Sabens

Leave a Comment

We encourage you to share your comments on this post. Comments are moderated and will be reviewed
and posted as promptly as possible during regular business hours

To ensure your comment is published, be sure to follow the Community Guidelines.

Be sure to enter a unique name. You can't reuse a name that's already in use.
Be sure to enter a unique email address. You can't reuse an email address that's already in use.
Type the characters you see in the picture above.Type the words you hear.
Labels
Events
Jun 7-9
Las Vegas
Discover 2016 Las Vegas
Discover 2016 in Las Vegas, the ultimate showcase technology event for business and IT professionals to learn, connect, and grow.
Read more
Sep 13-16
National Harbor, MD
HPE Protect 2016
Protect 2016 is our annual conference and is the place to meet the world’s top information security talent, discuss new products and share information...
Read more
View all