Network Security Services (NSS) is a set of open‑source cryptographic libraries that powers the security of countless applications on Fedora Linux. Firefox, Chrome, curl, and many other programs rely on NSS to handle SSL/TLS connections, certificates, and cryptography. Keeping NSS fully patched is essential for system security.
In May 2026, a Fedora security advisory was released to update NSS for Fedora 43. However, the methods described here are not tied to a single date—they are evergreen and apply whenever you need to check, patch, or protect NSS on any supported Fedora release.
1. Why NSS Updates Should Never Be Postponed
NSS vulnerabilities can lead to severe consequences, including:
- Man‑in‑the‑middle (MITM) attacks – Broken certificate validation lets attackers impersonate trusted websites or services.
- Data decryption – Cryptographic flaws might allow an adversary to decrypt supposedly secure network traffic.
- Denial of service (DoS) – Malformed input could crash applications that use NSS, such as your web browser or email client.
- Privilege escalation – In some scenarios, a local attacker could exploit a vulnerable NSS library to gain higher system privileges.
Because NSS is so deeply integrated into Fedora, an unpatched library exposes your entire system to increased risk.
2. How to Check If Your Fedora System Is Vulnerable
2.1. Check the Installed NSS Version
rpm -q nss
dnf list installed nss
dnf check-update nss
rpm -qR nss
nss-config --version
dnf repoquery --info nss
3. Automation Script to Apply the Fix
#!/bin/bash # # update_nss.sh - Fully automated NSS update script for Fedora Linux # # Usage: sudo bash update_nss.sh # set -euo pipefail # Coloured output for better readability RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' # No Color echo -e "${YELLOW}===== NSS Security Updater for Fedora =====${NC}" # Check root privileges if [ "$EUID" -ne 0 ]; then echo -e "${RED}This script must be run as root. Use: sudo bash update_nss.sh${NC}" exit 1 fi # Step 1: Current version echo -e "\n${YELLOW}[1/5] Current NSS version:${NC}" rpm -q nss || echo "NSS package not found." # Step 2: Clean DNF cache and refresh metadata echo -e "\n${YELLOW}[2/5] Refreshing package metadata...${NC}" dnf clean all dnf makecache # Step 3: Check available update echo -e "\n${YELLOW}[3/5] Checking for NSS update...${NC}" AVAILABLE=$(dnf check-update nss | grep -E '^nss\.' || true) if [ -z "$AVAILABLE" ]; then echo -e "${GREEN}NSS is already up to date. Exiting.${NC}" exit 0 else echo "$AVAILABLE" fi # Step 4: Apply the update echo -e "\n${YELLOW}[4/5] Applying update...${NC}" dnf upgrade -y nss # Step 5: Verify new version echo -e "\n${YELLOW}[5/5] Verifying update...${NC}" NEW_VERSION=$(rpm -q nss) echo -e "${GREEN}Update complete. New version: $NEW_VERSION${NC}" # Notify about required service restarts echo -e "\n${YELLOW}Important:${NC} Restart any applications that use NSS (browser, curl, etc.)." echo -e "A full system reboot is recommended for complete protection." echo -e "\n${GREEN}===== NSS update finished successfully =====${NC}"
- Display your current NSS version.
- Refresh DNF metadata.
- Check for an update.
- Apply the update if available.
- Verify the new version.
- Remind you to restart services
4. Alternative Mitigations If You Cannot Update Now
4.1. Restrict Outbound Network Access with iptables
# Example: Block all outbound HTTPS from the 'firefox' process # (First identify the user running Firefox, then use iptables owner module) iptables -A OUTPUT -p tcp --dport 443 -m owner --uid-owner <USER_ID> -j DROP
4.2. Enforce Strict AppArmor / SELinux Policies
# Install AppArmor if not already present sudo dnf install apparmor-parser apparmor-utils # Put Firefox into 'complain' mode first to log violations sudo aa-complain /usr/bin/firefox # After reviewing logs, enforce the profile sudo aa-enforce /usr/bin/firefox
# Check if SELinux is enforcing getenforce # View denials related to NSS sudo ausearch -m avc -ts recent | grep nss # Apply a custom policy (advanced) # Use 'audit2allow' to generate a local policy module if needed
4.3 Build Your Own Security Lab with a Raspberry Pi
4.4. Use a Web Proxy with SSL Interception Disabled
4.4. Run High‑Risk Applications in Containers
# Run Firefox in a rootless container with a separate user namespace podman run --rm -it --userns=keep-id \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -e DISPLAY=$DISPLAY \ docker.io/library/firefox:latest
4.5. Use Hardened Memory Allocators
# Install hardened_malloc (if available in your repository) sudo dnf install hardened_malloc # Preload it for a specific application LD_PRELOAD=/usr/lib/libhardened_malloc.so firefox

Nenhum comentário:
Postar um comentário