Versions mentioned in the description apply to the upstream
Remediation section below for
Debian:9 relevant versions.
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and consequently execute arbitrary code, by using --debugger as a repository name.
mercurial to version 4.0-1+deb9u1 or higher.