POV-Ray : Newsgroups : povray.off-topic : update, updates, updates Server Time
3 Dec 2026 08:17:44 EST (-0500)
  update, updates, updates (Message 1 to 23 of 23)  
From: Kenneth
Subject: update, updates, updates
Date: 16 Jan 2013 07:00:00
Message: <web.50f696078399255c2d977c20@news.povray.org>
Wow, it seems that security updates for various pieces of 'standard'
Windows-related software are coming down fast and furious these days: Firefox,
Java, Flash Player, Windows itself (well, my old XP version.) I'm getting one or
the other of these on almost a daily basis. Cyber-criminals and spammers must be
working overtime!


Post a reply to this message

From: Francois Labreque
Subject: Re: update, updates, updates
Date: 16 Jan 2013 09:06:11
Message: <50f6b3d3$1@news.povray.org>
Le 2013-01-16 06:59, Kenneth a écrit :
> Wow, it seems that security updates for various pieces of 'standard'
> Windows-related software are coming down fast and furious these days: Firefox,
> Java, Flash Player, Windows itself (well, my old XP version.) I'm getting one or
> the other of these on almost a daily basis. Cyber-criminals and spammers must be
> working overtime!
>
This happens when someone develops a new(ish) idea on how to break into 
a system.  After that, every one starts to see if they can use the same 
apporach to break into another program.

Ex:  One guy finds out that you can create specially crafted .BMP files 
with a color palette that has 4294967297 (MAX_INT + 1) colors, causing 
the application to overflow, and execute arbitrary code.  12 other guys 
will go "hmm... interesting... Let's try with .JPG, .GIF, .PNG, etc...). 
  People will also try to find applications where this can be exploited, 
and once they find that a certain version of, say libpng is vulnerable, 
every piece of software that uses that libpng will have to be updated.

(Except POV-Ray, of course, because we were told that nothing bad could 
happen... And no one POV-Ray user would be evil enough to post a scene 
with a bad .PNG texture in it).

-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

From: Warp
Subject: Re: update, updates, updates
Date: 16 Jan 2013 13:30:21
Message: <50f6f1bd@news.povray.org>
Francois Labreque <fla### [at] videotronca> wrote:
> Ex:  One guy finds out that you can create specially crafted .BMP files 
> with a color palette that has 4294967297 (MAX_INT + 1) colors

Given that the vast majority of image files have an exact amount of
bytes reserved for the different sizes, I would like to see how you
can put a value larger than what those bytes can express there.

(Ostensibly some compressed image file type might be able to exploit
a buggy image library if there's something in the compression algorithm
that said library doesn't take into account and could cause eg. a buffer
overflow in said library when it tries to decompress the data.)

-- 
                                                          - Warp


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: update, updates, updates
Date: 16 Jan 2013 16:22:50
Message: <50f71a2a@news.povray.org>
On 16/01/2013 06:30 PM, Warp wrote:
> Francois Labreque<fla### [at] videotronca>  wrote:
>> Ex:  One guy finds out that you can create specially crafted .BMP files
>> with a color palette that has 4294967297 (MAX_INT + 1) colors
>
> Given that the vast majority of image files have an exact amount of
> bytes reserved for the different sizes, I would like to see how you
> can put a value larger than what those bytes can express there.

There appears to be plenty of software that incorrectly treats various 
size values as signed integers. (E.g., programs that malfunction on 
files larger than 2GB because they think the file size has become 
"negative".)

Personally, I blame C...


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: update, updates, updates
Date: 16 Jan 2013 16:23:54
Message: <50f71a6a$1@news.povray.org>
On 16/01/2013 11:59 AM, Kenneth wrote:
> Wow, it seems that security updates for various pieces of 'standard'
> Windows-related software are coming down fast and furious these days: Firefox,
> Java, Flash Player, Windows itself (well, my old XP version.) I'm getting one or
> the other of these on almost a daily basis. Cyber-criminals and spammers must be
> working overtime!

Just because a security flaw has been discovered, does not necessarily 
imply that anybody has actually *exploited* it yet.

It could well just be the QA people doing code reviews and finding bugs 
that way.


Post a reply to this message

From: Jim Henderson
Subject: Re: update, updates, updates
Date: 16 Jan 2013 16:38:46
Message: <50f71de6@news.povray.org>
On Wed, 16 Jan 2013 21:23:27 +0000, Orchid Win7 v1 wrote:

> Personally, I blame C...

Seems more appropriate to blame programmer inexperience (or laziness) 
than the language used.

Jim


Post a reply to this message

From: Warp
Subject: Re: update, updates, updates
Date: 16 Jan 2013 19:27:48
Message: <50f74584@news.povray.org>
Orchid Win7 v1 <voi### [at] devnull> wrote:
> There appears to be plenty of software that incorrectly treats various 
> size values as signed integers. (E.g., programs that malfunction on 
> files larger than 2GB because they think the file size has become 
> "negative".)

Can you give me a scenario where that produces a buffer overflow?

-- 
                                                          - Warp


Post a reply to this message

From: Kenneth
Subject: Re: update, updates, updates
Date: 17 Jan 2013 01:50:08
Message: <web.50f79e4d9a8e0d4bc2d977c20@news.povray.org>
Orchid Win7 v1 <voi### [at] devnull> wrote:

>
> It could well just be the QA people doing code reviews and finding bugs
> that way.

Yeah, I'm thinking it's probably half and half: real security breaches; and
entities like Kaspersky Labs finding possible exploitable loopholes before the
fact.

BTW, I just got *another* Windows security update.


Post a reply to this message

From: Francois Labreque
Subject: Re: update, updates, updates
Date: 18 Jan 2013 09:23:51
Message: <50f95af7$1@news.povray.org>
Le 2013-01-16 13:30, Warp a écrit :
> Francois Labreque <fla### [at] videotronca> wrote:
>> Ex:  One guy finds out that you can create specially crafted .BMP files
>> with a color palette that has 4294967297 (MAX_INT + 1) colors
>
> Given that the vast majority of image files have an exact amount of
> bytes reserved for the different sizes, I would like to see how you
> can put a value larger than what those bytes can express there.
>

Sorry, it was MAX_SIGNED_INT +1.

Of course, the file formats are usually strict enough, but they can't 
prevent all problems.

http://technet.microsoft.com/en-us/security/bulletin/ms04-028
http://technet.microsoft.com/en-us/security/bulletin/ms08-052
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2004-0597

In the case of the BMP flaw, the leaked Windows 2000 source code showed 
that the DLL was using a signed int to read an offset value that was 
unsigned in the file format, so by crafting a special BMP file you would 
have the DLL jump to a negative offset, and outside of the actual data 
structure it was supposed to read.  Now since GDI.DLL runs in ring 0 for 
performance reasons, the fault was not caught and the program would 
continue reading garbage, which in turn would cause a buffer overflow 
and arbitrary code execution.  Photoshop CS2 and CS3 were vulnerable to 
this one, on top of all the MS applications that use GDI.DLL, so it 
wasn't only shoddy programming on Microsoft's part.

I don't have the specifics on the JPG or PNG ones, but from the MITRE 
descritpion, the JPG also used an improper cast in the DLL to achieve 
its result.  For the PNG vulnerability, it was a problem with libpng not 
handling a variable field length properly.

I'm sure you know that there are many, many ways a programmer can screw up.

-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

From: Francois Labreque
Subject: Re: update, updates, updates
Date: 18 Jan 2013 09:36:30
Message: <50f95dee$1@news.povray.org>
Le 2013-01-16 19:27, Warp a écrit :
> Orchid Win7 v1 <voi### [at] devnull> wrote:
>> There appears to be plenty of software that incorrectly treats various
>> size values as signed integers. (E.g., programs that malfunction on
>> files larger than 2GB because they think the file size has become
>> "negative".)
>
> Can you give me a scenario where that produces a buffer overflow?
>

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0894
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0986
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-1573
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-3015
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-3020
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5870
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5937
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-1570
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-2518
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-0596
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-0598
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-0599
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-0602
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-0915
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-1197
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-3966

More at:

http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=BMP
http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=JPG
http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=PNG
http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=MP3
Etc...
-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

From: Francois Labreque
Subject: Re: update, updates, updates
Date: 18 Jan 2013 09:38:11
Message: <50f95e53$1@news.povray.org>
Le 2013-01-16 16:24, Orchid Win7 v1 a écrit :
> On 16/01/2013 11:59 AM, Kenneth wrote:
>> Wow, it seems that security updates for various pieces of 'standard'
>> Windows-related software are coming down fast and furious these days:
>> Firefox,
>> Java, Flash Player, Windows itself (well, my old XP version.) I'm
>> getting one or
>> the other of these on almost a daily basis. Cyber-criminals and
>> spammers must be
>> working overtime!
>
> Just because a security flaw has been discovered, does not necessarily
> imply that anybody has actually *exploited* it yet.
>
> It could well just be the QA people doing code reviews and finding bugs
> that way.

QA people?  You mean the one guy in India who quit last month and can't 
be replaced because there's a hiring freeze because the 3rd quarter 
results weren't good enough?

-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

From: Warp
Subject: Re: update, updates, updates
Date: 18 Jan 2013 10:54:48
Message: <50f97048@news.povray.org>
Francois Labreque <fla### [at] videotronca> wrote:
> Le 2013-01-16 19:27, Warp a écrit :
> > Orchid Win7 v1 <voi### [at] devnull> wrote:
> >> There appears to be plenty of software that incorrectly treats various
> >> size values as signed integers. (E.g., programs that malfunction on
> >> files larger than 2GB because they think the file size has become
> >> "negative".)
> >
> > Can you give me a scenario where that produces a buffer overflow?

> http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0894

That didn't really answer my question.

-- 
                                                          - Warp


Post a reply to this message

From: Warp
Subject: Re: update, updates, updates
Date: 18 Jan 2013 10:58:51
Message: <50f9713b@news.povray.org>
Francois Labreque <fla### [at] videotronca> wrote:
> In the case of the BMP flaw, the leaked Windows 2000 source code showed 
> that the DLL was using a signed int to read an offset value that was 
> unsigned in the file format, so by crafting a special BMP file you would 
> have the DLL jump to a negative offset, and outside of the actual data 
> structure it was supposed to read.

In 2's complement representation MAX_INT+1 has the exact same bits in
both signed and unsigned forms. How do you get outside the array with
that value?

(I suppose that if you use a signed *long* in a 64-bit system where longs
are 64-bit, then expanding a signed 32-bit int to such a signed 64-bit long
will result in the wrong value. But was that the case here?)

-- 
                                                          - Warp


Post a reply to this message

From: clipka
Subject: Re: update, updates, updates
Date: 18 Jan 2013 12:07:27
Message: <50f9814f@news.povray.org>
Am 18.01.2013 16:58, schrieb Warp:
> Francois Labreque <fla### [at] videotronca> wrote:
>> In the case of the BMP flaw, the leaked Windows 2000 source code showed
>> that the DLL was using a signed int to read an offset value that was
>> unsigned in the file format, so by crafting a special BMP file you would
>> have the DLL jump to a negative offset, and outside of the actual data
>> structure it was supposed to read.
>
> In 2's complement representation MAX_INT+1 has the exact same bits in
> both signed and unsigned forms. How do you get outside the array with
> that value?

That's wrong. In 2's complement representation, MAX_INT+1 has NO bit 
representation at all. What you get instead if you interpret the 
respective unsigned representation as signed is MIN_INT.

So take an array with a limited size, an "int" as an index into that 
array, a check whether that index into that array is smaller than the 
array's size - and you have the recipe for a stack overflow or similar 
(unless you also remember to check whether the index is non-negative).


Post a reply to this message

From: Orchid Win7 v1
Subject: Re: update, updates, updates
Date: 18 Jan 2013 12:47:00
Message: <50f98a94$1@news.povray.org>
>> In 2's complement representation MAX_INT+1 has the exact same bits in
>> both signed and unsigned forms. How do you get outside the array with
>> that value?
>
> That's wrong. In 2's complement representation, MAX_INT+1 has NO bit
> representation at all. What you get instead if you interpret the
> respective unsigned representation as signed is MIN_INT.

Erm... don't you mean -1?


Post a reply to this message

From: Warp
Subject: Re: update, updates, updates
Date: 18 Jan 2013 13:22:58
Message: <50f99301@news.povray.org>
Orchid Win7 v1 <voi### [at] devnull> wrote:
> >> In 2's complement representation MAX_INT+1 has the exact same bits in
> >> both signed and unsigned forms. How do you get outside the array with
> >> that value?
> >
> > That's wrong. In 2's complement representation, MAX_INT+1 has NO bit
> > representation at all. What you get instead if you interpret the
> > respective unsigned representation as signed is MIN_INT.

> Erm... don't you mean -1?

No. int(-1) has the same bit representation as MAX_UINT.

-- 
                                                          - Warp


Post a reply to this message

From: clipka
Subject: Re: update, updates, updates
Date: 18 Jan 2013 13:25:13
Message: <50f99389@news.povray.org>
Am 18.01.2013 18:47, schrieb Orchid Win7 v1:
>>> In 2's complement representation MAX_INT+1 has the exact same bits in
>>> both signed and unsigned forms. How do you get outside the array with
>>> that value?
>>
>> That's wrong. In 2's complement representation, MAX_INT+1 has NO bit
>> representation at all. What you get instead if you interpret the
>> respective unsigned representation as signed is MIN_INT.
>
> Erm... don't you mean -1?

No. That would be MAX_UINT.


Post a reply to this message

From: Warp
Subject: Re: update, updates, updates
Date: 18 Jan 2013 13:30:05
Message: <50f994ad@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> So take an array with a limited size, an "int" as an index into that 
> array, a check whether that index into that array is smaller than the 
> array's size - and you have the recipe for a stack overflow or similar 
> (unless you also remember to check whether the index is non-negative).

There's no index value that *could* be smaller than MIN_INT, so you would
have a bug certainly (the program wrongly thinks that all indices are
outside the array), but still no out-of-bounds access.

Even if the array size is (interpreted as) something larger than MIN_INT,
thus allowing for indices that are smaller than it, it would still bug
but not access out of the array (because negative indices "wrap around"
when they are converted to memory offsets, ending up at the same place
as the unsigned index with the same bit pattern.)

The only situation that I can think of where an out-of-bounds access will
probably happen is if pointers (and thus array indices) are 64-bit but
the array size is wrongly a signed (32-bit) int. It then gets expanded
to 64-bit when indexing the array, and ends up truly at negative addresses
(from the array's start.)

-- 
                                                          - Warp


Post a reply to this message

From: clipka
Subject: Re: update, updates, updates
Date: 18 Jan 2013 13:44:27
Message: <50f9980b$1@news.povray.org>
Am 18.01.2013 19:30, schrieb Warp:
> clipka <ano### [at] anonymousorg> wrote:
>> So take an array with a limited size, an "int" as an index into that
>> array, a check whether that index into that array is smaller than the
>> array's size - and you have the recipe for a stack overflow or similar
>> (unless you also remember to check whether the index is non-negative).
>
> There's no index value that *could* be smaller than MIN_INT, so you would
> have a bug certainly (the program wrongly thinks that all indices are
> outside the array), but still no out-of-bounds access.

Okay, let's do it a bit more specific:

   void fubar(int idx)
   {
     char c[1024];
     if (idx < 1024)
       fnord(c[idx]);
     else
       FAIL_SAFE();
   }

   void main()
   {
     fubar(INT_MAX+1);
   }

No out-of-bounds access? Look at the code again.


Post a reply to this message

From: Warp
Subject: Re: update, updates, updates
Date: 18 Jan 2013 13:55:36
Message: <50f99aa8@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Okay, let's do it a bit more specific:

>    void fubar(int idx)
>    {
>      char c[1024];
>      if (idx < 1024)
>        fnord(c[idx]);
>      else
>        FAIL_SAFE();
>    }

>    void main()
>    {
>      fubar(INT_MAX+1);
>    }

> No out-of-bounds access? Look at the code again.

But in the original post it was suggested that an array size of INT_MAX+1
in the image file could cause this. Here the array size is just 1024 (which
in this particular contest would have ostensibly been read from the image
file.)

Unless there's an image file where there are actual index values specified.

-- 
                                                          - Warp


Post a reply to this message

From: Francois Labreque
Subject: Re: update, updates, updates
Date: 18 Jan 2013 14:34:38
Message: <50f9a3ce$1@news.povray.org>
Le 2013-01-18 10:58, Warp a écrit :
> (I suppose that if you use a signed *long* in a 64-bit system where longs
> are 64-bit, then expanding a signed 32-bit int to such a signed 64-bit long
> will result in the wrong value. But was that the case here?)
>

While this one 
(http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0894) didn't use 
negative offsets, only out of bounds indexes that weren't checked by the 
programmer.

This one, did use negative indexes:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0986
More details: http://cxsecurity.com/issue/WLB-2008030020

-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

From: Francois Labreque
Subject: Re: update, updates, updates
Date: 18 Jan 2013 14:48:06
Message: <50f9a6f6$1@news.povray.org>
Le 2013-01-18 13:55, Warp a écrit :
> clipka <ano### [at] anonymousorg> wrote:
>> Okay, let's do it a bit more specific:
>
>>     void fubar(int idx)
>>     {
>>       char c[1024];
>>       if (idx < 1024)
>>         fnord(c[idx]);
>>       else
>>         FAIL_SAFE();
>>     }
>
>>     void main()
>>     {
>>       fubar(INT_MAX+1);
>>     }
>
>> No out-of-bounds access? Look at the code again.
>
> But in the original post it was suggested that an array size of INT_MAX+1
> in the image file could cause this. Here the array size is just 1024 (which
> in this particular contest would have ostensibly been read from the image
> file.)

I was going from memory.  Sorry about that.  It's not the array size 
that's too big.  Just accessing elements outside of it.

>
> Unless there's an image file where there are actual index values specified.
>

Bingo.

FWIW, there's a group at the University of Oulu 
(https://www.ee.oulu.fi/research/ouspg/), next door to you, who do this 
all day long.  Try to break devices by sending specially crafted packets 
that don't respect the protocol specs.  They were really famous for a 
while in 2002, when they found out that every single device from every 
single network equipment vendor was vulnerable to denial-of-service 
attacks using SNMP.

-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

From: scott
Subject: Re: update, updates, updates
Date: 21 Jan 2013 03:23:24
Message: <50fcfafc$1@news.povray.org>
> The only situation that I can think of where an out-of-bounds access will
> probably happen is if pointers (and thus array indices) are 64-bit but
> the array size is wrongly a signed (32-bit) int. It then gets expanded
> to 64-bit when indexing the array, and ends up truly at negative addresses
> (from the array's start.)

You could also have the situation where the code is inconsistent 
regarding signed and unsigned (32-bit) values. Couldn't something like 
this break with a negative value of imageSize stored in the image file?

void LoadImageFromFile(unsigned int size);
void ReserveMemory(int size);

int headerSize = 1024;
int imageSize = readIntFromFile();
ReserveMemory(headerSize + imageSize);
LoadHeaderFromFile(headerSize);
LoadImageFromFile(imageSize);


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.