Bug 1553265 (CVE-2018-1000132) - CVE-2018-1000132 mercurial: HTTP server permissions bypass
Summary: CVE-2018-1000132 mercurial: HTTP server permissions bypass
Alias: CVE-2018-1000132
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1553267 1564351 1564352 1564353
Blocks: 1553270
TreeView+ depends on / blocked
Reported: 2018-03-08 15:27 UTC by Pedro Sampaio
Modified: 2019-09-29 14:35 UTC (History)
6 users (show)

Fixed In Version: mercurial 4.5.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-08-06 19:18:28 UTC

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:2276 0 None None None 2019-08-06 12:34:42 UTC

Description Pedro Sampaio 2018-03-08 15:27:47 UTC
Quote from release notes:

All versions of Mercurial prior to 4.5.2 have vulnerabilities in the HTTP server that allow permissions bypass to:

    Perform writes on repositories that should be read-only
    Perform reads on repositories that shouldn't allow read access 

The nature of the vulnerabilities is:

    Wire protocol commands that didn't explicitly declare their permissions had no permissions checking done. The web.{allow-pull, allow-push, deny_read, etc} config options governing access control were never consulted when running these commands. This allowed permissions bypass for impacted commands.

    The batch wire protocol command did not list its permission requirements nor did it enforce permissions on individual sub-commands. 

The implication of these vulnerabilities is that no permissions checking was performed on commands and this could lead to accessing data that web.* config options were supposed to prevent access to or modifying data (via wire protocol commands that can mutate data) without authorization. A Mercurial HTTP server in its default configuration is supposed to be read-only. However, a well-crafted batch command could invoke commands that perform writes.

Upstream patch:




Comment 1 Pedro Sampaio 2018-03-08 15:28:43 UTC
Created mercurial tracking bugs for this issue:

Affects: fedora-all [bug 1553267]

Comment 3 Huzaifa S. Sidhpurwala 2018-04-06 03:36:16 UTC
As per upstream, there are two attack vectors here (which have been assigned one CVE):

1. Wire protocol commands: The write protocol performs all mercurial network access via either http or ssh. These did not declare any permissions and did not check permissions before their execution. This flaw has existed in mercurial since version 1.0. All versions of mercurial shipped in Red Hat Enterprise Linux are affected by this particular flaw.

2. "batch wire protocol commands": The batch write permissions bypass has been present since Mercurial 1.9. A well-crafted batch command could invoke commands that performs unauthorized writes. Only Red Hat Enterprise Linux 7 is affected by this flaw.

Comment 5 errata-xmlrpc 2019-08-06 12:34:40 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2019:2276 https://access.redhat.com/errata/RHSA-2019:2276

Comment 6 Product Security DevOps Team 2019-08-06 19:18:28 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):


Note You need to log in before you can comment on or make changes to this bug.