CVE-2022-24913: Java Merge-sort Insecure Temporary File vulnerability in com.fasterxml.util:java-merge-sort

Summary

12/01/2023
Yes i
Moderate
5.5

CVE-2022-24913: Java Merge-sort Insecure Temporary File vulnerability. Affects com.fasterxml.util:java-merge-sort versions < 1.1.0. Fixed in 1.1.0. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The package com.fasterxml.util:java-merge-sort is a Java library that provides merge-sort functionality. It is commonly used in applications that require sorting large datasets efficiently. This package uses temporary files during the sorting process to store intermediate results. However, versions before 1.1.0 are vulnerable to an Insecure Temporary File issue in the StdTempFileProvider() function in StdTempFileProvider.java. This function uses the permissive File.createTempFile() function, which exposes the contents of temporary files.

Vulnerability Detail

The Insecure Temporary File vulnerability in com.fasterxml.util:java-merge-sort allows an attacker to access the contents of temporary files created during the sorting process. This can lead to unauthorized disclosure of sensitive information stored in these files. The vulnerability arises from the use of the permissive File.createTempFile() function, which does not enforce proper file permissions. An attacker with local access to the system can exploit this vulnerability to read the temporary file contents and potentially extract sensitive data.

How To Fix

Minimum fixed version

1.1.0

This is the first release that contains the fix.

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

Workaround

As a temporary workaround, users can manually modify the code in StdTempFileProvider.java to use a more secure method for creating temporary files. One possible approach is to use the Files.createTempFile() method from the Java NIO API, which provides better control over file permissions. Here is an example of the modified code:

import java.nio.file.Files;
import java.nio.file.Path;

public class StdTempFileProvider {
  public File createTempFile() throws IOException {
    Path tempFilePath = Files.createTempFile(null, null);
    return tempFilePath.toFile();
  }
}

Conclusion

The Insecure Temporary File vulnerability in com.fasterxml.util:java-merge-sort exposes the contents of temporary files, potentially leading to unauthorized disclosure of sensitive information. To mitigate this vulnerability, it is recommended to upgrade to version 1.1.0 or later. A temporary workaround is also available by modifying the code in StdTempFileProvider.java. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for com.fasterxml.util:java-merge-sort →

Share this vulnerability

FAQ

This vulnerability allows an attacker with local access to the system to read the contents of temporary files created during the sorting process. This can potentially lead to unauthorized disclosure of sensitive information stored in these files.

No, only versions before 1.1.0 are affected. It is recommended to upgrade to version 1.1.0 or later to mitigate the vulnerability.

Yes, a temporary workaround is to modify the code in StdTempFileProvider.java to use a more secure method for creating temporary files, such as Files.createTempFile() from the Java NIO API. Please refer to the 'workaround' section for an example.

Yes, the vulnerability has been fixed in version 1.1.0 of com.fasterxml.util:java-merge-sort. It is recommended to upgrade to this version or later.

How To Fix

Minimum fixed version

1.1.0

This is the first release that contains the fix.

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