---
id: "CVE-2021-3156"
kind: "vulnerability"
aliases: ["CVE-2021-3156"]
title: "Sudo Sudo: Sudo Heap-Based Buffer Overflow Vulnerability"
severity: "high"
cvss: 7.8
epss: 0.99962
exploited: true
status: "open"
category: "infrastructure"
products: [{"name": "Sudo Sudo", "fixed": [], "affected": "", "ecosystem": "vendor"}]
ecosystems: ["vendor"]
tags: ["exploited", "infrastructure", "linux", "self-hosted", "servers", "sudo"]
not_affected_if: ["unknown"]
published_at: "2021-01-26T21:15:12+00:00"
first_seen_at: "2026-10-23T19:11:52+00:00"
updated_at: "2026-10-23T21:57:35+00:00"
sources: [{"source": "kev", "url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2021-3156", "first_seen_at": "2026-10-23T19:11:52+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2021-3156", "first_seen_at": "2026-10-23T19:13:44+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-3156", "first_seen_at": "2026-10-23T21:57:35+00:00"}]
---

# Sudo Sudo: Sudo Heap-Based Buffer Overflow Vulnerability

Sudo has a heap-based buffer overflow caused by an off-by-one error, known as Baron Samedit. A local user without sudo rights can gain root privileges on the affected machine.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- vendor:Sudo Sudo affected ? fixed ?

## How to check

Run 'sudo -V' and compare the version with the fixed releases; on Linux, check the package manager for the sudo package version.

## Fix

Update sudo to a fixed release per the vendor instructions (CISA KEV required action: apply updates per vendor instructions).

## Timeline

- 2026-10-23T19:11:52+00:00 kev https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2021-3156
- 2026-10-23T19:13:44+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2021-3156
- 2026-10-23T21:57:35+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2021-3156

## From the sources

Sudo before 1.9.5p2 contains an off-by-one error that can result in a heap-based buffer overflow, which allows privilege escalation to root via "sudoedit -s" and a command-line argument that ends with a single backslash character.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
