CVE-2025-48387: tar-fs has issue where extract can write outside the specified dir with a specific tarball

Published Jun 2, 2025
·
Updated

Impact v3.0.8, v2.1.2, v1.16.4 and below

Patches Has been patched in 3.0.9, 2.1.3, and 1.16.5

Workarounds You can use the ignore option to ignore non files/directories.

js ignore (, header) { // pass files & directories, ignore e.g. symlinks return header.type !== 'file' && header.type !== 'directory' }

Credit Thank you Caleb Brown from Google Open Source Security Team for reporting this in detail.

Other sources

tar-fs has issue where extract can write outside the specified dir with a specific tarball

Microsoft

tar-fs provides filesystem bindings for tar-stream. Versions prior to 3.0.9, 2.1.3, and 1.16.5 have an issue where an extract can write outside the specified dir with a specific tarball. This has been patched in versions 3.0.9, 2.1.3, and 1.16.5. As a workaround, use the ignore option to ignore non files/directories.

NVD

Affected Software

9 affected componentsFixes available
tar-fs tar-fs<3.0.9, <2.1.3, <1.16.5
npm/tar-fs>=3.0.0<3.0.9
3.0.9
npm/tar-fs>=2.0.0<2.1.3
2.1.3
npm/tar-fs<1.16.5
1.16.5
IBM Business Automation Insights<=25.0.0
IBM Business Automation Insights<=24.0.1
IBM Business Automation Insights<=24.0.0
Microsoft cbl2 reaper 3.1.1-19<3.1.1-19
3.1.1-19
Microsoft cm2 reaper 3.1.1-19<3.1.1-19
3.1.1-19

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/tar-fs to a version that resolves this vulnerability.

    Fixed in 3.0.9
  2. Upgrade

    Upgrade npm/tar-fs to a version that resolves this vulnerability.

    Fixed in 2.1.3
  3. Upgrade

    Upgrade npm/tar-fs to a version that resolves this vulnerability.

    Fixed in 1.16.5
  4. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 3.1.1-19
  5. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 3.0.9
  6. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.1.3
  7. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 1.16.5
  8. Configuration

    As a workaround for versions prior to 3.0.9, 2.1.3, and 1.16.5, configure the tar-fs/tar-stream extraction to use the ignore option to ignore non files/directories, e.g., implement ignore as: return header.type !== 'file' && header.type !== 'directory'.

    tar-fs (tar-stream bindings) ignore option = ignore non files/directories (skip entries where header.type is not 'file' or 'directory')

Event History

Jun 2, 2025
CVE Published
via MITRE·07:20 PM
Data Sourced
via MITRE·07:20 PM
DescriptionWeakness
Data Sourced
via NVD·08:15 PM
DescriptionSeverityWeakness
Jun 3, 2025
Advisory Published
via GitHub·06:14 AM
Jul 11, 2025
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
DescriptionSeverity
Nov 3, 2025
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2025-48387?

CVE-2025-48387 has a moderate severity due to its potential to allow unauthorized file writes outside the specified directory.

2

How do I fix CVE-2025-48387?

To fix CVE-2025-48387, upgrade to tar-fs versions 3.0.9, 2.1.3, or 1.16.5 that contain the patch.

3

What versions are affected by CVE-2025-48387?

CVE-2025-48387 affects tar-fs versions prior to 3.0.9, 2.1.3, and 1.16.5.

4

What is the main issue in CVE-2025-48387?

The main issue in CVE-2025-48387 is that an extract operation can write files outside the intended directory with a malicious tarball.

5

Is there a workaround for CVE-2025-48387?

A temporary workaround for CVE-2025-48387 is to use the ignore option when performing extractions.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203