First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 128690
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Raphael Marichez <falco@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
1.patch Plug buffer overflows. Not even compile-tested. patch Alexey Dobriyan 2006-04-07 08:22 0000 8.29 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 128690 depends on: Show dependency tree
Show dependency graph
Bug 128690 blocks:

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2006-04-03 13:54 0000
Versions:     <= 1.8.6 (and current SVN 1.9.0)
Platforms:    Windows, *nix, *BSD, Mac and others
Bug:          format string bug in Con_Message and Con_Printf
Exploitation: remote, versus server and clients
Date:         03 Apr 2006
Author:       Luigi Auriemma
Source : full-disc


Bug (from full-disc) :


--- begin of quotation ---
The Doomsday engine contains many functions used for the visualization
of the messages in the console.
Both Con_Message and conPrintf are vulnerable to a format string
vulnerability which could allow an attacker to execute malicious code
versus the server or the clients.
The first function calls a "Con_Printf(buffer)" while the second one
calls a "SW_Printf(prbuff)" if SW_IsActive is enabled (which means
ever).

>From Src/con_main.c:

void Con_Message(const char *message, ...)
{
        va_list argptr;
        char   *buffer;

        if(message[0])
        {
                buffer = malloc(0x10000);

                va_start(argptr, message);
                vsprintf(buffer, message, argptr);
                va_end(argptr);

#ifdef UNIX
                if(!isDedicated)
                {
                        // These messages are supposed to be visible in the
real console.
                        fprintf(stderr, "%s", buffer);
                }
#endif

                // These messages are always dumped. If consoleDump is set,
                // Con_Printf() will dump the message for us.
                if(!consoleDump)
                        printf("%s", buffer);

                // Also print in the console.
                Con_Printf(buffer);

                free(buffer);
        }
        Con_DrawStartupScreen(true);
}

...

void conPrintf(int flags, const char *format, va_list args)
{
        unsigned int i;
        int     lbc;                            // line buffer cursor
        char   *prbuff, *lbuf = malloc(maxLineLen + 1);
        cbline_t *line;

        if(flags & CBLF_RULER)
        {
                Con_AddRuler();
                flags &= ~CBLF_RULER;
        }

        // Allocate a print buffer that will surely be enough (64Kb).
        // FIXME: No need to allocate on EVERY printf call!
        prbuff = malloc(65536);

        // Format the message to prbuff.
        vsprintf(prbuff, format, args);

        if(consoleDump)
                fprintf(outFile, "%s", prbuff);
        if(SW_IsActive())
                SW_Printf(prbuff);
    ...


--- end ---

------- Comment #1 From Raphael Marichez 2006-04-03 13:58:45 0000 -------
no upstream update still available on
http://www.doomsdayhq.com/files.php?class=1

------- Comment #2 From Mr. Bones. 2006-04-03 16:28:58 0000 -------
package masked

------- Comment #3 From Raphael Marichez 2006-04-03 16:37:21 0000 -------
very fast!

masking-GLSA decision ?

poor gamers... :'(

------- Comment #4 From Sune Kloppenborg Jeppesen 2006-04-03 21:58:17 0000 -------
If it's a B1 we should issue a masking GLSA.

------- Comment #5 From Raphael Marichez 2006-04-05 09:10:03 0000 -------
OK. Jaervosz, i'm sure you wand to draft the GLSA :)

------- Comment #6 From Sune Kloppenborg Jeppesen 2006-04-05 09:56:22 0000 -------
It's already in GLSAmaker :P

------- Comment #7 From Raphael Marichez 2006-04-06 00:09:43 0000 -------
GLSA sent by DerCorny, thanks to everybody, sorry for the gamers.

The bug goes in enhancement, pending resolution.

------- Comment #8 From Florian Westphal 2006-04-06 09:28:57 0000 -------
Why wasn't this fixed prior to GLSA instead of masking this?
Judging by Luigi Auriemmas advisory the fix is trivial.
Is there more to this than described here?

------- Comment #9 From Stefan Cornelius (RETIRED) 2006-04-07 00:27:25 0000 -------
Nobody is happy with a mask, but you should take into account that this game
doesnt seem to be supported by upstream anymore, so basically it was already
dead before this issue came up. Altough the fix might not be technically
challenging, it will take valuable time to implement and test it - do you
really think that we should waste our resources on dead things?

------- Comment #10 From Alexey Dobriyan 2006-04-07 08:22:30 0000 -------
Created an attachment (id=84133) [edit]
Plug buffer overflows. Not even compile-tested.

How much people use it? I mean does it make sense to read through this junk
more carefully?

------- Comment #11 From Florian Westphal 2006-04-07 10:04:31 0000 -------
(In reply to comment #9)
> doesnt seem to be supported by upstream anymore, so basically it was already
> dead before this issue came up. Altough the fix might not be technically
> challenging, it will take valuable time to implement and test it - do you
> really think that we should waste our resources on dead things?

Yes, if the fix is obvious and no replacement exists.

No,
a) ..if the fix is too complicated/difficult and/or
b) ..a (brief) look at affected code sections
   shows that its too ugly/bug-ridden anyway.

IMO it would be a good idea to state the reason for masking
(Code looks suspicious; Unmaintained/Upstream dead, etc.) in future GLSAs.

As for "Upstream is dead": The last svn check in was (at this time of writing)
19 hours ago.... will try to contact them.

------- Comment #12 From Florian Westphal 2006-04-09 08:58:38 0000 -------
(In reply to comment #11)
> As for "Upstream is dead": The last svn check in was (at this time of writing)
> 19 hours ago.... will try to contact them. 

Fixed in svn. Don't know when a new release will be made, though.

------- Comment #13 From Yagisan 2006-04-17 09:37:11 0000 -------
Upstream for this is alive and well. You are aware that gentoo isn't even using
the current release right ? Current release is 1.9.0beta3, and that was
released a long time ago
http://prdownloads.sourceforge.net/deng/deng-1.9.0-beta3.tar.gz?download ,
Perhaps it would be an idea for a gentoo maintainer to keep in contact with
upstream (or other distro maintainers), or at the very least, follow progress
here http://deng.sourceforge.net/blog/.

------- Comment #14 From Stefan Cornelius (RETIRED) 2006-04-17 10:20:34 0000 -------
Yeah, I'm happy to see that I was wrong about thinking that upstream is dead.
But betas are usually hardmasked, too - so this won't help a lot here.Games
team, upstream accepted a slightly edited version of the patch Alexey provided,
what do you think about patching and revbumping?

------- Comment #15 From Yagisan 2006-04-17 15:19:47 0000 -------
My personal option, (as the guy that has been preparing packages for ubuntu),
is that the bump to 1.9.0beta3 solves more bugs then it causes. The new memory
management system takes care of the most common, out of memory errors users
report.

Also, I'd like to thank you for doing a security audit on doomsday in the first
place.

------- Comment #16 From SpanKY 2006-04-21 23:12:52 0000 -------
1.9.0_beta3 now in portage

------- Comment #17 From SpanKY 2006-04-21 23:14:15 0000 -------
... which doesnt help as it doesnt contain the fix :)

can someone cut the patch from current svn for me to integrate please ?

------- Comment #18 From Yagisan 2006-05-14 06:15:55 0000 -------
It is known fixed as of svn 3153. Either backport changes, or wait for beta4.

------- Comment #19 From Chris Gianelloni 2006-05-14 08:02:03 0000 -------
We'll just wait.  Thanks.

------- Comment #20 From Yagisan 2006-05-30 14:37:29 0000 -------
beta4 is out.
http://sourceforge.net/project/showfiles.php?group_id=74815&package_id=75784&release_id=420613

------- Comment #21 From Raphael Marichez 2006-05-30 15:57:59 0000 -------
Thanks Yagisan.

Games team , can you bump it please ?

------- Comment #22 From Mr. Bones. 2006-05-30 18:25:23 0000 -------
Security team, please do what ever security stuff you need to do and reassign
to games for the version bump.  Thanks.

------- Comment #23 From Sune Kloppenborg Jeppesen 2006-05-30 20:40:44 0000 -------
Games team, please bump or comment why not to do it.

Normal procedure is not to reassign but to cc maintainers/arches.

------- Comment #24 From Chris Gianelloni 2006-05-31 15:02:34 0000 -------
This is in progress...

------- Comment #25 From Chris Gianelloni 2006-05-31 16:32:57 0000 -------
A new ebuild has just been submitted into the tree.  You'll want the ppc team
to stabilize it.  I've stabilized it on x86.

------- Comment #26 From Raphael Marichez 2006-06-01 00:03:53 0000 -------
great, let's go

------- Comment #27 From Tobias Scherbaum 2006-06-01 21:58:00 0000 -------
ppc stable

------- Comment #28 From Raphael Marichez 2006-06-02 03:14:22 0000 -------
Thanks to all. This one is ready for GLSA

------- Comment #29 From Raphael Marichez 2006-06-02 03:30:02 0000 -------
sec team, i don't know yet how to handle final GLSAs after a temp GLSA. I let
you act here.

------- Comment #30 From Raphael Marichez 2006-06-07 14:33:07 0000 -------
> sec team, i don't know yet how to handle final GLSAs after a temp GLSA. I let
> you act here.
> 

Jaervosz, Koon or DerCorny, or another security dev, please help us
drafting/sending a GLSA update for doomsday (or whatever is appropriate here).
Thanks in advance

------- Comment #31 From wgi@muenster.de 2006-06-07 15:05:57 0000 -------
jaervosz committed himself to do this .-)

------- Comment #32 From Sune Kloppenborg Jeppesen 2006-06-07 22:16:31 0000 -------
I'll do it, hopefully in the evening.

------- Comment #33 From Raphael Marichez 2006-06-13 14:18:39 0000 -------
(In reply to comment #32)
> I'll do it, hopefully in the evening.
> 

Sune, please, oh please... (and don't forget to delete the bogus doomsday entry
in glsamaker, thanks in advance)

------- Comment #34 From Sune Kloppenborg Jeppesen 2006-06-14 02:27:12 0000 -------
Raphael, I've been too busy and forgot. Please prod me tonight and I'll fix it
(can't send from work).

------- Comment #35 From Sune Kloppenborg Jeppesen 2006-06-14 11:39:00 0000 -------
/me pick up his coredump and stuffs it back in: We don't issue unmask GLSAs.
I've fixed it in GLSAmaker, Raphael could you review and I'll commit it.

------- Comment #36 From Raphael Marichez 2006-06-14 12:59:38 0000 -------
Thanks Sune for the precision

############################################
Workaround:
There is no known workaround at this time.

There is no known workaround at this time.
############################################

Except that, it's ok.

I close that bug now

------- Comment #37 From Sune Kloppenborg Jeppesen 2006-06-14 21:16:25 0000 -------
Thx Raphael for spotting that double boilerplate blunder. In CVS now.

First Last Prev Next    No search results available      Search page      Enter new bug