centos 6
shell weakness #8

4

Weakness Breakdown


Definition:

A shell weakness occurs when a program enables an attacker to execute unexpected commands on the operating system.

Warning code(s):

This causes a new program to execute and is difficult to use safely.

File Name:

gprolog-1.3.1/src/W32GUICons/w32_console.c

Context:

The highlighted line of code below is the trigger point of this particular Centos 6 shell weakness.

     case IDM_FLUSH:
        Flush_Buffer();
        break;
        
    case IDM_SHOW_CONSOLE:
        show_console = 1 - show_console;
        Show_Text_Console(show_console);
        SetFocus(hwndEditControl);
        break;
        
        
    case IDM_FONT:
        CallChangeFont(hwnd);
        break;
        
    case IDM_MANUAL:
        Show_Help(NULL);
        break;
        
    case IDM_INDEX:
        Show_Help(Get_Current_Word());
        break;
        
    case IDM_WEB:
	ShellExecute(NULL, "open", "http://www.gprolog.org/", NULL, ".", 0);
	break;

    case IDM_ABOUT:
        MessageBox(hwndMain, ABOUT_TEXT, "About GNU Prolog",
            MB_OK | MB_ICONINFORMATION);
        break;
    }
}



static HFONT
CreationCourier(int flag)
{
    memset(&CurrentFont, 0, sizeof(LOGFONT));
    
    CurrentFont.lfCharSet = ANSI_CHARSET;
    CurrentFont.lfWeight = FW_NORMAL;
    if (flag)
        CurrentFont.lfHeight = 18;
    else
        CurrentFont.lfHeight = 15;
    CurrentFont.lfPitchAndFamily = (BYTE) (FIXED_PITCH | FF_MODERN);
    strcpy(CurrentFont.lfFaceName, "Courier");	/* Courier */
    return (CreateFontIndirect(&CurrentFont)); 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.