CVE-2021-31870
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.
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
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 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV: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 Critical
CVSS: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 Critical
CVSS: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 Critical
CVSS: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 Critical
CVSS: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 Critical
CVSS: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
| Package | Affected | Fixed |
|---|---|---|
klibcAlpine:v3.19 |
before 2.0.9-r0 | 2.0.9-r0 |
klibcAlpine:v3.20 |
before 2.0.9-r0 | 2.0.9-r0 |
klibcAlpine:v3.21 |
before 2.0.9-r0 | 2.0.9-r0 |
klibcAlpine:v3.22 |
before 2.0.9-r0 | 2.0.9-r0 |
klibcAlpine:v3.23 |
before 2.0.9-r0 | 2.0.9-r0 |
klibcAlpine:v3.24 |
before 2.0.9-r0 | 2.0.9-r0 |
klibcDebian:12 |
before 2.0.8-6 | 2.0.8-6 |
klibcDebian:13 |
before 2.0.8-6 | 2.0.8-6 |
klibcDebian:14 |
before 2.0.8-6 | 2.0.8-6 |
klibcDebian: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
| Package | Affected | Fixed |
|---|---|---|
klibcUbuntu: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 |
klibcUbuntu: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 less2.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 |
klibcUbuntu:18.04:LTS |
before 2.0.4-9ubuntu2.1, plus listed versions 2.0.4-9ubuntu12.0.4-9ubuntu2 |
2.0.4-9ubuntu2.1 |
klibcUbuntu: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 |
klibcUbuntu: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 |
klibcUbuntu: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 less2.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 |
klibcUbuntu: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 |
klibcUbuntu: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
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| affected, aliases, references | OSV | |
| aliases | EUVD | |
| first indexed | CVE 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
kernel.org/pub/linux/libs/klibc/2.0
git.kernel.org/pub/scm/libs/klibc/klibc.git/commit?id=292650f04c2b5348b4efbad61fb014ed09b4f3f2
lists.zytor.com/archives/klibc/2021-April/004593.html
openwall.com/lists/oss-security/2021/04/30/1
lists.debian.org/debian-lts-announce/2021/06/msg00025.html
nvd.nist.gov/vuln/detail/CVE-2021-31870
Show 9 moreShow less
github.com/advisories/GHSA-q5g5-fc84-93h4
security.alpinelinux.org/vuln/CVE-2021-31870
security-tracker.debian.org/tracker/CVE-2021-31870
ubuntu.com/security/CVE-2021-31870
ubuntu.com/security/notices/USN-5379-1
cve.org/CVERecord?id=CVE-2021-31870
ubuntu.com/security/CVE-2021-31871
ubuntu.com/security/CVE-2021-31872
ubuntu.com/security/CVE-2021-31873