Moderate severityNVD Advisory· Published Mar 29, 2024· Updated Aug 12, 2024
Elasticsearch Uncaught Exception
CVE-2024-23449
Description
An uncaught exception in Elasticsearch >= 8.4.0 and < 8.11.1 occurs when an encrypted PDF is passed to an attachment processor through the REST API. The Elasticsearch ingest node that attempts to parse the PDF file will crash. This does not happen with password-protected PDF files or with unencrypted PDF files.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.elasticsearch:elasticsearchMaven | >= 8.4.0, < 8.11.1 | 8.11.1 |
Affected products
1- Range: 8.4.0
Patches
2f9bf18a71661Improving tika PDF handling (#101486) (#101520)
4 files changed · +29 −1
docs/changelog/101486.yaml+5 −0 added@@ -0,0 +1,5 @@ +pr: 101486 +summary: Improving tika handling +area: Ingest Node +type: bug +issues: []
modules/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/TikaImpl.java+9 −0 modified@@ -107,6 +107,15 @@ static String parse(final byte content[], final Metadata metadata, final int lim } else { throw new AssertionError(cause); } + } catch (LinkageError e) { + if (e.getMessage().contains("bouncycastle")) { + /* + * Elasticsearch does not ship with bouncycastle. It is only used for public-key-encrypted PDFs, which this module does + * not support anyway. + */ + throw new RuntimeException("document is encrypted", e); + } + throw new RuntimeException(e); } }
modules/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorTests.java+15 −1 modified@@ -243,11 +243,25 @@ public void testVisioIsExcluded() throws Exception { assertThat(attachmentData.get("content_length"), is(0L)); } - public void testEncryptedPdf() throws Exception { + public void testEncryptedWithPasswordPdf() throws Exception { + /* + * This tests that a PDF that has been encrypted with a password fails in the way expected + */ ElasticsearchParseException e = expectThrows(ElasticsearchParseException.class, () -> parseDocument("encrypted.pdf", processor)); assertThat(e.getDetailedMessage(), containsString("document is encrypted")); } + public void testEncryptedWithKeyPdf() throws Exception { + /* + * This tests that a PDF that has been encrypted with a public key fails in the way expected + */ + ElasticsearchParseException e = expectThrows( + ElasticsearchParseException.class, + () -> parseDocument("encrypted-with-key.pdf", processor) + ); + assertThat(e.getDetailedMessage(), containsString("document is encrypted")); + } + public void testHtmlDocument() throws Exception { Map<String, Object> attachmentData = parseDocument("htmlWithEmptyDateMeta.html", processor);
modules/ingest-attachment/src/test/resources/org/elasticsearch/ingest/attachment/test/sample-files/encrypted-with-key.pdf+0 −0 added
a59180459a3cImproving tika PDF handling (#101486)
4 files changed · +29 −1
docs/changelog/101486.yaml+5 −0 added@@ -0,0 +1,5 @@ +pr: 101486 +summary: Improving tika handling +area: Ingest Node +type: bug +issues: []
modules/ingest-attachment/src/main/java/org/elasticsearch/ingest/attachment/TikaImpl.java+9 −0 modified@@ -107,6 +107,15 @@ static String parse(final byte content[], final Metadata metadata, final int lim } else { throw new AssertionError(cause); } + } catch (LinkageError e) { + if (e.getMessage().contains("bouncycastle")) { + /* + * Elasticsearch does not ship with bouncycastle. It is only used for public-key-encrypted PDFs, which this module does + * not support anyway. + */ + throw new RuntimeException("document is encrypted", e); + } + throw new RuntimeException(e); } }
modules/ingest-attachment/src/test/java/org/elasticsearch/ingest/attachment/AttachmentProcessorTests.java+15 −1 modified@@ -243,11 +243,25 @@ public void testVisioIsExcluded() throws Exception { assertThat(attachmentData.get("content_length"), is(0L)); } - public void testEncryptedPdf() throws Exception { + public void testEncryptedWithPasswordPdf() throws Exception { + /* + * This tests that a PDF that has been encrypted with a password fails in the way expected + */ ElasticsearchParseException e = expectThrows(ElasticsearchParseException.class, () -> parseDocument("encrypted.pdf", processor)); assertThat(e.getDetailedMessage(), containsString("document is encrypted")); } + public void testEncryptedWithKeyPdf() throws Exception { + /* + * This tests that a PDF that has been encrypted with a public key fails in the way expected + */ + ElasticsearchParseException e = expectThrows( + ElasticsearchParseException.class, + () -> parseDocument("encrypted-with-key.pdf", processor) + ); + assertThat(e.getDetailedMessage(), containsString("document is encrypted")); + } + public void testHtmlDocument() throws Exception { Map<String, Object> attachmentData = parseDocument("htmlWithEmptyDateMeta.html", processor);
modules/ingest-attachment/src/test/resources/org/elasticsearch/ingest/attachment/test/sample-files/encrypted-with-key.pdf+0 −0 added
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-pw39-f3m5-cxfcghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-23449ghsaADVISORY
- discuss.elastic.co/t/elasticsearch-8-11-1-security-update-esa-2024-05/356458ghsaWEB
- github.com/elastic/elasticsearch/commit/a59180459a3cb30b71399d778943cab4ac2191c4ghsaWEB
- github.com/elastic/elasticsearch/commit/f9bf18a716613473fc1cb96c838874e1f9f6ba22ghsaWEB
News mentions
0No linked articles in our index yet.