The following advisory from firstname.lastname@example.org is for mpg123 0.59r, but the given exploit causes media-sound/mpg123-0.59s-r6 to SegFault, so it probably still vulnerable.
Date: 15 Dec 2004 08:14:59 -0000
From: "D. J. Bernstein" <email@example.com>
Subject: [remote] [control] mpg123 0.59r find_next_file overflows linetmp buffer
To: firstname.lastname@example.org, email@example.com
X-HELOcheck: OK: FQDN
Mailing-List: contact firstname.lastname@example.org; run by ezmlm
Automatic-Legal-Notices: See http://cr.yp.to/mailcopyright.html.
[-- Attachment #1 [details] --]
[-- Type: text/plain, Encoding: 7bit, Size: 1.6K --]
Bartlomiej Sieka, a student in my Fall 2004 UNIX Security Holes course,
has discovered a remotely exploitable security hole in mpg123. I'm
publishing this notice, but all the discovery credits should be assigned
You are at risk if you use mpg123 --list to take an MP3 playlist from a
web page (or any other source that could be controlled by an attacker).
Whoever provides that input then has complete control over your account:
he can read and modify your files, watch the programs you're running,
Of course, when you accept a playlist from someone else, you are running
the risk that the playlist will include some of your files, conceivably
secret audio files. But the mpg123 documentation does not suggest that
there is any larger risk.
Proof of concept: On an x86 computer running FreeBSD 4.10, as root, type
to download and compile the mpg123 program, version 0.59r (current ports
version; note that pre0.59s does not appear to have fixed the bug).
Then, as any user, save the file 8.list attached to this message, and
mv 8.list 1234567890123456789/8.list
mpg123 -s --list 1234567890123456789/8.list >/dev/null
with the unauthorized result that a file named EXPLOIT is created in the
current directory. (I tested this with a 4621-byte environment, as
reported by printenv | wc -c.)
Here's the bug: In playlist.c, find_next_file() uses strcat() to copy
any amount of data into a 1024-byte linetmp array.
---D. J. Bernstein, Associate Professor, Department of Mathematics,
Statistics, and Computer Science, University of Illinois at Chicago
Created attachment 46169 [details]
8.list from advisory
sound heard, pls verify/advise
setting to upstream as no patch seems to be available yet
CAN-2004-0982 also needs fixing... and upstream is dead.... ugg... I'll get on this
CAN-2004-0982 was fixed... nevermind...
fixed in cvs... adding archs
I'm getting a SEGV on ppc and x86 when running the test described
/usr/bin/mpg123 -s --list ~/bug74692-9.list >/dev/null
that's expected... mpg123 is crap in general, so the easiest way around this was to just segfault on entries >1023 characters rather than overflow.
Stable on alpha.
stable on ppc64
GLSA 200412-22 (thx SeJo for the draft)
mips should mark stable to benefit from GLSA
Stable on mips.