CVE-2022-31527

The Wildog/flask-file-server repository through 2020-02-20 on GitHub allows absolute path traversal because the Flask send_file function is used unsafely

published July 11, 2022

CVSS
—
EPSS
1%
Percentile
71.1
In the wild
Unconfirmed
What it is

⚠️ A simple misuse of the Flask send_file function creates a sneaky avenue for absolute path traversal! Think of it like a restaurant chef who blindly follows an order without checking if it's coming from a valid customer — they might end up serving a dish to a complete stranger! An attacker could exploit this flaw to access sensitive files outside the intended directory, potentially revealing confidential information. This could lead to data leaks or unauthorized access to critical system files — not the kind of surprise visit anyone wants!

Put simply

Think of it like a restaurant chef who blindly follows an order without checking if it's coming from a valid customer — they might end up serving a dish to a complete stranger! This vulnerability arises from the improper use of the Flask send_file function, which allows attackers to craft requests that traverse directories and access files outside the web root. If the application isn't validating the paths correctly, it can serve up more than just the intended content.

What to do

An attacker could exploit this flaw to access sensitive files outside the intended directory, potentially revealing confidential information. This could lead to data leaks or unauthorized access to critical system files — not the kind of surprise visit anyone wants! To fix this, review your use of the send_file function and implement strict validation on file paths. Consider restricting access to only the necessary files and patching to the latest version of the library as soon as possible. Don't forget to conduct a thorough security audit of any file handling features! You’ve got this! With a few adjustments, you can lock down your file handling and keep your app secure! 🛡️

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.01337 · 71.1th percentile
Published
2022-07-11T00:56Z
EPSS history
Timeline
  • 11 JUL 00:56Z
    The Wildog/flask-file-server repository through 2020-02-20 on GitHub allows absolute path traversal because the Flask send_file function is used unsafely
    cvelistv5