How can I use XPath syntax to match a SOAP/XML node in MetaDefender ICAP Server?

This article applies to MetaDefender ICAP Server deployments on Windows and Linux, version 5.11.0 and later.

Overview

Starting from MetaDefender ICAP Server 5.11.0, an XPath-based node matching option is available for SOAP/XML extraction. It enables the ICAP Server to locate and extract nodes by name only, without needing the full XML node path.

Standard Path Matching

Before version 5.11.0, ICAP Server required the exact XML path to locate nodes in SOAP/XML messages.

For example, with the XML below:

XML
Copy

To match the Base64 data content, users needed to configure the full node path as below:

Copy

XPath Matching

From version 5.11.0, ICAP Server adds support for XPath-based node matching,which allows node selection regardless of depth or namespace.

Example:

  • Query type: XPath
  • Node selector: //Data

With this, ICAP Server automatically matches any <Data> node appearing in the XML structure.

The Base64 data or attachments can then be sent to MetaDefender Core for scanning, further enhancing the ICAP and Core capabilities to detect and prevent malicious content. In the sample XML path, this allows the system to identify and block the EICAR test file contained within the XML structure.

Known Limitations

  • XPath Node Matching is supported only for SOAP/XML extraction.
  • Only the // XPath syntax is supported. Other syntax types such as .. or @ are not supported.
  • ICAP can extract nodes only if they do not contain nested nodes.
    • With the above XML as example:
      • If the selector is //Data, ICAP can extract the node content.
      • If the selector is //Content (which contains the Data node), ICAP cannot extract the content.

If Further Assistance is required, please proceed to log a support case or chatting with our support engineer.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard