VYPR
Moderate severityNVD Advisory· Published Feb 17, 2023· Updated Mar 18, 2025

CVE-2023-0482

CVE-2023-0482

Description

In RESTEasy the insecure File.createTempFile() is used in the DataSourceProvider, FileProvider and Mime4JWorkaround classes which creates temp files with insecure permissions that could be read by a local user.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
org.jboss.resteasy:resteasy-coreMaven
>= 6.0.0.Beta1, < 6.2.3.Final6.2.3.Final
org.jboss.resteasy:resteasy-coreMaven
>= 5.0.0.Alpha1, < 5.0.6.Final5.0.6.Final
org.jboss.resteasy:resteasy-coreMaven
>= 4.0.0.Beta1, < 4.7.8.Final4.7.8.Final
org.jboss.resteasy:resteasy-multipart-providerMaven
>= 6.0.0.Beta1, < 6.2.3.Final6.2.3.Final
org.jboss.resteasy:resteasy-multipart-providerMaven
>= 5.0.0.Alpha1, < 5.0.6.Final5.0.6.Final
org.jboss.resteasy:resteasy-multipart-providerMaven
>= 4.0.0.Beta1, < 4.7.8.Final4.7.8.Final
org.jboss.resteasy:resteasy-multipart-providerMaven
< 3.15.5.Final3.15.5.Final
org.jboss.resteasy:resteasy-coreMaven
< 3.15.5.Final3.15.5.Final

Affected products

3

Patches

Vulnerability mechanics

Root cause

"Use of `File.createTempFile()` instead of `Files.createTempFile()` creates temporary files with insecure default permissions that can be read by other local users."

Attack vector

A local attacker on the same system can read temporary files created by RESTEasy during request processing because `File.createTempFile()` does not enforce restrictive permissions [CWE-378]. When RESTEasy processes multipart uploads, file downloads, or DataSource content, it writes data to temporary files that may be readable by other local users. The attacker only needs local shell access to the host and does not require any network-based authentication bypass. No special configuration is needed beyond the default RESTEasy setup.

Affected code

The vulnerability exists in `DataSourceProvider.java`, `FileProvider.java`, and `Mime4JWorkaround.java` within the RESTEasy framework. These classes used `File.createTempFile()` which creates temporary files with default (often world-readable) permissions. The patches replace these calls with `Files.createTempFile()` from the NIO API, which applies more restrictive permissions by default [patch_id=6636833][patch_id=6636834][patch_id=6636837].

What the fix does

The patches replace `File.createTempFile()` with `java.nio.file.Files.createTempFile()` in `DataSourceProvider`, `FileProvider`, and `Mime4JWorkaround` [patch_id=6636833][patch_id=6636834][patch_id=6636837]. The NIO `Files.createTempFile()` creates temporary files with more restrictive permissions (owner-only read/write on POSIX systems) compared to the legacy `File.createTempFile()`, which could leave files world-readable. Additionally, the patches replace `FileInputStream`/`FileOutputStream` with `Files.newInputStream()`/`Files.newOutputStream()` and update the `TempFileCleanable` and `FileHolder` cleanup classes to use `Files.deleteIfExists()` instead of `File.delete()`. The advisory does not specify any other remediation steps beyond applying these patches.

Preconditions

  • authThe attacker must have local user access to the same operating system where RESTEasy is running.
  • inputRESTEasy must process a request that triggers temporary file creation (e.g., multipart upload, file download, or DataSource content).

Generated on Jun 20, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

13

News mentions

0

No linked articles in our index yet.