You've checked sudo -l GTFOBins
Think of sudo CVEs like finding a flaw in the lock mechanism itself, rather than finding an unlocked door. Even if you have no sudo privileges at all, a vulnerable sudo binary can give you root. Always check sudo --version.
Check Version First
Baron Samedit (CVE-2021-3156)
The most devastating sudo vulnerability ever. Baron Samedit is a heap-based buffer overflow that gives instant root on almost any sudo version from 2011-2021. No sudo privileges required - just the ability to run sudo (which almost everyone has).
Baron Samedit Technical Details
Distro-Specific Exploits
CVE-2019-14287 (sudo -u#-1)
This is a logic bug, not a memory corruption. When sudoers allows running commands as "ALL users except root", a negative user ID bypasses the restriction. Elegant and simple.
When CVE-2019-14287 Applies
Logic Bug = Reliable
CVE-2019-18634 (pwfeedback)
A stack-based buffer overflow triggered when sudo is configured with pwfeedback (shows asterisks when typing password). Less common but another avenue when conditions are right.
CVE-2023-22809 (sudoedit Bypass)
A more recent sudoedit vulnerability. Allows editing arbitrary files when you have sudoedit access to specific files. Environment variable injection.
Requires Existing sudoedit
Older Sudo CVEs
Sudo Version Quick Reference
Sudo CVE Exploitation Flow
Sudo CVE Methodology
Sudo CVE Exploitation Flow
Knowledge Check
Challenges
Key Takeaways
- Always check sudo --version early in enumeration
- Baron Samedit (CVE-2021-3156): sudo 1.8.2-1.9.5p1, no sudo privileges needed
- CVE-2019-14287: sudo < 1.8.28 + (ALL, !root) = sudo -u#-1 bypass
- Test Baron Samedit with: sudoedit -s '\'
- Different distros may need different exploit variants
- Sudo CVEs can give root even with no sudo permissions at all