Skip to content
CVE IDCVE-2020-15250GitHub advisory IDGHSA-269g-pwp5-87pp

TemporaryFolder on unix-like systems does not limit access to created files

CVE-2020-15250 (GitHub advisory GHSA-269g-pwp5-87pp) is a medium-severity vulnerability with a CVSS 3.1 base score of 4.4, classed as Exposure of Sensitive Information to an Unauthorized Actor (CWE-200), in junit:junit (Maven). Affected versions: >= 4.7, < 4.13.1. It is fixed in 4.13.1.

Medium4.4Fix availableGitHub reviewed

Published 12 Oct 2020Updated 4 Aug 2024

4.4MediumCVSS 3.1
EPSS
1.69%higher than 75% of CVEs
Weaknesses (CWE)
  • CWE-200Exposure of Sensitive Information to an Unauthorized Actor
  • CWE-732Incorrect Permission Assignment for Critical Resource
KEV status
Not in KEV
Published
12 Oct 2020
Updated
4 Aug 2024
Ecosystem
  • Maven
Assigned by (CNA)
GitHub_M

Summary

Source: OSV (GitHub advisory)

Vulnerability

The JUnit4 test rule TemporaryFolder contains a local information disclosure vulnerability.

Example of vulnerable code:

public static class HasTempFolder {
    @Rule
    public TemporaryFolder folder = new TemporaryFolder();

    @Test
    public void testUsingTempFolder() throws IOException {
        folder.getRoot(); // Previous file permissions: `drwxr-xr-x`; After fix:`drwx------`
        File createdFile= folder.newFile("myfile.txt"); // unchanged/irrelevant file permissions
        File createdFolder= folder.newFolder("subfolder"); // unchanged/irrelevant file permissions
        // ...
    }
}

Impact

On Unix like systems, the system's temporary directory is shared between all users on that system. Because of this, when files and directories are written into this directory they are, by default, readable by other users on that same system.

This vulnerability does not allow other users to overwrite the contents of these directories or files. This is purely an information disclosure vulnerability.

When analyzing the impact of this vulnerability, here are the important questions to ask:

  1. Do the JUnit tests write sensitive information, like API keys or passwords, into the temporary folder?
    • If yes, this vulnerability impacts you, but only if you also answer 'yes' to question 2.
    • If no, this vulnerability does not impact you.
  2. Do the JUnit tests ever execute in an environment where the OS has other untrusted users. This may apply in CI/CD environments but normally won't be 'yes' for personal developer machines.
    • If yes, and you answered 'yes' to question 1, this vulnerability impacts you.
    • If no, this vulnerability does not impact you.

Patches

Because certain JDK file system APIs were only added in JDK 1.7, this this fix is dependent upon the version of the JDK you are using.

  • Java 1.7 and higher users: this vulnerability is fixed in 4.13.1.
  • Java 1.6 and lower users: no patch is available, you must use the workaround below.

Workarounds

If you are unable to patch, or are stuck running on Java 1.6, specifying the java.io.tmpdir system environment variable to a directory that is exclusively owned by the executing user will fix this vulnerability.

References

Similar Vulnerabilities

For more information

If you have any questions or comments about this advisory, please pen an issue in junit-team/junit4.

Technical details

Source: GitHub Advisory Database

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

Medium4.4Base score from GitHub Advisory Database

Attack Vector AV
Local
Attack Complexity AC
High
Privileges Required PR
Low
User Interaction UI
Required
Scope S
Unchanged
Confidentiality C
High
Integrity I
None
Availability A
None

Affected packages

Source: OSV (GitHub advisory)

  • junit:junit
    Maven
    pkg:maven/junit/junit
    Affected versions
    >= 4.7, < 4.13.1
    Fixed in
    4.13.1
    Show 18 listed versions
    • 4.10
    • 4.11
    • 4.11-beta-1
    • 4.12
    • 4.12-beta-1
    • 4.12-beta-2
    • 4.12-beta-3
    • 4.13
    • 4.13-beta-1
    • 4.13-beta-2
    • 4.13-beta-3
    • 4.13-rc-1

Fix

Source: OSV (GitHub advisory)

Fix available

Upgrade to 4.13.1 or later.

Patch commits

  • 610155bPatch commitgithub.com/junit-team/junit4

    Merge pull request from GHSA-269g-pwp5-87pp

    +78 −2 across 2 files

    • src/main/java/org/junit/rules/TemporaryFolder.java+42 −1
    • src/test/java/org/junit/rules/TempFolderRuleTest.java+36 −1

Release commits

The commits each fixed release tag points at. They usually bump the version rather than contain the fix itself.

  • 1b683f4Release commit4.13.1github.com/junit-team/junit4

Vulnerability intelligence

References

Credits

Questions about CVE-2020-15250

What is the GHSA ID for CVE-2020-15250?
GitHub tracks CVE-2020-15250 as GHSA-269g-pwp5-87pp.
What is the CVSS score of CVE-2020-15250?
CVE-2020-15250 has a CVSS 3.1 base score of 4.4 (Medium), vector CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:N/A:N. Other published scores: CVSS 3.1 5.5.
Which versions are affected by CVE-2020-15250?
junit:junit (Maven): >= 4.7, < 4.13.1.
How do I fix CVE-2020-15250?
Upgrade to 4.13.1 or later. The fix is in commit 610155b.
What is the Package URL (PURL) for CVE-2020-15250?
The affected package's PURL is pkg:maven/junit/junit.
Is CVE-2020-15250 exploited in the wild?
CISA's Known Exploited Vulnerabilities catalog doesn't list CVE-2020-15250. That means no confirmed exploitation has been catalogued, not that it is safe to leave unpatched. EPSS estimates a 1.69% chance of exploitation in the next 30 days, higher than 75% of CVEs.

Data sources

Upstream records

  • OSV (GitHub advisory)LoadedRaw JSON
  • GitHub Advisory DatabaseLoadedRaw JSON
  • OSV (CVE record)LoadedRaw JSON
  • CVE.orgLoaded
  • CISA KEV catalogLoaded

Fetched 2 days ago (13 Oct 2026, 13:31 UTC). Records refresh automatically after 24 hours.

Where each part of this page came from

Title and description
OSV (GitHub advisory)
Severity score
GitHub Advisory Database
Weakness (CWE)
GitHub Advisory Database
Affected packages
OSV (GitHub advisory)
Fix
OSV (GitHub advisory)
References
Computed by CVEminer
KEV status
CISA KEV catalog
EPSS
GitHub Advisory Database

OSV and GitHub Advisory Database content is licensed CC BY 4.0. Values marked as computed or derived were calculated by CVEminer from the upstream data.