Nick Shanin created SOLR-18657:
----------------------------------

             Summary: Harden DOM parsing in the Solr post command
                 Key: SOLR-18657
                 URL: https://issues.apache.org/jira/browse/SOLR-18657
             Project: Solr
          Issue Type: Improvement
            Reporter: Nick Shanin


The Solr post command uses PostTool.makeDom to parse the extraction response 
and its embedded markup when discovering links during a recursive web crawl. 
makeDom currently creates a default DocumentBuilderFactory without explicitly 
restricting external entity or DTD processing.

A focused test that passes crafted XML directly to makeDom observed expansion 
of an external entity containing a temporary file marker. This demonstrates the 
parser behavior in isolation; it does not establish that a normal crawled 
webpage can deliver such XML through the extraction path. In a separate 
controlled test using Tika Server 3.2.3, the tested HTML entity was escaped and 
no marker appeared in the returned markup. The full configured container 
integration was not exercised.

As defense in depth, configure the DOM parser to prevent external resource 
resolution, and add focused tests for file and HTTP entities alongside coverage 
that ordinary extracted markup and link discovery still work. Consider whether 
rejecting all DOCTYPE declarations is compatible with the input this command 
needs to handle.

AI assistance was used to investigate and draft this issue; the findings and 
proposed change need maintainer review.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to