LibarchiveApplication

CVE-2023-30571

MEDIUM · 5.3 CVSS v3.1 Published 2023-05-29
Fix available
A fix is available. Upgrade to after 3.6.2 or later.
See remediation →
55/100
Remediation priority · Elevated
Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Libarchive through 3.6.2 can cause directories to have world-writable permissions. The umask() call inside archive_write_disk_posix.c changes the umask of the whole process for a very short period of time; a race condition with another thread can lead to a permanent umask 0 setting. Such a race condition could lead to implicit directory creation with permissions 0777 (without the sticky bit), which means that any low-privileged local user can delete and rename files inside those directories.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Libarchive through 3.6.2 has a race condition in archive_write_disk_posix.c where the umask() call temporarily changes the process umask. A concurrent thread can cause the umask to be permanently set to 0, resulting in implicitly created directories having permissions 0777 without the sticky bit. This allows unprivileged local users to delete and rename files within those directories.

MitigationUpgrade to a fixed version of libarchive that addresses this race condition. Identify all applications and systems using the vulnerable libarchive version and rebuild them with the patched library.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
LibarchiveApplication
Affected:<= 3.6.2

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Local
Complexity
High
Privileges
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
High

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify installed libarchive version
    Run 'pkg-config --modversion libarchive' or check the shared library with 'ls -l /usr/lib*/libarchive.so*' and 'ldd <application> | grep archive'. On systems with rpm, use 'rpm -q libarchive'; for dpkg-based systems, 'dpkg -l libarchive'.
    Affected if The version is 3.6.2 or earlier, or the version cannot be determined and is assumed to be <= 3.6.2 based on the package source age.
  2. Confirm archive extraction to disk is used
    Identify applications or scripts that call libarchive functions such as archive_read_next_header() combined with archive_read_extract() or archive_entry_copy_pathname() followed by archive_write_header() with archive_write_finish_entry(). These are the code paths that trigger the vulnerable archive_write_disk_posix.c module.
    Affected if Any application uses libarchive to extract archives to the filesystem (archive extraction, unzip operations, or similar write-to-disk operations).
  3. Verify concurrent thread usage with libarchive
    Review application source code for pthread_create() or threading module usage alongside libarchive calls. Check if multiple threads perform archive operations simultaneously or if any thread modifies umask while another performs extraction.
    Affected if The application or service runs concurrent threads where at least one thread performs archive extraction while another thread may set or modify umask, creating the race condition window.
  4. Check current process umask after archive operations
    In a test environment, call umask() immediately before and after performing libarchive extraction operations in a multi-threaded context. Compare the before and after values.
    Affected if The umask value changes from its original setting to 0 after libarchive extraction operations in a threaded context, indicating the race condition has occurred.

You are affected if libarchive version 3.6.2 or earlier is installed AND your application uses archive extraction to disk AND concurrent threads are involved in or around archive operations.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to a release after 3.6.2
Interim mitigation

Upgrade to a fixed version of libarchive that addresses this race condition. Identify all applications and systems using the vulnerable libarchive version and rebuild them with the patched library.

Recommended fix Moderate confidence

Libarchive 3.6.3 or later

  1. 1. Identify all applications and systems that link to or use the Libarchive library.
  2. 2. Update Libarchive to version 3.6.3 or later, which contains the fix for the race condition vulnerability.
  3. 3. Rebuild or restart any applications that dynamically link to Libarchive to ensure they use the updated library.
  4. 4. Verify the update was successful by checking the installed Libarchive version.
  5. 5. Test that archive extraction functionality continues to work correctly after the upgrade.

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Libarchive Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing6.0 h
  • Review / QA4.0 h
22.0 hours of engineering $3,860
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $6,176.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2023-30571 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2023-30571 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data