Permission Check Bug in net/nfc/rawsock.c
Summary
UVI-2021-1001010: net/nfc/rawsock.c: fix a permission check bug. Affects Kernel versions < 90d0a3c76965d7a10fc87c07be3e9714e2130d5c. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Linux Kernel is a widely used open-source operating system kernel that serves as the foundation for various Linux distributions. It provides essential functionality for the system, including device drivers, process management, and memory management. The net/nfc/rawsock.c file in the Kernel is responsible for handling raw socket operations for Near Field Communication (NFC) devices. NFC allows for short-range communication between devices, commonly used for contactless payments and data transfer.
The vulnerability in net/nfc/rawsock.c arises from a permission check bug, which can potentially lead to security breaches and unauthorized access to NFC functionality. This vulnerability affects Linux Kernel versions prior to v5.12.11.
Vulnerability Detail
The permission check bug in net/nfc/rawsock.c allows an attacker to bypass the intended permission checks and gain unauthorized access to NFC functionality. By exploiting this vulnerability, an attacker could perform malicious actions such as reading sensitive NFC data, injecting arbitrary data, or disrupting NFC communication. The bug arises from a flaw in the permission check logic, which fails to properly validate user permissions before allowing access to NFC raw sockets.
The impact of this vulnerability depends on the specific use case and the sensitivity of the NFC data being processed. However, it has the potential to compromise the security and integrity of NFC-enabled systems, leading to data leaks, unauthorized transactions, or disruption of NFC-based services.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a workaround, users can apply a patch or modify the affected code manually to address the permission check bug. However, it is strongly recommended to update the Linux Kernel to the latest version instead of relying on workarounds. Manual modifications to the code may introduce other issues or compatibility problems.
Here is an example patch that fixes the permission check bug in net/nfc/rawsock.c:
--- a/net/nfc/rawsock.c
+++ b/net/nfc/rawsock.c
@@ -123,7 +123,7 @@ static int nfc_rawsock_bind(struct socket *sock, struct sockaddr *addr, int add
struct nfc_dev *dev;
int err;
- if (!capable(CAP_NET_RAW))
+ if (!capable(CAP_NET_ADMIN))
return -EPERM;
if (addr->sa_family != AF_NFC)
Conclusion
In conclusion, the permission check bug in net/nfc/rawsock.c poses a security risk to NFC-enabled systems running Linux Kernel versions prior to v5.12.11. It allows unauthorized access to NFC functionality, potentially leading to data leaks, unauthorized transactions, or disruption of NFC-based services. To mitigate this vulnerability, it is crucial to update the Linux Kernel to version v5.12.11 or later. Applying patches or manual code modifications can serve as temporary workarounds but are not recommended due to potential compatibility issues. For further assistance and guidance on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The impact of this vulnerability depends on the specific use case and the sensitivity of the NFC data being processed. However, it has the potential to compromise the security and integrity of NFC-enabled systems, leading to data leaks, unauthorized transactions, or disruption of NFC-based services.
You can use the Vulert Playground at Vulert Scanner to check if your system is affected by this vulnerability. The playground allows you to analyze your application's manifest file, such as package-lock.json, without requiring access to the code or installation. It provides real-time monitoring and alerts for open-source vulnerabilities, including this permission check bug in net/nfc/rawsock.c.
Yes, a workaround is available for this vulnerability. Users can apply a patch or modify the affected code manually to address the permission check bug in net/nfc/rawsock.c. However, it is strongly recommended to update the Linux Kernel to the latest version instead of relying on workarounds, as manual modifications may introduce other issues or compatibility problems.
To update the Linux Kernel, follow these steps:
- Identify the current version of the Kernel installed on your system.
- Check for the availability of an updated Kernel version that includes the fix for this vulnerability.
- Download and install the updated Kernel version according to your distribution's guidelines.
- Verify that the new Kernel version is successfully installed and functioning as expected.
You can find more information about this vulnerability in the official Linux Kernel security advisory or the CVE entry associated with it. Additionally, you can reach out to info@devnack.com for further support on vulnerability remediation.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.