CVE-2022-31573: Path Traversal in chainerrl-visualizer

chainerrl-visualizer Updated 02 Oct 2025

Summary

12/07/2022
No i
Critical
9.3

CVE-2022-31573: ChainerRL Visualizer 0.1.1 vulnerable to Path Traversal via unsafe use of send_file function. Affects chainerrl-visualizer versions < 0.1.1. 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

chainerrl-visualizer is a Python package available on PyPI that provides a visualizer for the ChainerRL reinforcement learning library. It allows users to visualize and analyze the training process of reinforcement learning agents. The package includes a web server component built with Flask, which serves the visualizations to the user. However, a vulnerability has been identified in versions up to 0.1.1 of chainerrl-visualizer, which allows for path traversal attacks.

Vulnerability Detail

The vulnerability in chainerrl-visualizer arises from the unsafe use of the Flask send_file function. This function is used to serve image files to the user, but it does not properly validate the requested file path. As a result, an attacker can exploit this vulnerability by crafting a malicious request that includes a relative or absolute path traversal sequence. This allows the attacker to access arbitrary files on the server's file system, potentially exposing sensitive information or executing malicious code. The severity of this vulnerability is rated as CRITICAL with a CVSS score of 9.3.

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

If upgrading to the patched version is not immediately feasible, a temporary workaround can be implemented by modifying the affected function in the code. The vulnerable function is chainerrl_visualizer.web_server.create_app.get_image. To mitigate the path traversal vulnerability, the function should be updated to validate the requested file path and ensure that it only serves files from the intended directory. Here is an example of a possible fix:

import os
from flask import send_file

def get_image(filename):
    # Validate the requested file path
    if not filename.startswith('images/'):  # Only serve files from the 'images' directory
        return 'Invalid file path', 400

    # Construct the absolute file path
    file_path = os.path.join(app.static_folder, filename)

    # Serve the file using Flask's send_file function
    return send_file(file_path)

Conclusion

In conclusion, the chainerrl-visualizer package up to version 0.1.1 is vulnerable to a path traversal attack due to the unsafe use of the Flask send_file function. Users are advised to upgrade to version 0.1.2 or later to mitigate this vulnerability. Alternatively, the provided workaround can be applied to temporarily address the issue. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for chainerrl-visualizer →

Share this vulnerability

FAQ

chainerrl-visualizer is a Python package that provides a visualizer for the ChainerRL reinforcement learning library. It allows users to analyze and visualize the training process of reinforcement learning agents.

This vulnerability allows an attacker to perform path traversal attacks, potentially accessing arbitrary files on the server's file system. This can lead to unauthorized access to sensitive information or the execution of malicious code.

To fix this vulnerability, it is recommended to upgrade to version 0.1.2 or later of chainerrl-visualizer. Alternatively, you can apply the provided workaround by modifying the get_image function to validate the requested file path.

Yes, the CVSS score for this vulnerability is 9.3, indicating a critical severity level.

For more information about this vulnerability, you can refer to the GitHub Security Advisory GHSA-687h-86vc-5x59 or the CVE identifier CVE-2022-31573.

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