Critical Vulnerability in socat: Insecure File Handling in readline.sh

socat Updated 02 Oct 2025

Summary

04/12/2024
N/A
Yes i
Unrated
Not published

CVE-2024-54661: readline.sh in socat before1.8.0.2 relies on the /tmp/$USER/stderr2 file. Affects socat versions < 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

socat is a versatile networking tool that establishes two bidirectional byte streams and transfers data between them. It is widely used for network communication, debugging, and testing. The package is known for its ability to create connections between different protocols and interfaces. However, it has been found to have a vulnerability in its readline.sh script, which can lead to insecure handling of temporary files, potentially exposing sensitive information.

Vulnerability Detail

The vulnerability, identified as CVE-2024-54661, arises from the reliance of readline.sh in socat versions prior to 1.8.0.2 on a temporary file located at /tmp/$USER/stderr2. This file can be accessed by other users on the system, leading to potential information leakage or unauthorized access to sensitive data. The issue is particularly concerning in multi-user environments where attackers could exploit this flaw to read the contents of the temporary file, compromising the security of the application.

How To Fix

To rectify the vulnerability, it is recommended to update socat to the patched version 1.8.0.2-1 or later. This can be done using the following command in a Debian-based system:

sudo apt-get update &&

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users can restrict access to the /tmp directory or change the permissions of the stderr2 file to limit access. However, this is not a permanent solution and updating the package is strongly advised.

Conclusion

The CVE-2024-54661 vulnerability in socat poses a significant risk due to insecure file handling in its readline.sh script. Users are strongly encouraged to update to the latest version to protect against potential data leaks. For real-time monitoring of open-source vulnerabilities, consider using Vulert, which allows you to track vulnerabilities using just a manifest file.

See every vulnerability recorded for socat →

Share this vulnerability

FAQ

CVE-2024-54661 is a vulnerability in socat that involves insecure handling of temporary files, which could lead to unauthorized access to sensitive information.

You can check if your version of socat is affected by visiting the Vulert playground at Vulert Scanner, where you can analyze your manifest file for vulnerabilities.

The primary risk is the potential exposure of sensitive information through the insecure temporary file, especially in environments with multiple users.

Yes, a patch is available in socat version 1.8.0.2-1 and later. It is crucial to update to this version to mitigate the vulnerability.

If immediate updating is not possible, consider implementing temporary workarounds such as restricting access to the /tmp directory or changing file permissions, but prioritize updating as soon as feasible.

Related vulnerabilities

Recent vulnerabilities recorded for socat.

How To Fix

To rectify the vulnerability, it is recommended to update socat to the patched version 1.8.0.2-1 or later. This can be done using the following command in a Debian-based system:

sudo apt-get update &&

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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