Every CVE Search/ Get API key

CVE-2021-31870

An issue was discovered in klibc before 2.0.9. Multiplication in the calloc() function may result...

9.8 CriticalFix available

An issue was discovered in klibc before 2.0.9. Multiplication in the calloc() function may result in an integer overflow and a subsequent heap buffer overflow.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

2.08%Up 1.2 points since Apr 30, 2021
90%50%10%1%

What each source reports

NVD Score used 9.8

An issue was discovered in klibc before 2.0.9. Multiplication in the calloc() function may result in an integer overflow and a subsequent heap buffer overflow.

Record
CVE-2021-31870
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS 2.0
7.5 HighAV:N/AC:L/Au:N/C:P/I:P/A:P
Weakness
CWE-190
Updated
2026-11-02
CVE List No score

An issue was discovered in klibc before 2.0.9. Multiplication in the calloc() function may result in an integer overflow and a subsequent heap buffer overflow.

Record
CVE-2021-31870
Updated
2026-11-02
EUVDEUVD-2021-18745 No score

An issue was discovered in klibc before 2.0.9. Multiplication in the calloc() function may result in an integer overflow and a subsequent heap buffer overflow.

Record
EUVD-2021-18745
Updated
2026-11-03
GitHub AdvisoriesGHSA-q5g5-fc84-93h4 9.8

An issue was discovered in klibc before 2.0.9. Multiplication in the calloc() function may result...

An issue was discovered in klibc before 2.0.9. Multiplication in the calloc() function may result in an integer overflow and a subsequent heap buffer overflow.

Record
GHSA-q5g5-fc84-93h4
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-190
Updated
2026-11-02
OSVALPINE-CVE-2021-31870 9.8

An issue was discovered in klibc before 2.0.9. Multiplication in the calloc() function may result in an integer overflow and a subsequent heap buffer overflow.

Record
ALPINE-CVE-2021-31870
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-03
OSV 9.8

An issue was discovered in klibc before 2.0.9. Multiplication in the calloc() function may result in an integer overflow and a subsequent heap buffer overflow.

Record
CVE-2021-31870
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVDEBIAN-CVE-2021-31870 9.8

An issue was discovered in klibc before 2.0.9. Multiplication in the calloc() function may result in an integer overflow and a subsequent heap buffer overflow.

Record
DEBIAN-CVE-2021-31870
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2021-31870 9.8

An issue was discovered in klibc before 2.0.9. Multiplication in the calloc() function may result in an integer overflow and a subsequent heap buffer overflow.

Record
UBUNTU-CVE-2021-31870
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUSN-5379-1 No score

klibc vulnerabilities

It was discovered that klibc did not properly perform some mathematical operations, leading to an integer overflow. An attacker could possibly use this issue to cause a crash, resulting in a denial of service, or possibly execute arbitrary code. (CVE-2021-31870)

It was discovered that klibc did not properly handled some memory allocations on 64 bit systems. An attacker could possibly use this issue to cause a crash, resulting in a denial of service, or possibly execute arbitrary code. (CVE-2021-31871)

It was discovered that klibc did not properly handled some file sizes values on 32 bit systems. An attacker could possibly use this issue to cause a crash, resulting in a denial of service, or possibly execute arbitrary code. (CVE-2021-31872)

It was discovered that klibc did not properly handled some memory allocations. An attacker could possibly use this issue to cause a crash, resulting in a denial of service, or possibly execute arbitrary code. (CVE-2021-31873)

Record
USN-5379-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
klibc
Alpine:v3.19
before 2.0.9-r0
2.0.9-r0
klibc
Alpine:v3.20
before 2.0.9-r0
2.0.9-r0
klibc
Alpine:v3.21
before 2.0.9-r0
2.0.9-r0
klibc
Alpine:v3.22
before 2.0.9-r0
2.0.9-r0
klibc
Alpine:v3.23
before 2.0.9-r0
2.0.9-r0
klibc
Alpine:v3.24
before 2.0.9-r0
2.0.9-r0
klibc
Debian:12
before 2.0.8-6
2.0.8-6
klibc
Debian:13
before 2.0.8-6
2.0.8-6
klibc
Debian:14
before 2.0.8-6
2.0.8-6
klibc
Debian:9
From an advisory covering 4 CVEs
before 2.0.4-9+deb9u1, plus listed versions
2.0.4-9
2.0.4-9+deb9u1
Show 8 moreShow less
Affected packages
PackageAffectedFixed
klibc
Ubuntu:Pro:14.04:LTS
before 2.0.3-0ubuntu1.14.04.3+esm2, plus listed versions
2.0.1-3.1ubuntu22.0.2-1ubuntu12.0.2-1ubuntu22.0.3-0ubuntu12.0.3-0ubuntu1.14.04.12.0.3-0ubuntu1.14.04.22.0.3-0ubuntu1.14.04.3
2.0.3-0ubuntu1.14.04.3+esm2
klibc
Ubuntu:Pro:16.04:LTS
before 2.0.4-8ubuntu1.16.04.4+esm1, plus listed versions
2.0.3-0ubuntu12.0.4-42.0.4-62.0.4-72.0.4-8
Show 5 moreShow less
2.0.4-8ubuntu12.0.4-8ubuntu1.16.04.12.0.4-8ubuntu1.16.04.22.0.4-8ubuntu1.16.04.32.0.4-8ubuntu1.16.04.4
2.0.4-8ubuntu1.16.04.4+esm1
klibc
Ubuntu:18.04:LTS
before 2.0.4-9ubuntu2.1, plus listed versions
2.0.4-9ubuntu12.0.4-9ubuntu2
2.0.4-9ubuntu2.1
klibc
Ubuntu:20.04:LTS
before 2.0.7-1ubuntu5.1, plus listed versions
2.0.6-1ubuntu12.0.6-1ubuntu22.0.7-1ubuntu12.0.7-1ubuntu32.0.7-1ubuntu42.0.7-1ubuntu5
2.0.7-1ubuntu5.1
klibc
Ubuntu:Pro:14.04:LTS
From an advisory covering 4 CVEs
before 2.0.3-0ubuntu1.14.04.3+esm2, plus listed versions
2.0.1-3.1ubuntu22.0.2-1ubuntu12.0.2-1ubuntu22.0.3-0ubuntu12.0.3-0ubuntu1.14.04.12.0.3-0ubuntu1.14.04.22.0.3-0ubuntu1.14.04.3
2.0.3-0ubuntu1.14.04.3+esm2
klibc
Ubuntu:Pro:16.04:LTS
From an advisory covering 4 CVEs
before 2.0.4-8ubuntu1.16.04.4+esm1, plus listed versions
2.0.3-0ubuntu12.0.4-42.0.4-62.0.4-72.0.4-8
Show 5 moreShow less
2.0.4-8ubuntu12.0.4-8ubuntu1.16.04.12.0.4-8ubuntu1.16.04.22.0.4-8ubuntu1.16.04.32.0.4-8ubuntu1.16.04.4
2.0.4-8ubuntu1.16.04.4+esm1
klibc
Ubuntu:18.04:LTS
From an advisory covering 4 CVEs
before 2.0.4-9ubuntu2.1, plus listed versions
2.0.4-9ubuntu12.0.4-9ubuntu2
2.0.4-9ubuntu2.1
klibc
Ubuntu:20.04:LTS
From an advisory covering 4 CVEs
before 2.0.7-1ubuntu5.1, plus listed versions
2.0.6-1ubuntu12.0.6-1ubuntu22.0.7-1ubuntu12.0.7-1ubuntu32.0.7-1ubuntu42.0.7-1ubuntu5
2.0.7-1ubuntu5.1

History

History
RecordedChangedSources
affected, facts
affected, aliases, referencesOSV
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-31870 is a critical vulnerability (CVSS 9.8) in Klibc Project Klibc, published April 30, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.08%, the 81st percentile. Fixed in klibc 2.0.9-r0.

References

Show 9 moreShow less
MoveEnter Open