CVE-2024-22086
NixOS vulnerability analysis and mitigation

Overview

CVE-2024-22086 is a critical security vulnerability discovered in the cherry web server through version 4b877df. The vulnerability was disclosed on January 4, 2024, and affects the handle_request function in http.c. The flaw allows remote attackers to trigger a stack-based buffer overflow via a long URI, which could lead to remote code execution (NVD).

Technical details

The vulnerability exists in the handle_request function at line 54 of http.c, where an unbounded sscanf() call is used to parse HTTP request components: sscanf(buf, "%s %s %s", method, uri, version). This implementation fails to limit the number of characters read into each string buffer, leading to a stack buffer overflow when processing maliciously crafted URIs. The vulnerability has received a CVSS v3.1 base score of 9.8 (CRITICAL) with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (NVD).

Impact

The vulnerability allows attackers to execute arbitrary code remotely by sending specially crafted HTTP requests with excessively long URIs. When exploited, this could lead to complete system compromise, allowing attackers to gain unauthorized access to the affected system with the same privileges as the cherry server process (GitHub Issue).

Mitigation and workarounds

The recommended mitigation is to modify the sscanf format string to specify maximum field widths, preventing buffer overflow. The suggested fix is to change the vulnerable code to: sscanf(buf, "%5000s %300s %300s", method, uri, version). This limits the number of characters read into each buffer, ensuring they cannot overflow (GitHub Issue).

Additional resources


SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-20807MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20806MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20805MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20804MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20803MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management