centos 6
shell weakness #9

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/Wam2Ma/wam2ma.c

Context:

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

 



/*-------------------------------------------------------------------------*
 * NEW_DIRECTIVE                                                           *
 *                                                                         *
 *-------------------------------------------------------------------------*/
void
New_Directive(int pl_line, int system)
{
  Direct *p;

  cur_direct_no++;
  p = (Direct *) malloc(sizeof(Direct));
  if (p == NULL)
    {
      fprintf(stderr, "Cannot allocate memory for directive #%d\n",
	      cur_direct_no);
      exit(1);
    }

  p->pl_file = cur_pl_file;
  p->pl_line = pl_line;
  p->system = system;
  p->next = NULL;

  direct_end->next = p;
  direct_end = p;

  if (comment)
    Label_Printf("\n\n; *** %s Directive (%s:%d)",
		 (system) ? "System" : "User", cur_pl_file->str, pl_line);

  Label_Printf("\n\npl_code local directive_%d", cur_direct_no);
}




/*-------------------------------------------------------------------------*
 * ENSURE_LINKED                                                           *
 *                                                                         *
 *-------------------------------------------------------------------------*/
void
Ensure_Linked(ArgVal arg[])
{
  DEF_PRED(hexa);
  DEF_INTEGER(n);
  Args1(INTEGER(nb_elem)); 

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.