pacman before 5.2 is vulnerable to arbitrary command injection in conf.c in the download_with_xfercommand() function. This can be exploited when unsigned databases are used. To exploit the vulnerability, the user must enable a non-default XferCommand and retrieve an attacker-controlled crafted database and package.
https://github.com/alpinelinux/alpine-secdb/blob/master/v3.11/community.yaml
https://git.archlinux.org/pacman.git/tree/src/pacman/conf.c?h=v5.1.3#n263
https://git.archlinux.org/pacman.git/commit/?id=808a4f15ce82d2ed7eeb06de73d0f313620558ee