what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

symantecAV.txt

symantecAV.txt
Posted Feb 16, 2004
Authored by Dr. Peter Bieringer

The Symantec AntiVirus Scan Engine for Linux has a possible race condition via a symlink attack in /tmp.

tags | advisory
systems | linux
SHA-256 | 7603b97a86063ada3a6bbaacd9422e0f4212735f47d6515ab0e95f25df4ccb24

symantecAV.txt

Change Mirror Download
Hi,

during evaluation of Symantec AntiVirus Scan Engine for Red Hat Linux
(file: Scan_Engine_430-RedHat-1.zip) we found a race condition using
default configuration.

Like written in "Implementation_Guide.pdf" on page 134 LiveUpdate can be
triggered by cron via a shell script:

# /opt/SYMCScan/bin/liveupdate.sh -virusdefs
or
# /bin/sh /opt/SYMCScan/bin/liveupdate.sh -virusdefs

This will create a log file in /tmp with a very predictable name:
"/tmp/LiveUpdate.log" (with permissions of 644)

# ll /tmp/
-rw-r--r-- 1 symantec avdefs 4517 Feb 16 15:05 LiveUpdate.log

This is defined in the config file "liveupdate.conf":

# cat /etc/liveupdate.conf
protocol=http
host=liveupdate.symantec.com
workdir=/tmp
logfile=/tmp/LiveUpdate.log <---!!!!!!

Impact:
Before first run of LiveUpdate (like suggested in doc, user "symantec" does
this) a possible race condition via a symlink attack by another user will
result in the creation of a new file (as user "symantec") or appending
LiveUpdate log to an existent file (owned by user "symantec").

Additional *important* note:
Because the PDF document doesn't match the as-it-is of the installation (an
user "symantec" can't execute liveupdate.sh" without adjusting the
permissions of the shell script and the directory "virusdefs") it's very
possible, that admins configure the crontab entry for "liveupdate.sh" as
user "root"!

# ll /opt/SYMCScan/bin/liveupdate.sh
-rwxr-x--- 1 root root 14700 Feb 16 16:16
/opt/SYMCScan/bin/liveupdate.sh

# ll /opt/SYMCScan |grep virusdefs
drwxr-xr-x 2 root root 4096 Feb 16 16:16 virusdefs


BTW: The installer uses PID for tmp directory naming, another minor issue...

# ll /tmp/
drwxr-xr-x 2 root root 4096 Feb 16 15:47 symcinst9918
# ps -ax | grep 9918
9918 pts/0 S 0:02 sh ./ScanEngine.sh

-> fix to a unpredictable name


BTW2: looks like a temp directory during install has always the same name.
# ll /tmp/
drwx------ 2 root root 4096 Feb 16 16:16 savsetmp

-> fix to a unpredictable name


BTW3: temporary directory during LiveUpdate run has permissions 755
# ll /tmp/
drwxr-xr-x 2 root root 4096 Feb 16 16:37 1076967476267

-> fix permissions to at least 750, perhaps it's also not the best method
to use Unix time in milliseconds to name this directory.


Suggestions/workarounds:
* for the software vendor:
use a better default value, e.g.
logfile=/var/log/LiveUpdate.log
Fix permissions of log file to at least 640
Fix PDF document or/and permissions for
liveupdate.sh and directory virusdefs
(and on RHL systems: "/usr/bin/sh" doesn't exist, fix to "/bin/sh")
Fix predictable directory names during installation
Fix permissions of temp directory during LiveUpdate run to at least 750
Fix name of temp directory to a more unpredictable one


* for administrators:
adjust config file before first run of the LiveUpdate process
adjust permissions of
liveupdate.sh and directory virusdefs
and run liveupdate.sh as non-root user


Regards,
Dr. Peter Bieringer
--
Dr. Peter Bieringer Phone: +49-8102-895190
AERAsec Network Services and Security GmbH Fax: +49-8102-895199
Wagenberger Straße 1 Mobile: +49-174-9015046
D-85662 Hohenbrunn E-Mail: pbieringer@aerasec.de
Germany Internet: https://www.aerasec.de
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
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    8 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    17 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