A malicious app can (AFAICT) repeatedly crash Pulseaudio when a Bluetooth headset is connected

With the following set of commands, a confined app can cause Pulseaudio to crash, given that a Bluetooth headset is connected:

pactl list cards # Make note of Bluetooth card name.
pactl set card-profile bluez_card.<address> headset_head_unit
pactl set-sink-volume sink.fake.sco 69

An app can repeatedly do this, preventing audio and voice call to work properly.

This issue affects 20.04 OTA-5, and possibly Ubuntu 16.04 if module-bluez5-discover is configured in the same way (which, since Pulseaudio doesn't prevent re-configuration, a malicious app can do that and also cause the crash).

Reported to Ubuntu as https://bugs.launchpad.net/bugs/2078822 (please notify me if you need access).

Edited by Ratchanan Srirattanamet