Slashdot Mirror


Buffer Overflow in Sendmail

ChiefArcher writes "On the footsteps of openssh, Sendmail 8.12.10 has just been released due to a buffer overflow in address parsing. Sendmail states this is potentially remotely exploitable. No updates on the Sendmail site yet, but the FTP site has the release notes."

16 of 478 comments (clear)

  1. Use qmail by DigitalNinja7 · · Score: 5, Informative

    That's why you should be using qmail, ya' code monkeys! Seems like this happens every couple months.

    --
    Show your love for the Hacker community
    HackerLogo.com
    1. Re:Use qmail by Dysan2k · · Score: 4, Informative

      Bah! And I'll say it again, Bah!

      Use Postfix! Ok, use either really, just stop using Sendmail. I run Qmail at work (due to legacy and converting Qmail's Maildir to Cyrus' Maildir just seems neigh impossible) and Postfix at home. Postfix is really straight-foward on setup and has TONS of documentation in the conf files.

      Qmail, on the other hand has tons of docs on the site and lists a number of different ways to perform various tasks.

      It's really a crap-shoot as to which you prefer. Just STOP USING SENDMAIL!

      --
      -What have you contributed lately?
    2. Re:Use qmail by bongoras · · Score: 5, Informative

      PLEASE PLEASE PLEASE read the fucking article...

      from the release notes:

      "Fix a potential buffer overflow in ruleset parsing. This problem
      is not exploitable in the default sendmail configuration;
      only if non-standard rulesets recipient (2), final (4), or
      mailer-specific envelope recipients rulesets are used then
      a problem may occur. "

      http://www.sendmail.org/8.12.10.html

      While I agree it's necessary to patch systems, this is hardly like the Blaster worm. I'm going to go way out on a limb here and say that 99.99% of all sendmail installations in the world don't use these rulesets. And anyone who IS using them is likely to be a sendmail weenie anyhow and they'll just take a break from writing their AI Chess program in sendmail.cf and patch it themselves.

    3. Re:Use qmail by ChaosDiscord · · Score: 3, Informative
      That's why you should be using qmail, ya' code monkeys!

      Great idea! I'll just download a package from my favorite distribution that's tuned qmail to mesh nicely with how my system is configured.

      Hmm, they don't supply packages for qmail. Why not? They're not allowed to. If I take the time to make up such a package, I'm not allowed to give it to my friend.

      Quoth Bernstein:

      But that's a decision for the Apache maintainers, not the UNIX integrators!

      Darn those pesky integrators, attempting to make their system internally consistent and trying to please their users!

      I've heard great things about qmail, it's great that is available with source for no cost. But it's proprietary software, putting me at the mercy of Bernstein. If you want someone else to maintain a fork with features you desire, you're out of luck. It's fine if you're willing to accept that, but it's not acceptable to everyone. Fortunately there are other options available.

  2. It's on the site now by Phaid · · Score: 4, Informative

    The official announcement is here.

    I've already downloaded and installed it. Thank goodness for Slackbuild scripts :)

  3. Lazy Story Submitter by Peridriga · · Score: 3, Informative
    Just point to the ftp site?
    Aight... I'll fill in the blanks

    ftp://ftp.sendmail.org/pub/sendmail/RELEASE_NOTE S

    8.12.10/8.12.10 2003/09/24
    SECURITY: Fix a buffer overflow in address parsing. Problem
    detected by Michal Zalewski, patch from Todd C. Miller
    of Courtesan Consulting.
    Fix a potential buffer overflow in ruleset parsing. This problem
    is not exploitable in the default sendmail configuration;
    only if non-standard rulesets recipient (2), final (4), or
    mailer-specific envelope recipients rulesets are used then
    a problem may occur. Problem noted by Timo Sirainen.
    Accept 0 (and 0/0) as valid input for set MaxMimeHeaderLength.
    Problem noted by Thomas Schulz.
    Add several checks to avoid (theoretical) buffer over/underflows.
    Properly count message size when performing 7->8 or 8->7 bit MIME
    conversions. Problem noted by Werner Wiethege.
    Properly compute message priority based on size of entire message,
    not just header. Problem noted by Axel Holscher.
    Reset SevenBitInput to its configured value between SMTP
    transactions for broken clients which do not properly
    announce 8 bit data. Problem noted by Stefan Roehrich.
    Set {addr_type} during queue runs when processing recipients.
    Based on patch from Arne Jansen.
    Better error handling in case of (very unlikely) queue-id conflicts.
    Perform better error recovery for address parsing, e.g., when
    encountering a comment that is too long. Problem noted by
    Tanel Kokk, Union Bank of Estonia.
    Add ':' to the allowed character list for bogus HELO/EHLO
    checking. It is used for IPv6 domain literals. Patch from
    Iwaizako Takahiro of FreeBit Co., Ltd.
    Reset SASL connection context after a failed authentication attempt.
    Based on patch from Rob Siemborski of CMU.
    Check Berkeley DB compile time version against run time version
    to make sure they match.
    Do not attempt AAAA (IPv6) DNS lookups if IPv6 is not enabled
    in the kernel.
    When a milter adds recipients and one of them causes an error,
    do not ignore the other recipients. Problem noted by
    Bart Duchesne.
    CONFIG: Use specified SMTP error code in mailertable entries which
    lack a DSN, i.e., "error:### Text". Problem noted by
    Craig Hunt.
    CONFIG: Call Local_trust_auth with the correct argument. Patch
    from Jerome Borsboom.
    CONTRIB: Better handling of temporary filenames for doublebounce.pl
    and expn.pl to avoid file overwrites, etc. Patches from
    Richard A. Nelson of Debian and Paul Szabo.
    MAIL.LOCAL: Fix obscure race condition that could lead to an
    improper mailbox truncation if close() fails after the
    mailbox is fsync()'ed and a new message is delivered
    after the close() and before the truncate().
    MAIL.LOCAL: If mail delivery fails, do not leave behind a
    stale lockfile (which is ignored after the lock timeout).
    Patch from Oleg Bulyzhin of Cronyx Plus LLC.
    Portability:
    Port for AIX 5.2. Thanks to Steve Hubert of University
    of Washington for providing access to a computer
    with AIX 5.2.
    setreuid(2) works on OpenBSD 3.3. Patch from
    Todd C. Miller of Courtesan Consulting.
    Allow for custom definition of SMRSH_CMDDIR and SMRSH_PATH
    on all operating systems. Patch from Robert Harker
    of Harker Systems.
    Use strerror(3) on Linux. If this causes a problem on
    your Linux distribution, compile with
    -DHASSTRERROR=0 and tell sendmail.org about it.
    Added Files:
    devtools/OS/AIX.5.2

  4. Re:OpenSSH as well by (startx) · · Score: 3, Informative

    and it's allready been updated in slackware as well. Go Pat!

  5. Re:"Email Different" by blchrist · · Score: 3, Informative

    not all that secure http://www.securitytracker.com/alerts/2003/May/100 6728.html http://www.wired.com/news/business/0,1367,21490,00 .html

  6. Re:How does an overflow work? by Second_Derivative · · Score: 4, Informative

    Stack grows downward, buffers on stack grow upward. Overflow a buffer and sooner or later you run into a return pointer on the buffer. Now, if you overflow it in such a way that the function corresponding to that stackgrame doesn't cause a segfault before it returns, the CPU will read in a return address you supplied, which could point to the buffer. CPU then executes the code you put in the buffer. I believe it's traditional to execve /bin/sh at this point.

    Google for "Smashing the stack for fun and profit". I don't know too much of the specifics -- I'm not a script kiddie.

  7. Re:How does an overflow work? by Waffle+Iron · · Score: 4, Informative
    During C procedure calls, the return addresses are placed on the stack in predictable locations. Often, people use fixed-size buffers allocated on the stack in their procedures. For example:

    void foo() {
    char buf[100];
    gets(buf);
    --- do stuff ---
    }

    By feeding in a string longer than 100 characters, you go up the stack and can overwrite the return address to the call to 'foo'. You might replace the address with a pointer to code you've embedded in the oversized string. When the call returns, it jumps into your code rather than the calling procedure.

  8. Why sendmail anyway? by ArchAngelQ · · Score: 3, Informative

    Sendmail has remote exploits every couple of months at best. Why is anyone suprised any more? It's not as if it's easy to set up, administrate or is horribly high performance. It's about as middle of the road as you get. As many have pointed out before I'm sure, this is exactly why we complain about software from microsoft (and I mean just the software, not it's licences nor the biz tactics associated with it).

    So why not look for alternatives, all you sysadmins out here? I for one prefer qmail. There are plenty of others.

    I know it's hard to switch to a new system when you've gotten profficent in configuring something well, especially when you are so busy using it that you don't have time to play with something new to see if can work for your setup. But I can't see that running a frequently exploited mail server will cause anything but more work.

  9. This is getting silly by jd · · Score: 5, Informative
    Sendmail badly needs a severe audit. Maybe Stanford can run their validating compiler over it, or something. Either way, you shouldn't be seeing such basic, fundamental flaws in software that has been around for a long time.


    Especially software that is semi-commercial. They're getting paid to check for these issues, after all.


    Ok, credit given where credit is due. The problem has been recognised within a short time of being detected. That's better than Hotmail's "check the password? what for?" bug, that persisted for six or seven months, and remained in effect for several days after the media ran the story.


    But that's where the credit ends. It shows that the program isn't being routinely tested and verified with overflow detectors, or (if it is), that the testing procedure is inadequate.


    It shows why rival MTAs (eg: Postfix) are gaining popularity, when Sendmail could have kept absolute control of the market, merely by being the best.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  10. Re:Sendmail's future by Nevyn · · Score: 4, Informative
    I'm not sure that "insecure by design" is quite fair to the hard-working folks who developed this near-ubiquitous MTA.

    So are you saying it is designed with security in mind?

    A fairer assessment is that, when sendmail was designed, security was not as big an issue as it has become today.

    So you saying (agreeing) it is designed without security in mind.

    It's been years since the internet operated where everyone allowed relaying to help everyone else out. And go look at the code, they still use NIL terminated char *'s all over the place. Mostly with limited length APIs like strlcpy(), but even a few strcpy()s.

    Now go look at postfix or qmail, but have fully dynamic string APIs and use them everywhere. And supprise supprise neither has had a buffer overflow.

    --
    ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
  11. Re:Before the Microsoft defenders say it... by TheNetAvenger · · Score: 4, Informative

    But there is another kind of security problem for which Microsoft is deservedly bashed. The problem Microsoft is bashed for having poor security is when their system is insecure in its design. (It may not have been a design goal.)

    Although you have good motives in this post, you have no idea what you are talking about in regard to Microsoft's OS architectural security and its history.

    Sure Win9x and Win3.x and DOS are INHERENTLY insecure, as they were designed with a closed system architecture in mind and an evolution of a closed system OS. Just like Mac System software has almost no inherent underlying security. (i.e. they were not designed for security or rigid network security since many of the networking concepts that are common today were not available or widely used when they were originally designed in the 80s. As most home users concepts of networks were CompuServe and BBSes.)

    However, the NT architecture and security model that it was designed upon had security as a main priority from its original designs. In fact the Object Oriented/Token based security model that is in the NT base (and the original NT 3.1) are not only conceptually more advanced than the *nix security model, but they also have been successfully implemented to be one of the most secure OS designs in history.

    The designers of the NT security model took 'conceptual' ideas of the 'ideal' methodologies for a robust and strong underlying security structure and designed these into the OS from day one.

    This is why people like Dave Cutler and other 'respected' Unix and OS engineers at the time that were hired by Microsoft ABANDONED the *nix security models to build an OS using the new theories of OS security and implement them in the NT kernel architecture.

    As for backing my claims, I suggest an original text like "Inside Windows NT" - The original 1993 release and the recent updated releases that cover the newer NT code bases - Windows 2000, XP, and 2003.

    The OS designers at Microsoft had full control to make NT based upon *nix concepts and technologies if that was what they thought was the most advanced conceptual OS engineering; however, they rejected taking the *nix route and instead went for OS architectural concepts that were on the forefront of technological theory and hadn't even been implemented in a real OS to the extent they were in NT.

    As you can see from many of my posts here, I am not a hard core Microsoft or NT zealot, but when I see people just dismiss technologies because they take the popular misconceptions I feel the need to respond.

    Even if you hate NT and Microsoft, I truly do hope you will explore what TRULY is in NT in terms of security and its security model for your own knowledge.

    Especially considering any information you or someone else reading this post gain from it might be compelled to use some of the Microsoft NT concepts in other OS coding and designs to create richer OS environments for everyone, whether it be MacOSX, Linux, or BeOS.

    Even if you take odds and dismiss the intellectuals that designed NT, there is always the chance the Microsoft team did do something innovative or right that can also benefit future OS architectural models.

    Take Care,
    TheNetAvenger

  12. qmail install HOWTO and RPMs by getnuked · · Score: 3, Informative

    Here is a HOWTO and a tarball containing all of the files necessary to replace sendmail with qmail on an RPM based system.

  13. There are *TWO* bugs by V.+Mole · · Score: 4, Informative

    Actuall, more than two: the changelog includes several fixes. Right above the fix you quote, there's one that *is* exploitable, which is why they've gone ahead and released it:

    8.12.10/8.12.10 2003/09/24
    SECURITY: Fix a buffer overflow in address parsing. Problem
    detected by Michal Zalewski, patch from Todd C. Miller
    of Courtesan Consulting.

    The fact it's separate bugs is clear from the indention in the original (Fscking /. doesn't support PRE)