CVE-2019-3902 Mercurial Path Traversal/Link Following vulnerability

Medium 5.1 Published Updated

Attackers can use symlinks and subrepositories to bypass path checks and write files outside the repository directory.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2019-3902?

CVE-2019-3902 is a medium-severity path traversal vulnerability in Debian Debian Linux, published on 22 Apr 2019. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

A flaw was found in Mercurial before 4.9. It was possible to use symlinks and subrepositories to defeat Mercurial's path-checking logic and write files outside a repository.

Weakness: CWE-59, CWE-22

Which versions are affected by CVE-2019-3902?

3 open source packages ship an affected version, including mercurial. It affects 3 products.

PackageAffectedFixed in
mercurial PyPIAll versions4.9
mercurial PyPIAll versions4.9
mercurial PyPIAll versions4.9
Linux distribution packages (5)
mercurial SUSE:Linux Enterprise Module for Python 2 15 SP1All versions4.5.2-3.9.44
mercurial SUSE:Linux Enterprise Module for Python 2 15 SP2All versions4.5.2-3.9.44
mercurial SUSE:Linux Enterprise Software Development Kit 12 SP5All versions2.8.2-15.18.4
mercurial openSUSE:Leap 15.1All versions4.5.2-lp151.6.3.1
mercurial openSUSE:Leap 15.2All versions4.5.2-lp152.7.3.1

Products include Debian Debian Linux, Mercurial Mercurial, Redhat Enterprise Linux.

How do I fix CVE-2019-3902?

Upgrade mercurial to 4.9 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2019-3902 being exploited?

There is no known exploitation of CVE-2019-3902 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as ALPINE-CVE-2019-3902, DEBIAN-CVE-2019-3902, DLA-1764-1, GHSA-mq66-vcfc-8246, MGASA-2019-0250, PYSEC-2019-188 and 6 more.

Is CVE-2019-3902 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free