Record summary

CVE-2019-18276 has a selected CVSS score of 7.8 (high); EIP currently links 2 repository PoCs and 2 lab environments.

Description

An issue was discovered in disable_priv_mode in shell.c in GNU Bash through 5.0 patch 11. By default, if Bash is run with its effective UID not equal to its real UID, it will drop privileges by setting its effective UID to its real UID. However, it does so incorrectly. On Linux and other systems that support "saved UID" functionality, the saved UID is not dropped. An attacker with command execution in the shell can use "enable -f" for runtime loading of a new builtin, which can be a shared object that calls setuid() and therefore regains privileges. However, binaries running with an effective UID of 0 are unaffected.

Description source: CVE List

Exploitation context

Available material

Repository PoCs
2
Lab environments
2

CISA SSVC decision

ExploitationPoC
AutomatableNo
Technical impactTotal

CISA Coordinator · SSVC 2.0.3 · Evaluated Jun 9, 2025 · Source: CVE List

Proofs of concept

2

Repository PoCs

GitHubM-ensimag/CVE-2019-18276Repository PoCby M-ensimagStars: 3Not analyzed6 files

3.5 KiB

GitHub

PoC details
GitHubSABI-Ensimag/CVE-2019-18276Repository PoCby SABI-EnsimagStars: 0Not analyzed5 files

2.2 MiB

GitHub

PoC details

Docker lab environments

2
GitHub

gotham

SABI-Ensimag/CVE-2019-18276Created
Vuln labCVE-2019-18276Dockerfile

1 Dockerfile

Analysisdeepseek-v4-pro:cloud ·

Environment assessment

A single Dockerfile builds a Debian 10 container with two users, batman (victim) and joker (attacker). It installs gcc, sets /bin/bash as SUID owned by batman, and copies an exploit script for joker. The README states it is a study and proof-of-concept for CVE-2019-18276.

gotham/Dockerfile:1-57README.txt:1-7

Lab assessment

Vulnerability lab

The README explicitly states the directory contains a Dockerfile and exploit script for studying and demonstrating CVE-2019-18276. The Dockerfile creates a vulnerable SUID bash setup and provides an attacker user with a compiled exploit script.

README.txt:1-7gotham/Dockerfile:1-57
Lab shapeDockerfile
ServicesUnknown
Compose manifests0
Dockerfiles1
Evidence & reasoningComponents · CVE assessment · exercise context · review boundaries
Components

Services and files described by the evidence

Dockerfile

environment buildervulnerability setup

Builds a Debian 10 image, installs gcc, creates user batman with SUID /bin/bash, creates user joker, and copies exploit.sh to joker's home directory. It also creates a secret file for batman.

gotham/Dockerfile:1-57

exploit.sh

exploit scriptprivilege escalation

A bash script that prompts for batman's UID, generates a C shared library with a constructor that calls setuid() to that UID, compiles it, and instructs the user to load it via 'enable -f' in bash to drop privileges.

gotham/exploit.sh:1-52

batman user

victim userSUID owner

A non-privileged user who owns /bin/bash with SUID bit set, and has a secret file. The exploit targets this user's privileges.

gotham/Dockerfile:10-22

joker user

attacker user

A non-privileged user who starts the container session and has access to the exploit script.

gotham/Dockerfile:25-57
CVE assessment

How the supplied evidence relates each vulnerability

CVE-2019-18276

Supported by supplied evidence

The exploit.sh script header explicitly references CVE-2019-18276 and describes a Bash 5.0 SUID privilege drop exploit. The Dockerfile sets up a SUID bash owned by a non-root user, which matches the known vulnerability in Bash's handling of effective vs. real UID when loading functions.

gotham/exploit.sh:1-8gotham/Dockerfile:20-22
Exercise context

Requirements and sequence described by the evidence

Prerequisites

  • Docker must be installed to build and run the container.README.txt:3-5
  • The container must be built from the Dockerfile.gotham/Dockerfile:1-57
  • The attacker must know batman's UID to provide it to the exploit script.gotham/exploit.sh:18-20

Evidence-described exercise path

  1. Build the Docker image from the provided Dockerfile.gotham/Dockerfile:1-57
  2. Run a container from the image, which starts a shell as user joker.gotham/Dockerfile:55-57
  3. Execute the exploit script /home/joker/exploit.sh.gotham/exploit.sh:1-52
  4. When prompted, enter batman's UID (obtained via 'id -u batman' earlier in the script).gotham/exploit.sh:18-20
  5. The script compiles a shared library and instructs to run 'enable -f ./libpwn.so asd' in bash to trigger the privilege drop.gotham/exploit.sh:48-52
Safety-review evidence

Behaviors behind the stored safety assessment

No harmful behavior observed

All visible behavior is confined to the container's intended vulnerability lab: building a vulnerable SUID bash, creating test users, and running an exploit script that only manipulates privileges within the container. No host escape, external connections, persistence, credential theft, or destructive actions are observed.

gotham/Dockerfile:1-57gotham/exploit.sh:1-52
Review boundaries

What the analysis did not establish

  • The Makefile in gotham/ is not included in evidence_files, so its contents are unknown.
  • The referenced demo video (demo_CVE_2019_18276.mp4) is not included.
  • The exploit.sh script uses user-provided UID in a C code template without sanitization, but this is part of the intended lab exercise.
Model interpretation

This review is limited to the supplied lab evidence packet. It does not assert that the environment runs, reproduces a vulnerability, or is safe to execute. Contract: eip-docker-lab-analysis-v1.

GitHub

demonstration

M-ensimag/CVE-2019-18276Created
Vuln labCVE-2019-18276Dockerfile

1 Dockerfile

Analysisdeepseek-v4-pro:cloud ·

Environment assessment

A single Docker container based on Debian 10 that creates two users ('victime' and 'hacker'), sets up a SUID bash owned by 'victime', and provides scripts to demonstrate privilege escalation via CVE-2019-18276 (bash enable -f).

demonstration/Dockerfile:1-19demonstration/init_utilisateurs.sh:1-51demonstration/exploit.sh:1-62

Lab assessment

Vulnerability lab

The environment explicitly references CVE-2019-18276, creates a vulnerable SUID bash configuration, and includes an exploit script that compiles and loads a shared object to escalate privileges, consistent with a vulnerability reproduction lab.

demonstration/exploit.sh:20-22README:1
Lab shapeDockerfile
ServicesUnknown
Compose manifests0
Dockerfiles1
Evidence & reasoningComponents · CVE assessment · exercise context · review boundaries
Components

Services and files described by the evidence

Dockerfile

container image definition

Defines a Debian 10 image, installs gcc and openssh-server, copies three scripts, and sets the default command to init_utilisateurs.sh.

demonstration/Dockerfile:1-19

init_utilisateurs.sh

user and environment setup

Creates users 'victime' and 'hacker' with known passwords, sets /bin/bash as SUID owned by victime, moves creation_secret.sh to victime's home and exploit.sh to hacker's home, then switches to user victime.

demonstration/init_utilisateurs.sh:1-51

creation_secret.sh

secret file creation

Creates a secret file readable only by 'victime' in /home/victime, then switches to user 'hacker'.

demonstration/creation_secret.sh:1-15

exploit.sh

exploit demonstration

Prompts for the effective UID of 'victime', generates a C shared library that calls setuid() to that UID, compiles it, and instructs the user to load it via 'enable -f' to read the secret file.

demonstration/exploit.sh:1-62

make.sh

build and run helper

Builds the Docker image tagged 'demonstration' and runs it interactively with --rm.

demonstration/make.sh:1-4
CVE assessment

How the supplied evidence relates each vulnerability

CVE-2019-18276

Supported by supplied evidence

The exploit script explicitly references CVE-2019-18276 and demonstrates loading a shared object via bash's 'enable -f' to escalate privileges, which matches the known vulnerability in bash's handling of the enable builtin.

demonstration/exploit.sh:20-22demonstration/exploit.sh:55-58
Exercise context

Requirements and sequence described by the evidence

Prerequisites

  • Docker must be installed to build and run the container.demonstration/make.sh:3-4
  • The user must interactively provide the effective UID of 'victime' (1000) when prompted by exploit.sh.demonstration/exploit.sh:25-27README:10

Evidence-described exercise path

  1. Build the Docker image: docker build . -t demonstrationdemonstration/make.sh:3
  2. Run the container interactively: docker run -t -i --rm demonstrationdemonstration/make.sh:4
  3. Inside the container, execute ./creation_secret.sh and enter password 'hacker' when prompted.README:7-9
  4. Execute ./exploit.sh, enter the effective UID 1000, then run 'enable -f ./libpwn.so asd' to load the exploit library.README:10-12
  5. Verify privilege escalation by reading the secret file: cat /home/victime/.secret.txtREADME:13
Safety-review evidence

Behaviors behind the stored safety assessment

No harmful behavior observed

All visible behavior is confined to the container and directly supports the CVE-2019-18276 demonstration. The container runs with --rm, no host mounts or privileged mode are specified, and no network connections or persistence outside the container are indicated.

demonstration/make.sh:4demonstration/Dockerfile:1-19
Review boundaries

What the analysis did not establish

  • The Dockerfile installs openssh-server but no SSH configuration or exposure is shown; its purpose in the lab is unclear.
  • The exploit script uses user-supplied input to generate C code without validation, which could be risky if misused, but is part of the intended exercise.
Model interpretation

This review is limited to the supplied lab evidence packet. It does not assert that the environment runs, reproduces a vulnerability, or is safe to execute. Contract: eip-docker-lab-analysis-v1.

References

9