* security
@ Tyler Spivey
0 siblings, 0 replies; 7+ messages in thread
From: Tyler Spivey @ UTC (permalink / raw)
To: speakup
CC: blinux-list@redhat.com
i found this on the bugtraq list - more sendmail vulns.
Subject: RAZOR advisory: multiple Sendmail vulnerabilities
>From Michal Zalewski
Mail sent Mon, 1 Oct 2001 11:57:12 -0400 (EDT)
Reply to lcamtuf@echelon.pl
RAZOR Advisory: Multiple Local Sendmail Vulnerabilities
=======================================================
Author: Michal Zalewski <lcamtuf@razor.bindview.com>
Release Date: 10/01/2001
Assigned CVE numbers: CAN-2001-0713, CAN-2001-0714, CAN-2001-0715
Topic:
------
The Sendmail mail delivery subsystem is vulnerable to multiple local
attacks that lead to information loss, information leaks and mail system
compromise.
Affected Systems:
-----------------
The mail system privileges compromise affects Sendmail 8.12.0. Other
problems affect all versions up to 8.12.0.
Vulnerability 1: Mail System Compromise -- CAN-2001-0713
--------------------------------------------------------
Sendmail 8.12.0, in its default installation, is no longer using a setuid
root binary to manipulate the mail queue and submit mail. This security
enhancement is supposed to minimize the eventual impact of local Sendmail
vulnerabilities. The new Sendmail binary is setgid smmsp, where smmsp is a
special group with read-write queue access permissions.
>From previous versions, Sendmail 8.12 inherits a functionality that allows
users to specify custom configuration files or configuration parameters. In
this case of processing of untrusted configurations, Sendmail was supposed
to drop all extra privileges and continue to run at user level, causing no
security risk. This mechanism worked fine in Sendmail versions prior to
8.12.0. Because of a programming error, this inherited code fails to drop
extra group privileges completely in new setgid conditions, leaving the
saved gid value untouched. By calling the setregid() function, the attacker
will be able to regain dropped privileges. Extra privileges expose a
security risk to the mail subsystem and, in specific conditions, might lead
to further privilege elevation (see discussion below).
In order to issue setregid(), the attacker has to take over control of the
program itself. A possible attack vector is to exploit configuration file
parsing code. This code is not supposed to be bullet-proof - it is intended
to parse trusted content or untrusted content, but run with no extra
privileges. We have determined that there are multiple potentially
exploitable conditions that can be triggered by custom configuration files
(-C parameter):
* Parsing one-letter macro names in rewrite rules that have the high bit set
cause a delayed crash in miscellaneous locations, e.g. the queueup()
function during sendall(). This indicates memory corruption problem:
R$- $ó: $(dequote $1 $) < @ *LOCAL* > dequote "foo"
* The function setoption() in readcf.c file, invocation of bitnset() can
result in a memory overwrite if the following line is found in a
configuration file:
Oó some=thing
A crash occurs immediately.
* The function getmodifiers() in daemon.c, invocation of setbitn() in the
following case:
O DaemonPortOptions=Port=587, Name=MSA, M=ó
In all examples, 'ó' can be replaced with any ASCII character with the high
bit set (this causes the signed char value to be negative and the table to
be accessed outside the assigned area).
Note that our .cf parser code audit is not supposed to be complete or
accurate, and results are only provided to demonstrate the possibility of
attack. The proper solution to this problem is to fix the privilege-dropping
code.
Once the Sendmail process is controlled by the attacker, s/he can issue the
setregid() system call and gain smmsp group access level. This group is
allowed to manipulate the user-level queue (/var/spool/clientmqueue). This
allows the attacker to read and/or modify other users' mail, and to enable
further privilege elevation due to a practice suggested by Sendmail 8.12
documentation (sendmail/SECURITY):
"In general it is necessary to clean the queue either
via a cronjob or by running a daemon, e.g.,
/PATH/TO/sendmail -L sm-msp-queue -Ac -q30m"
While Sendmail, in this particular case, is supposed to run with smmsp user
and group privileges, it fails to drop group privileges and the gid remains
set to 0. Again, the queue file processing algorithm is not bullet-proof.
This is acceptable, because ordinary users should be not able to modify
queue files. Unfortunately, due to the vulnerability described above, it
suddenly becomes a problem.
One of the potential problems in the qf parser: expired T tag in the queue
file, in conjunction with no valid Return-Path header, can cause a crash.
The failure occours when Sendmail tries to generate return envelope for
this mail and is not able to connect master SMTP daemon (which can be
DoSed or rendered unusable in other way). Because of heap corruption,
depending on run parameters and queue contents, this vulnerability can
cause a crash by following invalid pointer, freeing non-allocated memory,
etc, and, due to user-dependent queue contents, is likely to be
exploitable.
Note:
-----
We have noticed that there are other alarming symptoms related to recent
changes in Sendmail code. This condition shall not be considered a
vulnerability, but might lead to serious problems. The "harmless" practice of
giving a+x permissions to user queue (/var/spool/clientmqueue), which, at
first sight, does not cause a major security problem and might be a result
of overlooking (especially if Sendmail 8.12.x is shipped in packages),
actually allows mail system compromise. The attacker can read and/or modify
other users' mail by initiating bogus queue runs (sendmail -q -Ac -h1000 or
similar) and "taking over" the ownership of queue entries: new queue files
for existing mail that belong to other users will be owned by the attacker.
Additionally, attacker-owned queue files can be altered to cause privilege
elevation, as described above.
To prevent this condition, it should be at least documented; and at best,
Sendmail should refuse to run in an insecure environment or generate an
appropriate warning.
Vulnerability 2: Queue Manipulation and Destruction -- CAN-2001-0714
--------------------------------------------------------------------
All versions of Sendmail allow any user to process the whole mail queue,
unless this feature is administratively disabled. This feature itself is not
dangerous. Due to a programming bug, specific attacker-specified mail
delivery options will be honored. It is possible to, for example, force
Sendmail to drop queue contents by setting initial message hop count above
the limit:
sendmail -q -h1000
Specific queue entries can be targeted using parameters like -qR, -qS, etc.
This can be considered a DoS / data loss attack. Systems that do not allow
users to run the queue (RestrictQRun option) are not vulnerable to this.
RestrictQRun is not set by default.
Vulnerability 3: Debug Mode Leaks Information -- CAN-2001-0715
--------------------------------------------------------------
This is a fairly low-risk vulnerability related to user-driven queue
processing abilities. Debugging flags can be used to obtain the complete mail
system configuration, gather potentially interesting information about the
mail queue (full message path, subject, mail software, etc.) even if local
users (and the attacker) are not allowed to read the configuration or mail
queue directly. This can be achieved by issuing the following command:
sendmail -q -d0-nnnn.xxx
where nnnn and xxx specify debugging levels.
Systems that do not allow users to run the queue (RestrictQRun option)
are not vulnerable to this. RestrictQRun is not set by default.
Vendor Response and Fix Information:
------------------------------------
The vendor has been contacted, and released the following statement:
We would like to thank Michal Zalewski for bringing these problems
to our attention. We are sorry that these issues haven't been found
earlier despite extensive beta testing. In response to his advisory
we will release sendmail 8.12.1 that addresses the issues as follows:
- For operating systems where the system call setgid() does not
irrevocably give up privileges obtained via the set-group-ID binary,
three other options are available: setegid(), setregid(), and
setresgid(). Additionally sendmail checks whether the privileges
can be regained when they should have been dropped in which case
sendmail refuses to run.
- The PrivacyOptions RestrictQRun is set by default for mail submission
(submit.cf) to avoid privacy leaks or mail loss due to mailicous
local users.
- 8.12.1 prevents information leakage when sendmail has extra
privileges by disabling debugging (command line -d flag) during queue
runs and disabling ETRN when sendmail -bs is used.
- 8.12.1 limits mail submission command line flags (i.e., -G, -h,
-F, etc.) to mail submission operating modes (i.e., -bm, -bs, -bv,
etc.) when sendmail is running with extra privileges.
- Additonal test programs are distributed with sendmail that
can check whether the required functionality of system calls is
available. See test/README in 8.12.1 for further information.
- The potential memory corruption problems have been fixed.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: security
` security Victor Tsaran
@ ` Frank J. Carmickle
0 siblings, 0 replies; 7+ messages in thread
From: Frank J. Carmickle @ UTC (permalink / raw)
To: Victor Tsaran; +Cc: speakup
No I actually ment smbd2 not smbd. I know the os pretty well by this
point. I know how to make it pretty secure. It's just that someone
hacked in and setup a service called smbd2 thinking that they could pass
it off as smbd in the eyes of the sysadmin. They set it up to run on port
22 which happens to be ssh. Oh well they haven't been around after we
tightened up more of the box. As well as increased the loging of
activities.
Frank
On Sun, 5 Nov 2000, Victor Tsaran wrote:
> SMBD, do you mean SAMBA server daemon? This is another interesting point.
> People should shutdown services they don't use, for example, routed or
> gateway or NIS or SMBD. Because Linux is intended to be used on a multiuser
> networks, a lot of these services are installed by default are initiated by
> default. Learn your OS before you use it!
> Vic
>
> ******* ******* *******
> have you thought of visiting Cybertsar's Internet Kingdom? It is still
> alive!
> Here is the URL:
> http://go.to/vtsaran
> or
> http://kickme.to/vtsaran
>
> ******* ******* *******
> ----- Original Message -----
> From: "Frank J. Carmickle" <frankiec@braille.uwo.ca>
> To: "Kirk Wood" <cpt.kirk@1tree.net>
> Cc: <speakup@braille.uwo.ca>
> Sent: Monday, October 30, 2000 7:11 AM
> Subject: Re: security
>
>
> > This is very true. Shawn calls me up at 12:00 am saying that sshd is
> > running but he can't get any connections on port 22. Tcpdump on port 22
> > revealed some trafic. Searching through inetd revealed some crazy service
> > called smbd2 which spauned a shell as root. This all happened after the
> > machine misteriously rebooted.
> >
> > Fun!
> > FC
> >
> >
> > On Mon, 30 Oct 2000, Kirk Wood wrote:
> >
> > > You should look for any connections from IP addresses you don't
> > > recognize. While this would be harder for a production system, on a home
> > > system it shouldn't be too tough. I would pay particular attention to
> ftp
> > > connections (if you have the service available.
> > >
> > > As for everything you can look for, that fills books and employs
> > > profesionals all with their own opinion. And just so you know, if you
> have
> > > a full time connection and find one day you can't log into your own
> > > machine. Turn it off. I have a friend who thought somethign had just
> gone
> > > wrong and needed fixed. Turns out his system had been compromised. If in
> > > doubt shut down and remove it from the net.
> > >
> > > =======
> > > Kirk Wood
> > > Cpt.Kirk@1tree.net
> > >
> > >
> > >
> > > _______________________________________________
> > > Speakup mailing list
> > > Speakup@braille.uwo.ca
> > > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> > >
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: security
` security Frank J. Carmickle
@ ` Victor Tsaran
` security Frank J. Carmickle
0 siblings, 1 reply; 7+ messages in thread
From: Victor Tsaran @ UTC (permalink / raw)
To: speakup
SMBD, do you mean SAMBA server daemon? This is another interesting point.
People should shutdown services they don't use, for example, routed or
gateway or NIS or SMBD. Because Linux is intended to be used on a multiuser
networks, a lot of these services are installed by default are initiated by
default. Learn your OS before you use it!
Vic
******* ******* *******
have you thought of visiting Cybertsar's Internet Kingdom? It is still
alive!
Here is the URL:
http://go.to/vtsaran
or
http://kickme.to/vtsaran
******* ******* *******
----- Original Message -----
From: "Frank J. Carmickle" <frankiec@braille.uwo.ca>
To: "Kirk Wood" <cpt.kirk@1tree.net>
Cc: <speakup@braille.uwo.ca>
Sent: Monday, October 30, 2000 7:11 AM
Subject: Re: security
> This is very true. Shawn calls me up at 12:00 am saying that sshd is
> running but he can't get any connections on port 22. Tcpdump on port 22
> revealed some trafic. Searching through inetd revealed some crazy service
> called smbd2 which spauned a shell as root. This all happened after the
> machine misteriously rebooted.
>
> Fun!
> FC
>
>
> On Mon, 30 Oct 2000, Kirk Wood wrote:
>
> > You should look for any connections from IP addresses you don't
> > recognize. While this would be harder for a production system, on a home
> > system it shouldn't be too tough. I would pay particular attention to
ftp
> > connections (if you have the service available.
> >
> > As for everything you can look for, that fills books and employs
> > profesionals all with their own opinion. And just so you know, if you
have
> > a full time connection and find one day you can't log into your own
> > machine. Turn it off. I have a friend who thought somethign had just
gone
> > wrong and needed fixed. Turns out his system had been compromised. If in
> > doubt shut down and remove it from the net.
> >
> > =======
> > Kirk Wood
> > Cpt.Kirk@1tree.net
> >
> >
> >
> > _______________________________________________
> > Speakup mailing list
> > Speakup@braille.uwo.ca
> > http://speech.braille.uwo.ca/mailman/listinfo/speakup
> >
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: security
security Joseph Norton
` security Kirk Wood
@ ` Janina Sajka
1 sibling, 0 replies; 7+ messages in thread
From: Janina Sajka @ UTC (permalink / raw)
To: speakup; +Cc: SPEAKUP Distribution List
There are Perl scripts, called Bastille, that I have found helpful. They
walk one through the process of locking down various services. There are
good explanations on screen as you go about the reasons and trade-offs
involved. It took a bit of study for me to learn to run the scripts,
because Speakup wasn't tracking as nicely as I might have liked, but I did
get it figured out. Also, just the text in these scripts is an excellent
primer on security, imho.
Look for the scripts at http://www.bastille-linux.org.
On Sun, 29 Oct
2000, Joseph Norton wrote:
> All this talk about security brings up an interesting question. Are there
> things one can look for to tell his system is being hacked or that
> attempts are being made. I have looked in /var/log/messages and
> /var/log/syslog, but, I'm really not sure what to look for. I remember
> seeing the word "victim" somewhere in a cert advisory (I think), but, I
> assume if I see this word, my system has definitely been compromised.
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
--
Janina Sajka, Director
Technology Research and Development
Governmental Relations Group
American Foundation for the Blind (AFB)
janina@afb.net
(202) 408-8175
http://www.afb.org/gov.html
The invention of the printing press has been named the crowning achievment
of the past millenium. Yet, electronic publishing will soon eclipse it.
Read our White Paper: "Surpassing Gutenberg" available at:
http://www.afb.org/ebook.html
Are you developing software? Make it accessible to blind computer users.
Read http://www.afb.org/technology/accessapp.html to learn how.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: security
` security Kirk Wood
@ ` Frank J. Carmickle
` security Victor Tsaran
0 siblings, 1 reply; 7+ messages in thread
From: Frank J. Carmickle @ UTC (permalink / raw)
To: Kirk Wood; +Cc: speakup
This is very true. Shawn calls me up at 12:00 am saying that sshd is
running but he can't get any connections on port 22. Tcpdump on port 22
revealed some trafic. Searching through inetd revealed some crazy service
called smbd2 which spauned a shell as root. This all happened after the
machine misteriously rebooted.
Fun!
FC
On Mon, 30 Oct 2000, Kirk Wood wrote:
> You should look for any connections from IP addresses you don't
> recognize. While this would be harder for a production system, on a home
> system it shouldn't be too tough. I would pay particular attention to ftp
> connections (if you have the service available.
>
> As for everything you can look for, that fills books and employs
> profesionals all with their own opinion. And just so you know, if you have
> a full time connection and find one day you can't log into your own
> machine. Turn it off. I have a friend who thought somethign had just gone
> wrong and needed fixed. Turns out his system had been compromised. If in
> doubt shut down and remove it from the net.
>
> =======
> Kirk Wood
> Cpt.Kirk@1tree.net
>
>
>
> _______________________________________________
> Speakup mailing list
> Speakup@braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: security
security Joseph Norton
@ ` Kirk Wood
` security Frank J. Carmickle
` security Janina Sajka
1 sibling, 1 reply; 7+ messages in thread
From: Kirk Wood @ UTC (permalink / raw)
To: speakup
You should look for any connections from IP addresses you don't
recognize. While this would be harder for a production system, on a home
system it shouldn't be too tough. I would pay particular attention to ftp
connections (if you have the service available.
As for everything you can look for, that fills books and employs
profesionals all with their own opinion. And just so you know, if you have
a full time connection and find one day you can't log into your own
machine. Turn it off. I have a friend who thought somethign had just gone
wrong and needed fixed. Turns out his system had been compromised. If in
doubt shut down and remove it from the net.
=======
Kirk Wood
Cpt.Kirk@1tree.net
^ permalink raw reply [flat|nested] 7+ messages in thread
* security
@ Joseph Norton
` security Kirk Wood
` security Janina Sajka
0 siblings, 2 replies; 7+ messages in thread
From: Joseph Norton @ UTC (permalink / raw)
To: SPEAKUP Distribution List
All this talk about security brings up an interesting question. Are there
things one can look for to tell his system is being hacked or that
attempts are being made. I have looked in /var/log/messages and
/var/log/syslog, but, I'm really not sure what to look for. I remember
seeing the word "victim" somewhere in a cert advisory (I think), but, I
assume if I see this word, my system has definitely been compromised.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~ UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
security Tyler Spivey
-- strict thread matches above, loose matches on Subject: below --
security Joseph Norton
` security Kirk Wood
` security Frank J. Carmickle
` security Victor Tsaran
` security Frank J. Carmickle
` security Janina Sajka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).