Skip to content

💡Idea of methods to add. #1

Description

@righettod

Ideas

  • Add support for the detection of XFA form in a PDF file to detect attack like CVE-2025-54988.

References

import org.apache.pdfbox.Loader;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDDocumentCatalog;
import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm;

File filePath = new File("doc-pdf-with-xxe-in-xfa-form.pdf");
try (PDDocument document = Loader.loadPDF(filePath)) {
	PDDocumentCatalog catalog = document.getDocumentCatalog();
	PDAcroForm acroForm = catalog.getAcroForm();
	boolean hasForm  = (acroForm != null && acroForm.getXFA() != null);
	System.out.println(hasForm);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions