Description
Uncontrolled recursion in XPath evaluation in libxml2 up to and including version 2.9.14 allows a local attacker to cause a stack overflow via crafted expressions. XPath processing functions `xmlXPathRunEval`, `xmlXPathCtxtCompile`, and `xmlXPathEvalExpr` were resetting recursion depth to zero before making potentially recursive calls. When such functions were called recursively this could allow for uncontrolled recursion and lead to a stack overflow. These functions now preserve recursion depth across recursive calls, allowing recursion depth to be controlled.
Problem types
CWE-674 Uncontrolled Recursion
Product status
Any version before 2.10.0
Any version before 2.12.7+dfsg+really2.9.14-0.4ubuntu0.3
Any version before 2.9.14+dfsg-1.3ubuntu3.5
Any version before 2.9.13+dfsg-1ubuntu0.9
Any version before 2.9.10+dfsg-5ubuntu0.20.04.10+esm2
Any version before 2.9.4+dfsg1-6.1ubuntu1.9+esm5
Any version before 2.9.3+dfsg1-1ubuntu0.7+esm10
Any version before 2.9.1+dfsg1-3ubuntu4.13+esm9
Credits
Nikita Sveshnikov (Positive Technologies)
References
gitlab.gnome.org/...677a42645ef22b5a50741bad5facf9d8a8bc6d21