CVE-2025-54988: Apache Tika - XXE Injection

2026-07-31 Apache Tika PoC Public

Description

Apache Tika versions 1.13 through 3.2.1 are vulnerable to XXE via malicious XFA in PDFs, allowing file read and SSRF attacks.

PoC

id: CVE-2025-54988

info:
  name: Apache Tika - XXE Injection
  author: tx1ee
  severity: critical
  description: |
    Apache Tika versions 1.13 through 3.2.1 are vulnerable to XXE via malicious XFA in PDFs, allowing file read and SSRF attacks.
  impact: |
    An attacker can read sensitive server files or perform SSRF attacks against internal infrastructure.
  remediation: |
    Upgrade to Apache Tika 3.2.2 or later.
  reference:
    - https://lists.apache.org/thread/8xn3rqy6kz5b3l1t83kcofkw0w4mmj1w
    - https://lists.debian.org/debian-lts-announce/2025/10/msg00030.html
    - https://nvd.nist.gov/vuln/detail/CVE-2025-54988
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
    epss-score: 0.37713
    epss-percentile: 0.98462
    cwe-id: CWE-611
  metadata:
    verified: true
    max-request: 4
    vendor: apache
    product: tika
    shodan-query: title:"Apache Tika"
    fofa-query: title="Apache Tika"
  tags: cve,cve2025,apache,tika,xxe,ssrf,vuln

flow: http(1) && http(2)

http:
  - method: GET
    path:
      - "{{BaseURL}}/"
      - "{{BaseURL}}/tika"

    stop-at-first-match: true
    redirects: true

    matchers-condition: and
    matchers:
      - type: word
        words:
          - 'Apache Tika'
          - 'This is Tika'
        condition: or
        internal: true

    extractors:
      - type: regex
        part: body
        regex:
          - "Apache Tika [0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}"
          - "Apache Tika v?([0-9]+\\.[0-9]+\\.[0-9]+)"

  - method: PUT
    path:
      - "{{BaseURL}}/tika"

    headers:
      Accept: text/plain
      Content-Type: application/pdf
      X-Tika-PDFextractInlineImages: "true"
      X-Tika-PDFextractMarkedContent: "true"

    body: |
      %PDF-1.4
      1 0 obj<</Type/Catalog/Pages 2 0 R>>endobj
      2 0 obj<</Type/Pages/Kids[3 0 R]/Count 1>>endobj
      3 0 obj<</Type/Page/Parent 2 0 R/MediaBox[0 0 612 792]
      /Contents 4 0 R/Resources<<>>>>endobj
      4 0 obj<</Length 44>>
      stream
      BT /F1 12 Tf 100 700 Td ({{randstr}}) Tj ET
      endstream
      endobj
      xref
      0 5
      0000000000 65535 f
      0000000009 00000 n
      0000000058 00000 n
      0000000115 00000 n
      0000000214 00000 n
      trailer<</Size 5/Root 1 0 R>>
      startxref
      307
      %%EOF

    matchers:
      - type: dsl
        dsl:
          - status_code == 200 || status_code == 201
          - contains(body, "{{randstr}}")
          - contains(header,"text/plain")
        condition: and
# digest: 4a0a0047304502207ad833e9a0b939d331ec1fd8aa341ee8548cfbf5416060dcf966e1146e9f9a8f022100beb56b75d3350a810958ddd26c9d3d83da8a00f87d5376ec236c3b0f138baf62:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

References

Related Vulnerabilities