nday
CVE-2021-3156

Sudo Heap-Based Buffer Overflow Vulnerability

Sudo / Sudo

Added to KEV 435 days after disclosure. nday has no fix record for it yet; that does not mean no patch exists. Listed by 2 of 4 PoC sources: exploitdb and metasploit.

why these tags

nday derives these tags by fixed rules from the facts below; NVD, the CNA and other sources do not assign them. Vocabulary and rules: ~/tags.

local
AV:L in CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (CVSS 3.1) from the ADP CISA-ADP
no user interaction
UI:N in CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (CVSS 3.1) from the ADP CISA-ADP
Metasploit
Metasploit modules exploit/linux/local/sudo_baron_samedit
Exploit-DB
Exploit-DB entries 49521, 49522
Synology DSM
CPE names NVD's analysts give as vulnerable: o:synology:diskstation_manager, a:synology:diskstation_manager_unified_controller
NAS / storage
CPE names NVD's analysts give as vulnerable: o:synology:diskstation_manager, a:synology:diskstation_manager_unified_controllerthe product type of Synology DSM in nday's product registry
endpoint security / antivirus
CPE names NVD's analysts give as vulnerable: a:mcafee:web_gatewaynday's type rule vendor:mcafee-trellix
stage
KEV
disclosed
disclosure → KEV
T+435d KEV is date-only
cvss
7.8 HIGH v3.1
KEV due date
2022-04-27

Lifecycle

x axis UTC; dot = exact minute, wide bar = date only, hollow = unknown or inferred.
time unknown
DISdisclosed
2021-01-26T00:00Z
PATpatch
no record yet
ANAanalysis
no record yet
POCPoC
2021-02-03, date only +1 more
metasploit
ITWexploited
≤ 2022-04-06, inferred from KEV
KEVKEV
2022-04-06, date only

Summary

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.

Original text of the CVE record (cvelist), shown as published.

Exploit conditions

What an attack needs, read from the CVSS vector.
Attack vector AV:L
Local: needs a local or SSH session, or a user tricked into acting on the machine
Attack complexity AC:L
Low: no special conditions; the attacker can expect repeatable success
Privileges required PR:L
Low: ordinary user privileges
User interaction UI:N
None: no action by anyone other than the attacker

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

CVSS 3.1 vector from the CVE record, added by the ADP CISA-ADP.

Event log

+DISdisclosed

CVE record published by mitre. CVSS 7.8, high. CISA's SSVC assessment rates exploitation as active.

src cvelist · nday , bulk import · raw
{
  "id": 18844,
  "type": "disclosed",
  "source": "cvelist",
  "url": "https://www.cve.org/CVERecord?id=CVE-2021-3156",
  "occurred_at": "2021-01-26T00:00:00Z",
  "observed_at": "2026-11-12T15:02:49.796473Z",
  "is_backfill": true,
  "dedupe_key": "",
  "detail": {
    "kev": {
      "reference": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-3156",
      "date_added": "2022-04-06"
    },
    "cvss": {
      "source": "adp:CISA-ADP",
      "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "version": "3.1",
      "base_score": 7.8,
      "base_severity": "HIGH"
    },
    "ssvc": {
      "timestamp": "2025-02-03T15:43:52.658146Z",
      "automatable": "no",
      "exploitation": "active",
      "technical_impact": "total"
    },
    "state": "PUBLISHED",
    "date_published": "2021-01-26T00:00:00.000Z",
    "assigner_short_name": "mitre"
  }
}
2021-02-03date only, from source
+POCpublic PoC

Exploit-DB lists public exploit code “Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (1)” (EDB-49521).

src exploitdb 49521 · nday , bulk import · raw
{
  "id": 26676,
  "type": "poc_published",
  "source": "exploitdb",
  "url": "https://www.exploit-db.com/exploits/49521",
  "occurred_at": "2021-02-03T00:00:00Z",
  "observed_at": "2026-11-12T15:24:40.221206Z",
  "is_backfill": true,
  "dedupe_key": "49521",
  "detail": {
    "url": "https://www.exploit-db.com/exploits/49521",
    "file": "exploits/multiple/local/49521.py",
    "kind": "exploit",
    "tags": [],
    "type": "local",
    "title": "Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (1)",
    "author": "West Shepherd",
    "edb_id": 49521,
    "cve_ids": [
      "CVE-2021-3156"
    ],
    "platform": "multiple",
    "verified": false,
    "precision": "day",
    "confidence": "curated",
    "date_added": "2021-02-03",
    "date_updated": "2021-02-03",
    "date_published": "2021-02-03"
  }
}
2021-02-03date only, from source
+POCpublic PoC

Exploit-DB lists public exploit code “Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (2)” (EDB-49522).

src exploitdb 49522 · nday , bulk import · raw
{
  "id": 26677,
  "type": "poc_published",
  "source": "exploitdb",
  "url": "https://www.exploit-db.com/exploits/49522",
  "occurred_at": "2021-02-03T00:00:00Z",
  "observed_at": "2026-11-12T15:24:40.221206Z",
  "is_backfill": true,
  "dedupe_key": "49522",
  "detail": {
    "url": "https://www.exploit-db.com/exploits/49522",
    "file": "exploits/multiple/local/49522.c",
    "kind": "exploit",
    "tags": [],
    "type": "local",
    "title": "Sudo 1.9.5p1 - 'Baron Samedit ' Heap-Based Buffer Overflow Privilege Escalation (2)",
    "author": "nu11secur1ty",
    "edb_id": 49522,
    "cve_ids": [
      "CVE-2021-3156"
    ],
    "platform": "multiple",
    "verified": false,
    "precision": "day",
    "confidence": "curated",
    "date_added": "2021-02-03",
    "date_updated": "2021-02-03",
    "date_published": "2021-02-03"
  }
}
2022-04-06date only, from source
+KEVadded to KEV

CISA added it to the Known Exploited Vulnerabilities catalog, with a remediation deadline of 2022-04-27. Ransomware use: unknown.

src kev · nday , bulk import · raw
{
  "id": 1164,
  "type": "kev_added",
  "source": "kev",
  "url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog",
  "occurred_at": "2022-04-06T00:00:00Z",
  "observed_at": "2026-11-12T13:53:00.018191Z",
  "is_backfill": true,
  "dedupe_key": "",
  "detail": {
    "cwes": [
      "CWE-122",
      "CWE-193"
    ],
    "notes": "https://nvd.nist.gov/vuln/detail/CVE-2021-3156",
    "product": "Sudo",
    "due_date": "2022-04-27",
    "precision": "day",
    "date_added": "2022-04-06",
    "vendor_project": "Sudo",
    "forensic_triage": "No",
    "required_action": "Apply updates per vendor instructions.",
    "vulnerability_name": "Sudo Heap-Based Buffer Overflow Vulnerability",
    "known_ransomware_campaign_use": "Unknown"
  }
}
≤ 2022-04-06inferred, no direct source
~ITWexploited in the wild

No source says when exploitation began. A KEV listing means it was already happening, so only an upper bound is known. CISA's SSVC assessment rates exploitation as active.

based on kev and CISA's assessment in cvelist

time unknownsource gave no time
+POCpublic PoC

Metasploit has module exploit/linux/local/sudo_baron_samedit (Sudo Heap-Based Buffer Overflow). The source gives no release time for the module.

src metasploit exploit/linux/local/sudo_baron_samedit · nday , bulk import · raw
{
  "id": 50903,
  "type": "poc_published",
  "source": "metasploit",
  "url": "https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/local/sudo_baron_samedit.rb",
  "occurred_at": null,
  "observed_at": "2026-11-12T15:24:51.477477Z",
  "is_backfill": true,
  "dedupe_key": "exploit/linux/local/sudo_baron_samedit",
  "detail": {
    "url": "https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/local/sudo_baron_samedit.rb",
    "kind": "msf_module",
    "path": "/modules/exploits/linux/local/sudo_baron_samedit.rb",
    "rank": 600,
    "check": true,
    "title": "Sudo Heap-Based Buffer Overflow",
    "cve_ids": [
      "CVE-2021-3156"
    ],
    "fullname": "exploit/linux/local/sudo_baron_samedit",
    "rank_name": "excellent",
    "confidence": "curated",
    "module_type": "exploit",
    "module_last_modified": "2023-02-08 15:20:32 +0000",
    "vuln_disclosure_date": "2021-01-26"
  }
}

Report an error

report an error or omission

Something on this page wrong or missing? Tell the editors; if they accept it, this page's revision log says so publicly. Upstream data is not changed.

Researcher discussion

0 researchers mentioned this in the last 7 days

Posts on X by researchers on nday's list that mention this CVE, shown as posted. nday does not check them.

nday has not collected any post on X by listed researchers that mentions this CVE.

Discussion

0 comments

No comments yet.