Memory Corruption Vulnerability in OpenRC Package

openrc Updated 02 Oct 2025

Summary

14/10/2021
N/A
Yes i
High
7.5

ALPINE-CVE-2021-42341: checkpath in OpenRC before 0.44.7 uses the direct output of strlen() to allocate strings, which does not account for the '\0' byte at the end of the string. Affects openrc versions < 0.43.3-r2. Fixed in 0.43.3-r2. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

OpenRC is a dependency management tool used in Alpine Linux that facilitates service management and initialization. It is designed to be lightweight and efficient, providing a simple interface for managing system services. However, a vulnerability has been identified in OpenRC that can lead to memory corruption, impacting the stability and security of systems relying on this package.

Vulnerability Detail

The vulnerability, identified as CVE-2021-42341, arises from the checkpath function in OpenRC versions prior to 0.44.7. This function uses the direct output of strlen() to allocate strings without accounting for the null terminator ('\0') at the end of the string. As a result, this oversight can lead to memory corruption, potentially allowing an attacker to exploit the system. The vulnerability was introduced in git commit 63db2d99e730547339d1bdd28e8437999c380cae during the development of OpenRC version 0.44.0.

How To Fix

Minimum fixed version

0.43.3-r2

This is the first release that contains the fix.

sudo apk add --upgrade openrc

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

Workaround

As a temporary workaround, users can limit the use of the affected functions in OpenRC until the package is updated. However, the most effective solution is to apply the patch as soon as possible.

Conclusion

The identified vulnerability in OpenRC, CVE-2021-42341, poses a significant risk due to memory corruption issues. It is crucial for users to update their OpenRC packages to the latest patched versions to mitigate this risk. Utilizing tools like Vulert can help in monitoring and managing vulnerabilities effectively.

See every vulnerability recorded for openrc →

Share this vulnerability

FAQ

CVE-2021-42341 is a vulnerability in the OpenRC package that can lead to memory corruption due to improper string allocation.

You can use Vulert, which monitors and alerts for open-source vulnerabilities. Visit Vulert Scanner to check if your application is affected without any signup.

The vulnerability can lead to memory corruption, which may result in system instability, crashes, or exploitation by attackers.

You can update the OpenRC package using the command 'apk add openrc@<patched_version>' in your terminal, replacing <patched_version> with the appropriate version number.

While the primary risk is system instability, there is a potential for data loss if the memory corruption leads to crashes or unexpected behavior.

Related vulnerabilities

Recent vulnerabilities recorded for openrc.

How To Fix

Minimum fixed version

0.43.3-r2

This is the first release that contains the fix.

sudo apk add --upgrade openrc

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