Sudo Potential Privilege Escalation


Description

Affecting sudo (<= 1.9.5p2), there's a privilege escalation vulnerability. By executing sudo using the sudoedit -s or sudoedit -i command with a command-line argument that ends with a single backslash character, an unprivileged user can potentially escalate privileges to root. This rule is highly specific and might be bypassed due to potential issues with string matching on command line arguments.

Query · falco

spawned_process and user.loginuid != 0 and (proc.name=sudoedit or proc.name = sudo) and (proc.args contains -s or proc.args contains -i or proc.args contains --login) and (proc.args contains "\ " or proc.args endswith \)

Rule dependencies

Depends on

  • composes · Falco macro spawned_process
    A shared condition, not a detection — not indexed on this site.

Analyst notes

Detect Sudo Privilege Escalation Exploit (CVE-2021-3156) | evt_type=%evt.type user=%user.name user_uid=%user.uid user_loginuid=%user.loginuid process=%proc.name proc_exepath=%proc.exepath parent=%proc.pname command=%proc.cmdline terminal=%proc.tty exe_flags=%evt.arg.flags

Raw source Sudo Potential Privilege Escalation · Falco YAML
Esc
Published by falcosecurity/rules ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
rule: Sudo Potential Privilege Escalation
desc: 'Affecting sudo (<= 1.9.5p2), there''s a privilege escalation vulnerability.
  By executing sudo using the sudoedit -s or sudoedit -i command with a command-line
  argument that ends with a single backslash character, an unprivileged user can potentially
  escalate privileges to root. This rule is highly specific and might be bypassed
  due to potential issues with string matching on command line arguments.

  '
condition: 'spawned_process and user.loginuid != 0 and (proc.name=sudoedit or proc.name
  = sudo) and (proc.args contains -s or proc.args contains -i or proc.args contains
  --login) and (proc.args contains "\ " or proc.args endswith \)

  '
output: Detect Sudo Privilege Escalation Exploit (CVE-2021-3156) | evt_type=%evt.type
  user=%user.name user_uid=%user.uid user_loginuid=%user.loginuid process=%proc.name
  proc_exepath=%proc.exepath parent=%proc.pname command=%proc.cmdline terminal=%proc.tty
  exe_flags=%evt.arg.flags
priority: CRITICAL
tags:
- maturity_sandbox
- host
- container
- filesystem
- users
- mitre_privilege_escalation
- T1548.003

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.