Exploit database

Vulnerability

CVE-2022-43781

Vulnerability details

Score
9.8
Severity
critical

CVSS 3.1 · CISA-ADP

Vector string

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Description

There is a command injection vulnerability using environment variables in Bitbucket Server and Data Center. An attacker with permission to control their username can exploit this issue to execute arbitrary code on the system. This vulnerability can be unauthenticated if the Bitbucket Server and Data Center instance has enabled “Allow public signup”.

CVE Program

Exploit source choices

1 source
Bitbucket Environment Variable RCE
MSF-multi--http--bitbucket_env_var_rceMetasploitLinux,Unix,Windows / remotePreferred

For various versions of Bitbucket, there is an authenticated command injection vulnerability that can be exploited by injecting environment variables into a user name. This module achieves remote code execution as the `atlbitbucket` user by injecting the `GIT_EXTERNAL_DIFF` environment variable, a null character as a delimiter, and arbitrary code into a user's user name. The value (payload) of the `GIT_EXTERNAL_DIFF` environment variable will be run once the Bitbucket application is coerced into generating a diff. This module requires at least admin credentials, as admins and above only have the option to change their user name.

2022-11-16bitbucket_env_var_rce.rb