CVE-2022-25299

Arbitrary File Write

Critical · published February 18, 2022

CVSS v3.1
9.8
EPSS
1%
Percentile
72.2
In the wild
Unconfirmed
What it is

🚨 A simple file upload is all it takes to wreak havoc! The mg_http_upload() method in cesanta/mongoose prior to version 7.6 lets attackers write files anywhere they want — it’s like giving someone the keys to your whole building because they asked nicely! 🔥 Picture a restaurant where the chef can put any ingredients anywhere in the kitchen, including the pantry, freezer, or even the dining room! This vulnerability lets attackers place files in unexpected locations, just as a careless chef could spoil a meal by misplacing vital ingredients. This could result in an attacker uploading malicious files, which could lead to data breaches, server compromise, or even complete takeover of affected systems. It’s absolutely devastating to think this could happen just through an innocent-looking file upload!

Put simply

Picture a restaurant where the chef can put any ingredients anywhere in the kitchen, including the pantry, freezer, or even the dining room! This vulnerability lets attackers place files in unexpected locations, just as a careless chef could spoil a meal by misplacing vital ingredients. The vulnerability arises from improper handling of file paths in the mg_http_upload() function, allowing files to be written outside the intended directory. This flaw means that unauthorized users can exploit the file upload mechanism to manipulate server files.

What to do

This could result in an attacker uploading malicious files, which could lead to data breaches, server compromise, or even complete takeover of affected systems. It’s absolutely devastating to think this could happen just through an innocent-looking file upload! Immediately upgrade cesanta/mongoose to version 7.6 or later to close this gap. Additionally, validate and sanitize all file uploads to prevent unauthorized file placement in the future. You've got this! Follow these steps, and your system will be much safer in no time. 🛡️

The record
Technical detail
CVSS v3.1
9.8 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.01394 · 72.2th percentile
Published
2022-02-18T12:55Z
EPSS history
Timeline
  • 18 FEB 12:55Z
    Arbitrary File Write
    cvelistv5