CVE-2013-2186: Arbitrary file write in Apache Commons Fileupload

Summary

14/05/2022
Yes i
High
Not published

CVE-2013-2186: Arbitrary file write in Apache Commons Fileupload. Affects commons-fileupload:commons-fileupload versions < 1.3.1. Fixed in 1.3.1. How to fix ↓

Also tracked for

The same CVE-2013-2186 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

Apache Commons FileUpload is a popular Java library used for uploading files in web applications. It provides a simple API for handling file uploads and is widely used in various frameworks and applications. However, a vulnerability has been discovered in the DiskFileItem class of Apache Commons FileUpload, which allows remote attackers to write to arbitrary files by exploiting a NULL byte in a file name in a serialized instance. This vulnerability affects multiple versions of Red Hat JBoss BRMS, JBoss Portal, and Red Hat JBoss Web Server.

Vulnerability Detail

The vulnerability arises from a failure to properly sanitize file names during file upload. By including a NULL byte in the file name, an attacker can manipulate the serialization process and write files to arbitrary locations on the server. This can lead to unauthorized access, data leakage, or even remote code execution depending on the context in which the uploaded files are used.

How To Fix

Minimum fixed version

1.3.1

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

If upgrading to a fixed version is not immediately feasible, a possible workaround is to implement additional validation and sanitization checks on file names during file upload. This can involve rejecting file names that contain NULL bytes or other potentially malicious characters. However, this workaround is not foolproof and should only be considered as a temporary measure until the library can be updated.

Conclusion

The vulnerability in Apache Commons FileUpload can allow remote attackers to write to arbitrary files on the server, potentially leading to unauthorized access or remote code execution. It is crucial to upgrade to a fixed version of the library (1.3.1 or later) or implement appropriate workarounds to mitigate the risk. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for commons-fileupload:commons-fileupload →

Share this vulnerability

FAQ

Apache Commons FileUpload is a Java library used for handling file uploads in web applications. It provides an easy-to-use API for developers to process and store uploaded files.

This vulnerability allows remote attackers to write to arbitrary files on the server. Depending on the context, this can lead to unauthorized access, data leakage, or even remote code execution.

The vulnerability affects versions of Apache Commons FileUpload prior to 1.3.1.

While specific exploits for this vulnerability may exist, they have not been disclosed publicly at the time of this report. However, it is important to patch the vulnerability as soon as possible to prevent potential attacks.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply upload your pom.xml file and Vulert will analyze it for any known vulnerabilities, including this one.

Related vulnerabilities

Recent vulnerabilities recorded for commons-fileupload:commons-fileupload.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

1.3.1

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