Skip to main content
ExploitedIn CISA KEVFix available

CVE-2021-3156

Exploitation confirmed. First attested on 2022-04-06 by CISA-ADP, CISA KEV, GCVE · kevintel.

  • Published2021-01-26
  • WeaknessCWE-193

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

Description

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.

Timeline

dates in UTC
  1. 2021-01-2621:15CVE publishedNVD
  2. 2021-02-03Exploit-DB entryExploit-DB
  3. 2022-04-06Added to the CISA KEV catalogCISA KEV
  4. 2022-04-06Listed as exploited by GCVEGCVE
  5. 2022-04-06Exploitation first reportedCISA KEV
  6. 2025-02-0315:43SSVC exploitation set to activeCISA-ADP

Observed activity

isMalicious corpus · updated 2026-11-04 03:37 UTC
Indicators tagged with this CVE, per day0 indicators over 7 days
Block these indicators
  • Firewall list (EDL, text): https://api.ismalicious.com/edl/cve/CVE-2021-3156?format=txt
  • CSV export: https://api.ismalicious.com/edl/cve/CVE-2021-3156?format=csv
  • TAXII collection of exploited CVEs
  • The EDL and CSV take an API key on the Pro plan.

Versions per branch

NVD
Mcafee web gateway
BranchAffectedFixed in
8.2= 8.2.17no fix published
9.2= 9.2.8no fix published
10.0= 10.0.4no fix published
Sudo project sudo
BranchAffectedFixed in
1.9≥ 1.9.0, < 1.9.51.9.5
1.8≥ 1.8.2, < 1.8.321.8.32
1.9= 1.9.5no fix published
Debian debian linux
BranchAffectedFixed in
9.0= 9.0no fix published
10.0= 10.0no fix published

21 more products in the sources.

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • redhat-virtualization-hostRed Hat:rhev_hypervisor:4.4::el8all versions · fixed in 0:4.4.4-20210201.0.el8_3and 1 other package
  • redhat-virtualization-hostRed Hat:enterprise_linux:7::hypervisorall versions · fixed in 0:4.3.13-20210127.0.el7_9and 1 other package
  • sudoUbuntu:Pro:14.04:LTSall versions · fixed in 1.8.9p5-1ubuntu1.5+esm6
  • sudoUbuntu:20.04:LTSall versions · fixed in 1.8.31-1ubuntu1.2
  • sudoUbuntu:18.04:LTSall versions · fixed in 1.8.21p2-3ubuntu1.4
  • sudoUbuntu:16.04:LTSall versions · fixed in 1.8.16-0ubuntu1.10
  • sudoTuxCare:RHEL:7all versions · fixed in 1.8.23-10.el7_9.3.tuxcare.els2and 1 other package
  • sudoTuxCare:OracleLinux:6all versions · fixed in 1.8.6p3-30.el6.cloudlinux.els6and 1 other package

114 more package ranges on OSV.dev

Vendor advisories

  • CVE-2021-3156 Red Hat Product Security211 products fixed

    sudo: Heap buffer overflow in argument parsing

  • ICSA-22-256-01 CISA3 known affected

    Hitachi Energy TXpert Hub CoreTec 4 Sudo Vulnerability

    TXpert Hub CoreTec 4: version 2.0.0 2.0.1 · TXpert Hub CoreTec 4: version 2.1.0 2.1.1 2.1.2 2.1.3 · TXpert Hub CoreTec 4: version 2.2.0 2.2.1

  • ICSA-21-334-04 CISA1 known affected

    Johnson Controls CEM Systems AC2000

    CEM Systems AC2000: All versions prior to Version 10.6

  • ICSA-21-245-01 CISA4 known affected

    Johnson Controls Sensormatic Electronics Illustra

    Insight: All versions prior to 1.4.0 · Pro 2: All versions · Flex Gen 2: All versions prior to 1.9.4 · +1 more

  • ICSA-21-147-02 CISA1 known affected

    Johnson Controls Sensormatic Electronics VideoEdge

    VideoEdge: versions prior to 5.7.0

  • ICSA-21-133-02 CISA1 known affected

    Johnson Controls Sensormatic Tyco AI

    Tyco AI: All versions up to and including v1.2

13 more advisories

Full record on NVD

Fix

  1. CISA’s required action: Apply updates per vendor instructions.due 2022-04-27
  2. Vendor fix CISA ICSA-22-256-01 · 3 productsTXpert Hub CoreTec 4: version 2.3.0
  3. Vendor fix CISA ICSA-22-256-01 · 3 productsAdditionally, Hitachi Energy recommends following product Security Deployment Guidelines. Recommended practices for the affected product can be found in the TXpert Hub CoreTec 4 Software Manual.
  4. Vendor fix CISA ICSA-21-245-01 · 4 productsPro Gen 3: upgrade to Version 2.8.0
  5. Vendor fix CISA ICSA-21-147-02 · 1 productJohnson Controls recommends users upgrade to the latest VideoEdge release (currently 5.7.0). If this is not possible, a sudo patch is available from the American Dynamics website for VideoEdge 5.4.2 and 5.6.0. VideoEdge 5.4.1 and older cannot be patched and should be upgraded.
  6. Vendor fix CISA ICSA-21-133-02 · 1 productJohnson Controls recommends users update to Tyco AI v1.3, which includes the updates for the SUSE Linux operating system. Users are encouraged to contact Tyco technical support for assistance.
  7. Vendor fix Red Hat Product Security RHSA-2021:0401 · 2 productsFor details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/2974891 After installing this update, the smb service will be restarted automatically.

Detection

read 2026-11-03 22:42 UTC
Nuclei template
none so far
ProjectDiscovery
Exploit-DB
EDB-49521EDB-49522
Exploit-DB
Metasploit modules
1 moduleexploit/linux/local/sudo_baron_sameditrank: excellentModule metadata: Metasploit Framework, © Rapid7, Inc., BSD-3-Clause.
Metasploit Framework

CISA Known Exploited Vulnerability

Date Added
2022-04-06
Patch Due Date
2022-04-27
Ransomware Use
Unknown
Required Action
Apply updates per vendor instructions.

Sources

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Published
2021-01-26
Last Modified
2026-06-17
NVD status
Analyzed
GitHub Advisory
GHSA-w5vh-2923-gp5c

Frequently asked questions

What is CVE-2021-3156?

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.

Is CVE-2021-3156 actively exploited?

Yes. CVE-2021-3156 is on the CISA Known Exploited Vulnerabilities (KEV) catalog, meaning it has been confirmed as actively exploited in the wild. CISA requires federal agencies to patch by 2022-04-27.

What is the CVSS score for CVE-2021-3156?

CVE-2021-3156 has a CVSS v3 base score of 7.8 (HIGH severity), with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.

Running sudo? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record