CVE-2018-10862: Improper Limitation of a Pathname to a Restricted Directory in WildFly

Summary

14/05/2022
Yes i
Moderate
5.5

CVE-2018-10862: Improper Limitation of a Pathname to a Restricted Directory in WildFly. Affects org.wildfly.core:wildfly-server versions < 6.0.0.Alpha3. Fixed in 6.0.0.Alpha3. 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

WildFly Core is a Java-based application server that provides a runtime environment for Java applications. It offers features such as clustering, load balancing, and management capabilities. The WildFly Core package, specifically the 'wildfly-server' component, is affected by a vulnerability that allows for the extraction of crafted .war archives to overwrite arbitrary files. This vulnerability is known as 'Zip Slip' and can lead to unauthorized access, data loss, or the execution of arbitrary code.

Vulnerability Detail

The vulnerability in WildFly Core arises from the improper validation of file paths in .war archives. Attackers can exploit this flaw by creating a specially crafted .war archive that contains file paths with '../' sequences. When the archive is extracted, these sequences can traverse directories and overwrite arbitrary files outside the intended extraction directory. This can result in the modification or deletion of critical system files, leading to a compromise of the server's integrity and confidentiality. The 'Zip Slip' vulnerability is a well-known issue in archive extraction libraries and can have severe consequences if not addressed.

How To Fix

Minimum fixed version

6.0.0.Alpha3

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 implement a file path validation mechanism during the extraction of .war archives. This mechanism should check for any '../' sequences in the extracted file paths and reject or sanitize them to prevent directory traversal. Here is an example of a Java code snippet that demonstrates this workaround:

import java.nio.file.Path;
import java.nio.file.Paths;

public class WarArchiveExtractor {
  public static void extractWarArchive(String archivePath, String extractionPath) {
    // Perform initial extraction
    // ...

    // Validate extracted file paths
    Path extractedPath = Paths.get(extractionPath);
    if (!extractedPath.normalize().startsWith(Paths.get(extractionPath).normalize())) {
      throw new SecurityException("Invalid file path detected. Extraction aborted.");
    }

    // Continue with further processing
    // ...
  }
}

Conclusion

The vulnerability in WildFly Core allows for the extraction of crafted .war archives to overwrite arbitrary files, leading to unauthorized access, data loss, or the execution of arbitrary code. It is crucial to update the WildFly Core package to version 6.0.0.Alpha3 or later to mitigate this vulnerability. Implementing a file path validation mechanism during archive extraction can serve as a temporary workaround. For further assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.wildfly.core:wildfly-server →

Share this vulnerability

FAQ

WildFly Core is a Java-based application server that provides a runtime environment for Java applications. It offers features such as clustering, load balancing, and management capabilities.

This vulnerability allows attackers to overwrite arbitrary files on the server by exploiting the improper validation of file paths in .war archives. This can lead to unauthorized access, data loss, or the execution of arbitrary code.

'Zip Slip' is a well-known vulnerability that affects archive extraction libraries. It allows attackers to traverse directories and overwrite arbitrary files outside the intended extraction directory by using specially crafted archive files.

To fix this vulnerability, update the WildFly Core package to version 6.0.0.Alpha3 or later. This version includes proper validation of file paths in .war archives, preventing the traversal of directories and overwriting of arbitrary files.

As a temporary workaround, you can implement a file path validation mechanism during the extraction of .war archives. This mechanism should check for any '../' sequences in the extracted file paths and reject or sanitize them to prevent directory traversal.

Related vulnerabilities

Recent vulnerabilities recorded for org.wildfly.core:wildfly-server.

How To Fix

Minimum fixed version

6.0.0.Alpha3

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

Follow Vulert in Google

Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.