Bug 18363 - mercurial new code execution security issue (CVE-2016-3105)
Summary: mercurial new code execution security issue (CVE-2016-3105)
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 5
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL: http://lwn.net/Vulnerabilities/686084/
Whiteboard: has_procedure MGA5-64-OK advisory
Keywords: validated_update
Depends on:
Blocks:
 
Reported: 2016-05-05 06:56 CEST by Nic Baxter
Modified: 2016-05-12 22:00 CEST (History)
4 users (show)

See Also:
Source RPM: mercurial
CVE: CVE-2016-3105
Status comment:


Attachments

Description Nic Baxter 2016-05-05 06:56:08 CEST
This update fixes possible arbitrary code execution when converting Git repos. Mercurial prior to 3.8 allowed arbitrary code execution when using the convert extension on Git repos with hostile names. This could affect automated code conversion services that allow arbitrary repository names. This is a further side-effect of Git CVE-2015-7545. Reported and fixed by Blake Burkhart.

This has been fixed in mercurial-3.8.1-1 i586/x86_64 Cauldron but not in mga5 which has mercurial-3.1.1-5.1 in updates
Nic Baxter 2016-05-05 06:57:48 CEST

URL: (none) => https://access.redhat.com/security/cve/CVE-2016-3105
CVE: (none) => CVE-2016-3105

Comment 1 Marja Van Waes 2016-05-05 09:56:03 CEST
(In reply to Nic Baxter from comment #0)
> This update fixes possible arbitrary code execution when converting Git
> repos. Mercurial prior to 3.8 allowed arbitrary code execution when using
> the convert extension on Git repos with hostile names. This could affect
> automated code conversion services that allow arbitrary repository names.
> This is a further side-effect of Git CVE-2015-7545. Reported and fixed by
> Blake Burkhart.
> 
> This has been fixed in mercurial-3.8.1-1 i586/x86_64 Cauldron but not in
> mga5 which has mercurial-3.1.1-5.1 in updates

Assigning to Mercurial maintainer

CC: (none) => marja11
Assignee: bugsquad => makowski.mageia
Summary: mercurial: code execution => mercurial: code execution (CVE-2016-3105)

Comment 2 Philippe Makowski 2016-05-05 13:26:47 CEST
I put here the link to Debian page about this CVE :
https://security-tracker.debian.org/tracker/CVE-2016-3105
Comment 3 Philippe Makowski 2016-05-05 13:43:57 CEST
And the patch in Mercurial upstream repo https://selenic.com/hg/rev/a56296f55a5e
Comment 4 Nic Baxter 2016-05-05 13:47:00 CEST
My real question here is should the patched version be pushed mga5?
Comment 5 Philippe Makowski 2016-05-05 16:20:27 CEST
Updated packages uploaded for Mageia 5

Advisory:
========================

Updated mercurial packages fix security vulnerabilities:

This update fixes possible arbitrary code execution when converting Git repos. Mercurial prior to 3.8 allowed arbitrary code execution when using the convert extension on Git repos with hostile names. This could affect automated code conversion services that allow arbitrary repository names. This is a further side-effect of Git CVE-2015-7545. Reported and fixed by Blake Burkhart. 


References:
- https://access.redhat.com/security/cve/CVE-2016-3105
- http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-3105
- https://selenic.com/hg/rev/a56296f55a5e


Updated packages in core/updates_testing:
========================
mercurial-3.1.1-5.2.mga5.x86_64
mercurial-3.1.1-5.2.mga5.i586

from mercurial-3.1.1-5.2.mga5.src.rpm

Assignee: makowski.mageia => qa-bugs

David Walser 2016-05-05 16:58:45 CEST

URL: https://access.redhat.com/security/cve/CVE-2016-3105 => http://lwn.net/Vulnerabilities/686084/
Summary: mercurial: code execution (CVE-2016-3105) => mercurial new code execution security issue (CVE-2016-3105)

claire robinson 2016-05-12 11:51:57 CEST

Source RPM: (none) => mercurial

Comment 6 claire robinson 2016-05-12 11:53:36 CEST
Procedure: https://bugs.mageia.org/show_bug.cgi?id=15590#c4

Whiteboard: (none) => has_procedure

Comment 7 Len Lawrence 2016-05-12 12:42:51 CEST
x86_64

Shall test this with Olivier's procedure.

CC: (none) => tarazed25

Comment 8 Len Lawrence 2016-05-12 16:45:16 CEST
Created a local repository and then cloned it on another node on the LAN.  Added a file and ran commit after editing the config file to name a user.

Checked out a few of the commands in the help list.

Updated to mercurial-3.1.1-5.2.mga5.  Removed the old repositories and worked through the testing procedure again and did the same on another machine.  On the other machine
cloned the my-hello branch from the main test machine.

$ hg version
Mercurial Distributed SCM (version 3.1.1)
$ hg clone ssh://lcl@belexeuli/tmp/repo/my-hello my-hello
<password>
requesting all changes
adding changesets
.......

$ hg clone my-hello my-hello-share
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd my-hello-share
$ hg -q tip
1:82e55d328c8c
$ cd my-hello-new-output
$ edit hello.c
[1] 18727
$ hg st
M hello.c
$ hg diff
diff -r 82e55d328c8c hello.c
--- a/hello.c	Fri Aug 26 01:21:28 2005 -0700
+++ b/hello.c	Thu May 12 15:16:26 2016 +0100
@@ -12,5 +12,6 @@
 int main(int argc, char **argv)
 {
 	printf("hello, world!\n");
+	printf( "This one is easy but time consuming\n" );
 	return 0;
 }
$ hg revert hello.c
[lcl@belexeuli my-hello-new-output]$ hg st
? hello.c.orig
$ mv hello.c.orig hello.c
$ hg st
M hello.c
// 'check in' editor
$ hg ci
Having a grumble 
HG: Enter commit message.  Lines beginning with 'HG:' are removed.
HG: Leave message empty to abort commit.
HG: 
HG: user: Len Lawrence <tarazed25@gmail.com>
HG: branch 'default'
HG: changed hello.c
$ hg par
changeset:   2:df085f900c01
tag:         tip
user:        Len Lawrence <tarazed25@gmail.com>
date:        Thu May 12 15:28:40 2016 +0100
summary:     Having a grumble
$ cd ../my-hello-share
$ hg pull ../my-hello-new-output
pulling from ../my-hello-new-output
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)
$ hg up
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg pull ../my-hello-new-output
pulling from ../my-hello-new-output
searching for changes
no changes found
$ hg push ../my-hello-new-output
pushing to ../my-hello-new-output
searching for changes
no changes found
// Now export the changeset
$ hg export tip
# HG changeset patch
# User Len Lawrence <tarazed25@gmail.com>
# Date 1463063320 -3600
#      Thu May 12 15:28:40 2016 +0100
# Node ID df085f900c01d643d6cf205507869d6bcec6dcf2
# Parent  82e55d328c8ca4ee16520036c0aaace03a5beb65
Having a grumble

diff -r 82e55d328c8c -r df085f900c01 hello.c
--- a/hello.c	Fri Aug 26 01:21:28 2005 -0700
+++ b/hello.c	Thu May 12 15:28:40 2016 +0100
@@ -12,5 +12,6 @@
 int main(int argc, char **argv)
 {
 	printf("hello, world!\n");
+	printf( "This one is easy but time consuming\n" );
 	return 0;
 }

I reckon this is enough for validation.  Everything works as expected.
Len Lawrence 2016-05-12 16:45:33 CEST

Whiteboard: has_procedure => has_procedure MGA5-64-OK

Comment 9 Len Lawrence 2016-05-12 17:08:40 CEST
If it is important to test this for i586 I can load it into my vbox and clone a repository from a 64-bit machine on the LAN.  It will have to wait though.
Comment 10 claire robinson 2016-05-12 17:29:12 CEST
We'll validate most things with one arch tested Len, to keep updates moving. Ones which we need to be more cautious with are hardware related or anything low level and intrinsic to the system eg. rpm.
Len Lawrence 2016-05-12 21:32:22 CEST

Keywords: (none) => validated_update
CC: (none) => sysadmin-bugs

Dave Hodgins 2016-05-12 21:50:01 CEST

CC: (none) => davidwhodgins
Whiteboard: has_procedure MGA5-64-OK => has_procedure MGA5-64-OK advisory

Comment 11 Mageia Robot 2016-05-12 22:00:54 CEST
An update for this issue has been pushed to the Mageia Updates repository.

http://advisories.mageia.org/MGASA-2016-0172.html

Status: NEW => RESOLVED
Resolution: (none) => FIXED


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