CVE Vulnerabilities

CVE-2019-3902

Improper Link Resolution Before File Access ('Link Following')

Published: Apr 22, 2019 | Modified: Jul 31, 2020
CVSS 3.x
5.9
MEDIUM
Source:
NVD
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
CVSS 2.x
5.8 MEDIUM
AV:N/AC:M/Au:N/C:N/I:P/A:P
RedHat/V2
RedHat/V3
5.1 MODERATE
CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
Ubuntu
MEDIUM

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

Weakness

The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.

Affected Software

Name Vendor Start Version End Version
Mercurial Mercurial * 4.9 (excluding)
Mercurial Ubuntu bionic *
Mercurial Ubuntu cosmic *
Mercurial Ubuntu disco *
Mercurial Ubuntu esm-apps/xenial *
Mercurial Ubuntu trusty *
Mercurial Ubuntu trusty/esm *
Mercurial Ubuntu upstream *
Mercurial Ubuntu xenial *

Potential Mitigations

  • Follow the principle of least privilege when assigning access rights to entities in a software system.
  • Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.

References