CVE-2017-12626: Denial of Service in Apache POI

org.apache.poi:poi Updated 02 Oct 2025

Summary

14/01/2021
Yes i
High
7.5

CVE-2017-12626: Denial of Service in Apache POI. Affects org.apache.poi:poi versions < 3.17. Fixed in 3.17. How to fix ↓

Also tracked for

The same CVE-2017-12626 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Apache POI is a popular Java library used for reading and writing Microsoft Office file formats, such as Word, Excel, and PowerPoint. It provides APIs to manipulate these files programmatically. However, versions prior to release 3.17 are vulnerable to Denial of Service (DoS) attacks. This vulnerability can be exploited through crafted files in various formats, including WMF, EMF, MSG, DOC, PPT, and XLS.

Vulnerability Detail

The vulnerability in Apache POI allows an attacker to trigger Denial of Service attacks. Specifically, there are two main issues:

  1. Infinite Loops: Crafted WMF, EMF, MSG, and macros can cause infinite loops during parsing, leading to resource exhaustion and system unresponsiveness. This is due to POI bugs 61338 and 61294.

  2. Out of Memory Exceptions: Crafted DOC, PPT, and XLS files can trigger Out of Memory Exceptions during parsing, resulting in system crashes or instability. This is caused by POI bugs 52372 and 61295.

These vulnerabilities can be exploited remotely by an attacker who can trick a user into opening a malicious file, potentially leading to a complete denial of service for the affected system.

How To Fix

Minimum fixed version

3.17

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 the latest version of Apache POI is not immediately feasible, a possible workaround is to implement file validation checks before parsing using Apache POI. This can help identify and reject malicious files that could trigger the DoS vulnerabilities. Here's an example in Java:

import org.apache.poi.poifs.filesystem.POIFSFileSystem;

public class FileValidator {

  public static boolean isValidFile(String filePath) {
    try {
      POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(filePath));
      // Perform additional validation checks if needed
      return true;
    } catch (Exception e) {
      return false;
    }
  }

  public static void main(String[] args) {
    String filePath = "path/to/file.doc";
    if (isValidFile(filePath)) {
      // Proceed with parsing and processing the file
    } else {
      // Handle invalid file
    }
  }

}

This code snippet demonstrates a basic file validation check using the POIFSFileSystem class from Apache POI. It attempts to open the file and returns true if the file is valid and can be safely processed. Otherwise, it returns false.

Conclusion

The vulnerability in Apache POI can lead to Denial of Service attacks, causing resource exhaustion, system unresponsiveness, crashes, or instability. To mitigate this risk, it is crucial to upgrade to Apache POI version 3.17 or later. Implementing file validation checks can also provide an additional layer of protection. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.apache.poi:poi →

Share this vulnerability

FAQ

Apache POI is a Java library used for reading and writing Microsoft Office file formats, such as Word, Excel, and PowerPoint. It provides APIs to manipulate these files programmatically.

Versions of Apache POI prior to release 3.17 are vulnerable to Denial of Service attacks.

The vulnerability can be exploited by tricking a user into opening a malicious file in formats such as WMF, EMF, MSG, DOC, PPT, or XLS. This can lead to resource exhaustion, system unresponsiveness, crashes, or instability.

The vulnerability can result in a complete denial of service for the affected system, rendering it unresponsive or causing crashes and instability.

To protect your application, it is recommended to upgrade to Apache POI version 3.17 or later. Additionally, implementing file validation checks before parsing using Apache POI can help identify and reject malicious files.

Related vulnerabilities

Recent vulnerabilities recorded for org.apache.poi:poi.

How To Fix

Minimum fixed version

3.17

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