CVE-2022-31516

The Harveyzyh/Python repository through 2022-05-04 on GitHub allows absolute path traversal because the Flask send_file function is used unsafely

published July 11, 2022

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

⚠️ Beware of a sneaky absolute path traversal lurking in the Harveyzyh/Python repository! This vulnerability allows attackers to access any file they like, as if they found a forgotten key to the server's storage room. 🔓 Think of it like a restaurant where the menu lets you order anything from the stockroom, including items that should be off-limits. If the staff doesn’t check the orders carefully, you might end up with something you never asked for – or worse, something that shouldn’t be there at all! An attacker could exploit this vulnerability to read any file on the server, potentially exposing sensitive data or configurations. It’s like leaving the back door of an establishment wide open – anyone could wander in and access anything they find!

Put simply

Think of it like a restaurant where the menu lets you order anything from the stockroom, including items that should be off-limits. If the staff doesn’t check the orders carefully, you might end up with something you never asked for – or worse, something that shouldn’t be there at all! The issue arises because the Flask `send_file` function is used in an unsafe manner, allowing for absolute paths to be provided. This means that the application does not properly validate the requested file paths, leading to potential unauthorized access to server files.

What to do

An attacker could exploit this vulnerability to read any file on the server, potentially exposing sensitive data or configurations. It’s like leaving the back door of an establishment wide open – anyone could wander in and access anything they find! To remediate this issue, ensure that user input is validated and sanitized before being passed to the `send_file` function. Consider using relative paths or implementing a whitelist of allowed files. It's also a good idea to update your Flask version if there are any patches available. You’ve got this! Implement these steps, and you’ll keep your files safe and sound in no time. 🛡️

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.01337 · 71.0th percentile
Published
2022-07-11T00:55Z
EPSS history
Timeline
  • 11 JUL 00:55Z
    The Harveyzyh/Python repository through 2022-05-04 on GitHub allows absolute path traversal because the Flask send_file function is used unsafely
    cvelistv5