CVE-2024-50397 Overview
CVE-2024-50397 is a use of externally-controlled format string vulnerability [CWE-134] affecting several QNAP operating system versions. Authenticated remote attackers can exploit the flaw to read secret memory contents or modify process memory on affected network-attached storage (NAS) devices. QNAP addressed the issue in QTS 5.2.1.2930 build 20241025 and QuTS hero h5.2.1.2929 build 20241025.
Critical Impact
A remote attacker with valid user credentials can leak sensitive in-memory data and corrupt process state on affected QNAP NAS appliances, threatening confidentiality, integrity, and availability of hosted data.
Affected Products
- QNAP QTS versions prior to 5.2.1.2930 build 20241025
- QNAP QuTS hero versions prior to h5.2.1.2929 build 20241025
- QNAP NAS appliances running the vulnerable firmware builds listed in QNAP Security Advisory QSA-24-43
Discovery Timeline
- 2024-11-22 - CVE-2024-50397 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-50397
Vulnerability Analysis
The vulnerability stems from improper handling of externally-controlled format strings within QTS and QuTS hero. When user-supplied input reaches a formatting function such as printf, sprintf, or syslog as the format argument, attackers can inject format specifiers like %x, %s, or %n. These specifiers instruct the function to read from or write to memory locations that the caller never intended to expose.
Successful exploitation lets an authenticated attacker disclose stack contents, heap pointers, and other secret data resident in the target process. Write-capable specifiers such as %n can modify memory, enabling control-flow manipulation and privileged state changes. The network attack vector makes the flaw reachable over the LAN or the internet whenever the NAS management interface is exposed.
Root Cause
The root cause is a violation of secure-coding practice for variadic C functions. QNAP components passed attacker-influenced strings directly as the format parameter instead of using a fixed format literal with the untrusted data supplied as an argument. This pattern is the canonical [CWE-134] weakness.
Attack Vector
An attacker must first obtain valid user credentials on the target NAS. From there, the adversary sends crafted requests containing format specifiers to the vulnerable interface. No user interaction is required, and exploitation completes over the network against the affected service.
No verified public proof-of-concept is available. Refer to the vendor advisory for technical scope.
Detection Methods for CVE-2024-50397
Indicators of Compromise
- Web or API request payloads containing conversion specifiers such as %s, %x, %p, or %n submitted by authenticated users.
- Unexpected segmentation faults, aborts, or restarts of QTS or QuTS hero services logged in system diagnostics.
- Authenticated sessions from unfamiliar geolocations followed by anomalous administrative activity.
Detection Strategies
- Inspect HTTP request bodies and query parameters directed at QNAP management endpoints for repeated % characters or format-specifier patterns.
- Correlate authentication events with subsequent process crashes to surface exploitation attempts against QTS or QuTS hero.
- Baseline normal API usage per account and alert on statistical deviations that align with fuzzing behavior.
Monitoring Recommendations
- Forward QNAP system, access, and event logs to a central SIEM or data lake for retention and correlation.
- Monitor for privilege changes, new administrator accounts, and unexpected SSH activity on NAS devices.
- Track egress traffic from NAS appliances to detect data exfiltration following successful memory disclosure.
How to Mitigate CVE-2024-50397
Immediate Actions Required
- Upgrade QTS to 5.2.1.2930 build 20241025 or later, and QuTS hero to h5.2.1.2929 build 20241025 or later.
- Enumerate QNAP NAS devices across the environment and confirm firmware versions against the vendor advisory.
- Rotate credentials for all NAS user accounts, especially administrator accounts, after patching.
- Remove internet exposure of NAS management interfaces where operationally possible.
Patch Information
QNAP released fixed firmware in QTS 5.2.1.2930 build 20241025 and QuTS hero h5.2.1.2929 build 20241025. Apply the updates through the Control Panel firmware update workflow or download them from the QNAP support portal. Full remediation guidance is documented in QNAP Security Advisory QSA-24-43.
Workarounds
- Restrict access to the NAS management interface using firewall rules and place devices behind a VPN.
- Disable unused services and remote-access features such as myQNAPcloud until patching is complete.
- Enforce strong, unique passwords and multi-factor authentication on every NAS account.
- Limit user privileges so that only trusted administrators hold accounts capable of reaching authenticated endpoints.
# Verify installed QTS or QuTS hero firmware version
getcfg System Version -f /etc/config/uLinux.conf
getcfg System "Build Number" -f /etc/config/uLinux.conf
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

