1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

xinclude: Expand comment about fuzz timeouts

This commit is contained in:
Nick Wellnhofer
2023-09-30 15:47:46 +02:00
parent fa48187304
commit 80a0580f23

View File

@@ -1841,6 +1841,20 @@ xmlXIncludeExpandNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
* The XInclude engine offers no protection against exponential
* expansion attacks similar to "billion laughs". Avoid timeouts by
* limiting the total number of replacements when fuzzing.
*
* Unfortuately, a single XInclude can already result in quadratic
* behavior:
*
* <doc xmlns:xi="http://www.w3.org/2001/XInclude">
* <xi:include xpointer="xpointer(//e)"/>
* <e>
* <e>
* <e>
* <!-- more nested elements -->
* </e>
* </e>
* </e>
* </doc>
*/
if (ctxt->incTotal >= 20)
return(NULL);