CVE-2022-31558: Absolute Path Traversal in shiva

shiva Updated 02 Oct 2025

Summary

12/07/2022
No i
Critical
9.3

CVE-2022-31558: Tooxie Shiva 0.10.0 allows absolute path traversal because Flask send_file function used unsafely. Affects shiva versions < 0.10.0. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Shiva is a Python package available on PyPI that provides a server for the Tooxie project. It allows users to manage and share files through a web interface. The package is commonly used for file sharing and collaboration purposes. However, a vulnerability has been discovered in versions up to 0.10.0 of Shiva, which allows for absolute path traversal. This vulnerability arises due to the unsafe usage of the Flask send_file function.

Vulnerability Detail

The vulnerability in Shiva allows an attacker to perform absolute path traversal, which means they can access files outside the intended directory. By exploiting this vulnerability, an attacker could potentially gain unauthorized access to sensitive files on the server. This could lead to the exposure of confidential information or the execution of arbitrary code. The vulnerability has been assigned a CVSS score of 9.3, indicating its critical severity.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, users can implement input validation and sanitization to prevent path traversal attacks. This can be achieved by validating user input and ensuring that file paths are restricted to the intended directory. Here is an example of how to sanitize file paths in Python:

import os

def sanitize_file_path(file_path):
    base_directory = '/path/to/allowed/directory'
    sanitized_path = os.path.abspath(os.path.join(base_directory, file_path))
    if not sanitized_path.startswith(base_directory):
        raise ValueError('Invalid file path')
    return sanitized_path

This code snippet demonstrates how to validate and sanitize a file path, ensuring that it remains within the specified base directory.

Conclusion

In conclusion, the Shiva package up to version 0.10.0 is vulnerable to absolute path traversal due to the unsafe usage of the Flask send_file function. This vulnerability can lead to unauthorized access to sensitive files and potential code execution. It is crucial to upgrade to a patched version of Shiva and implement proper input validation to mitigate this vulnerability. For further support and assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for shiva →

Share this vulnerability

FAQ

This vulnerability allows an attacker to access files outside the intended directory, potentially leading to unauthorized access to sensitive information or the execution of arbitrary code.

Versions up to and including 0.10.0 of Shiva are affected by this vulnerability.

Yes, this vulnerability has been assigned the CVE identifier CVE-2022-31558.

This vulnerability has been assigned a CVSS score of 9.3, indicating its critical severity.

To mitigate this vulnerability, it is recommended to upgrade to a version of Shiva that includes the necessary security patches. Additionally, implementing input validation and sanitization can help prevent path traversal attacks.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback