CVE-2024-21897

8.9 HIGH

📋 TL;DR

This cross-site scripting (XSS) vulnerability in QNAP operating systems allows authenticated attackers to inject malicious scripts into web applications. The vulnerability affects multiple QNAP NAS devices and could lead to session hijacking, credential theft, or malware distribution. Only authenticated users can exploit this vulnerability.

💻 Affected Systems

Products:
  • QNAP QTS
  • QNAP QuTS hero
Versions: Versions before QTS 5.1.6.2722 build 20240402 and QuTS hero h5.1.6.2734 build 20240414
Operating Systems: QNAP QTS, QNAP QuTS hero
Default Config Vulnerable: ⚠️ Yes
Notes: Requires authenticated access to the web interface. All default configurations with affected versions are vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

An authenticated attacker could steal administrator credentials, gain full control of the QNAP device, pivot to internal networks, deploy ransomware, or exfiltrate sensitive data.

🟠

Likely Case

Authenticated malicious users or compromised accounts could hijack sessions, steal user credentials, redirect users to phishing sites, or perform actions on behalf of other users.

🟢

If Mitigated

With proper network segmentation, strong authentication controls, and limited user privileges, impact would be contained to the specific application or user session.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires authenticated access. XSS vulnerabilities typically have low exploitation complexity once the injection point is identified.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: QTS 5.1.6.2722 build 20240402 or later, QuTS hero h5.1.6.2734 build 20240414 or later

Vendor Advisory: https://www.qnap.com/en/security-advisory/qsa-24-20

Restart Required: Yes

Instructions:

1. Log into QNAP web interface as administrator. 2. Go to Control Panel > System > Firmware Update. 3. Check for updates and install the latest version. 4. Reboot the NAS after installation completes.

🔧 Temporary Workarounds

Restrict Network Access

all

Limit access to QNAP web interface to trusted IP addresses only

Implement Content Security Policy

all

Add CSP headers to restrict script execution

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate QNAP devices from critical systems
  • Enforce strong authentication policies and limit user privileges to minimum required

🔍 How to Verify

Check if Vulnerable:

Check current firmware version in Control Panel > System > Firmware Update

Check Version:

ssh admin@qnap-ip 'cat /etc/config/uLinux.conf | grep version'

Verify Fix Applied:

Verify firmware version is QTS 5.1.6.2722 build 20240402 or later, or QuTS hero h5.1.6.2734 build 20240414 or later

📡 Detection & Monitoring

Log Indicators:

  • Unusual JavaScript injection patterns in web logs
  • Multiple failed authentication attempts followed by successful login
  • Suspicious user agent strings containing script tags

Network Indicators:

  • Unusual outbound connections from QNAP device
  • Traffic to known malicious domains from authenticated sessions

SIEM Query:

source="qnap_logs" AND ("script" OR "javascript" OR "onload" OR "onerror") AND status=200

🔗 References

📤 Share & Export