CVE-2022-27772
Java vulnerability analysis and mitigation

Overview

Spring Boot versions prior to v2.2.11.RELEASE were vulnerable to temporary directory hijacking. This vulnerability specifically impacted the org.springframework.boot.web.server.AbstractConfigurableWebServerFactory.createTempDir method, which is used to create work directories for embedded web servers like Tomcat and Jetty. The vulnerability was discovered and disclosed in March 2022 (GitHub Advisory, NVD).

Technical details

The vulnerability exists due to a race condition in the createTempDir method. The method creates a temporary file, deletes it, and then attempts to create a directory with the same name. However, File.mkdir returns false when it fails to create a directory without throwing an exception, allowing an attacker to exploit the time window between file deletion and directory creation. The vulnerability has been assigned a CVSS v3.1 base score of 7.8 (High) with the vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H (NVD).

Impact

If successfully exploited, a local attacker with permission to write in the temporary directory could completely take over the application, leading to local privilege escalation. The directory contains sensitive configuration files, JSP/class files, and other critical application components. This vulnerability primarily impacts Unix-like systems and older versions of Mac OSX and Windows that share the system temporary directory between all users (GitHub Advisory).

Mitigation and workarounds

The vulnerability was fixed in Spring Boot version v2.2.11.RELEASE. For users unable to upgrade, a workaround is available by setting the java.io.tmpdir system environment variable to a directory that is exclusively owned by the executing user (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Java vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-52472CRITICAL9.3
  • JavaJava
  • org.xwiki.platform:xwiki-platform-rest-server
NoYesOct 06, 2025
CVE-2025-49594CRITICAL9.2
  • JavaJava
  • org.xwiki.contrib.oidc:oidc-authenticator
NoYesOct 06, 2025
CVE-2025-61735HIGH7.3
  • JavaJava
  • org.apache.kylin:kylin-core-metadata
NoYesOct 02, 2025
CVE-2025-43824MEDIUM4.8
  • JavaJava
  • com.liferay.portal:release.portal.bom
NoYesOct 06, 2025
CVE-2025-43825MEDIUM4.6
  • JavaJava
  • com.liferay:com.liferay.portal.template.freemarker
NoYesOct 03, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management