all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 44018@debbugs.gnu.org
Subject: bug#44018: Don't consider play-sound-file to be a 'safe' function
Date: Fri, 16 Oct 2020 11:45:14 +0200	[thread overview]
Message-ID: <CAC099B0-C1B8-4716-956E-9AEE8F248DDA@acm.org> (raw)
In-Reply-To: <83r1pzwb2q.fsf@gnu.org>

15 okt. 2020 kl. 21.20 skrev Eli Zaretskii <eliz@gnu.org>:

> Any specifics, though?  Surely, if the risks are known, there should
> be some vulnerabilities recorded somewhere?  Is it possible to give a
> couple of examples, or refer to known vulnerabilities?

Sorry for being unclear. This is not about known vulnerabilities (which we hope are not present!) but about reducing risks -- ie, exposure to unknown present and future security holes.

Security thinking takes some getting used to; risks have to be motivated by clear needs. In this case, the needs for calls to play-sound-file with arbitrary input data seem very small but the risks aren't commensurate.

> I'm not sure I understand: what's unsafe in playing sound?

A fair question! Safe parsing and handling of binary file formats can be surprisingly difficult, especially in an unsafe language; the slightest mistake can be exploited by an intelligent adversary. It could be a buffer overrun, an unsufficiently checked parameter, signedness confusion, nonsensical combination of values, unexpected alignment, legal but untested values, text encoding traps in string fields (oh yes)... I have written many sound and image file parsers over the years, most of which would be completely unsuitable in a hostile environment.

And new attack vectors keep turning up. Inaudible sound streams carrying covert instructions to always-on voice-activated assistants? Maybe all they can do is to turn off the lights or order you more rolls of toilet paper but don't count on it.

Most weaknesses are likely to have been fuzzed and patched out of existence by now but it does not change the fact that playing arbitrary audio is an activity that will always carry more inherent risk than, say, calling ding or split-string, also in the same list of safe functions.

But, someone objects, I play arbitrary sound files in my web browser all the time! Yes, and that is not free of risk either -- but that web browser is likely to have undergone more care and hardening of these code paths than Emacs: more careful selection of libraries and APIs used, fewer obscure or obscure file formats supported, and even measures taken to contain breaches, such as sandboxing.

Finally, Emacs must be completely trusted as a tool for inspecting arbitrary files, even ones prepared with malicious intent.

> Do you understand why 'message' was removed?

I can only guess, but that function could be used to display deceptive messages that mislead the user to take actions against his or her own interest. Removing it looks like a wise decision.






  reply	other threads:[~2020-10-16  9:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 16:55 bug#44018: Don't consider play-sound-file to be a 'safe' function Mattias Engdegård
2020-10-15 17:14 ` Lars Ingebrigtsen
2020-10-15 17:26 ` Eli Zaretskii
2020-10-15 19:01   ` Mattias Engdegård
2020-10-15 19:20     ` Eli Zaretskii
2020-10-16  9:45       ` Mattias Engdegård [this message]
2020-10-26 11:51         ` Mattias Engdegård
2020-10-26 15:29           ` Eli Zaretskii
2020-10-26 16:19             ` Mattias Engdegård
2020-10-26 17:09               ` Eli Zaretskii
2020-10-26 18:25                 ` Lars Ingebrigtsen
2020-10-26 16:32           ` Stefan Kangas
2020-10-26 16:51             ` Mattias Engdegård
2020-10-16  5:39   ` Lars Ingebrigtsen
2020-10-16  6:23     ` Eli Zaretskii
2020-10-26 17:05       ` Basil L. Contovounesios
2020-10-26 17:16         ` Eli Zaretskii
2020-10-26 17:38           ` Mattias Engdegård
2020-10-26 18:28             ` Eli Zaretskii
2020-10-26 20:36               ` Mattias Engdegård
2020-10-31  8:06                 ` Eli Zaretskii
2020-10-31 13:33                   ` Mattias Engdegård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAC099B0-C1B8-4716-956E-9AEE8F248DDA@acm.org \
    --to=mattiase@acm.org \
    --cc=44018@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.