CVE-2021-3981
Low · 3.3CVSS
3.3
EPSS
0.3%
Published
Mar 10, 2022
CISA due date
—
Cloudanix analysis
a common system boot file that may contain passwords is readable by any user on the computer instead of being restricted to administrators only.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- Trivial
- Impact
- Data Exposure
- Component
- Application
- Class
- Misconfiguration
- Remediation
- No Fix Yet
- Effort
- Other
- Patch risk
- Other
What it actually does
grub.cfg is generated with permissions allowing any local user to read its contents, exposing any encrypted passwords stored within the bootloader configuration.
Why it matters to the business
local users on affected systems may obtain bootloader passwords that were intended to remain confidential, increasing the risk of unauthorized boot parameter changes or further local privilege escalation attempts; the absence of an official fixed release extends exposure across all downstream distributions.
How an attack unfolds
an attacker with an existing local account on the system simply opens the world-readable grub.cfg file and extracts any password hashes or credentials that were placed there for bootloader protection.
How to fix it
manually set grub.cfg permissions to root-only readable (chmod 600) after every regeneration until an upstream release containing the fix is packaged by distributions; monitor grub2 package updates for the corrected version once published.
How to confirm the fix worked
verify that grub.cfg is owned by root with mode 600 and confirm no non-root users can open the file; re-run grub-mkconfig and re-check permissions after any bootloader configuration change.
Typical attack path
- obtain a valid local user account on the target host
- locate the grub.cfg file in its standard boot directory
- read the file contents directly due to permissive ownership
- extract any encrypted passwords for offline cracking or reuse
How to detect it
examine file permissions and ownership of grub.cfg across managed hosts; review local user activity logs for unexpected reads of bootloader configuration files; no network or remote indicators apply.
What your security team should do
- apply the manual permission hardening immediately on all affected systems
- add a post-install hook or cron job to enforce correct grub.cfg permissions after updates
- track distribution package repositories for the first release containing the upstream fix and deploy it as soon as available
- review any documented bootloader passwords and rotate them if exposure is confirmed
The record
A flaw in grub2 was found where its configuration file, known as grub.cfg, is being created with the wrong permission set allowing non privileged users to read its content. This represents a low severity confidentiality issue, as those users can eventually read any encrypted passwords present in grub.cfg. This flaw affects grub2 2.06 and previous versions. This issue has been fixed in grub upstream but no version with the fix is currently released.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| AlmaLinux:8 | grub2-common | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-efi-aa64 | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-efi-aa64-cdboot | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-efi-aa64-modules | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-efi-ia32 | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-efi-ia32-cdboot | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-efi-ia32-modules | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-efi-x64 | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-efi-x64-cdboot | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-efi-x64-modules | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-pc | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-pc-modules | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-ppc64le | 0 | 1:2.02-123.el8_6.8.alma |
| AlmaLinux:8 | grub2-ppc64le-modules | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-tools | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-tools-efi | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-tools-extra | 0 | 1:2.02-123.el8.alma |
| AlmaLinux:8 | grub2-tools-minimal | 0 | 1:2.02-123.el8.alma |
| Debian:11 | grub2 | 0 | No fix |
| Debian:12 | grub2 | 0 | 2.06-8 |
| Debian:13 | grub2 | 0 | 2.06-8 |
| Red Hat:enterprise_linux:8::baseos | grub2 | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-common | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-debuginfo | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-debugsource | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-efi-aa64 | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-efi-aa64-cdboot | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-efi-aa64-modules | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-efi-ia32 | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-efi-ia32-cdboot | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-efi-ia32-modules | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-efi-x64 | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-efi-x64-cdboot | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-efi-x64-modules | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-pc | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-pc-modules | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-ppc64le | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-ppc64le-modules | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-tools | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-tools-debuginfo | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-tools-efi | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-tools-efi-debuginfo | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-tools-extra | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-tools-extra-debuginfo | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-tools-minimal | 0 | 1:2.02-123.el8 |
| Red Hat:enterprise_linux:8::baseos | grub2-tools-minimal-debuginfo | 0 | 1:2.02-123.el8 |
| Rocky Linux:8 | grub2 | 0 | 1:2.02-123.el8 |
| Ubuntu:16.04:LTS | grub2-signed | 0 | No fix |
| Ubuntu:16.04:LTS | grub2-unsigned | 0 | No fix |
| Ubuntu:18.04:LTS | grub2-signed | 0 | No fix |
| Ubuntu:18.04:LTS | grub2-unsigned | 0 | No fix |
| Ubuntu:20.04:LTS | grub2-signed | 0 | 1.187.3~20.04.1 |
| Ubuntu:20.04:LTS | grub2-unsigned | 0 | 2.06-2ubuntu14.1 |
| Ubuntu:20.04:LTS | shim | 0 | 15.7-0ubuntu1 |
| Ubuntu:20.04:LTS | shim-signed | 0 | 1.40.9 |
| Ubuntu:22.04:LTS | grub2-signed | 0 | 1.187.3~22.04.1 |
| Ubuntu:22.04:LTS | grub2-unsigned | 0 | 2.06-2ubuntu14.1 |
| Ubuntu:22.04:LTS | shim | 0 | 15.7-0ubuntu1 |
| Ubuntu:22.04:LTS | shim-signed | 0 | 1.51.3 |
| Ubuntu:Pro:14.04:LTS | grub2-signed | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | grub2-signed | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | grub2-unsigned | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | grub2-signed | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | grub2-unsigned | 0 | No fix |
| openSUSE:Tumbleweed | grub2 | 0 | 2.06-13.1 |
Related vulnerabilities
- CVE-2023-4692 An out-of-bounds write flaw was found in grub2's NTFS filesystem driver. Also affects grub2-common
- CVE-2023-4693 An out-of-bounds read flaw was found on grub2's NTFS filesystem driver. Also affects grub2-common
- CVE-2022-28736 There's a use-after-free vulnerability in grub_cmd_chainloader() function; The… Also affects grub2-common
- CVE-2022-28735 The GRUB2's shim_lock verifier allows non-kernel files to be loaded on shim-powered… Also affects grub2-common
- CVE-2022-28733 Integer underflow in grub_net_recv_ip4_packets; A malicious crafted IP packet can lead to… Also affects grub2-common
- CVE-2022-28734 Out-of-bounds write when handling split HTTP headers; When handling split HTTP headers… Also affects grub2-common
- CVE-2022-3775 When rendering certain unicode sequences, grub2's font code doesn't proper validate if… Also affects grub2-common
- CVE-2022-2601 A buffer overflow was found in grub_font_construct_glyph(). Also affects grub2-common