Commit cff7d0c0d for clamav.net
commit cff7d0c0d191b3c879a1bf75ce94e0a13bc224ba
Author: GitHubArchive\Val S. <218006698+val-ms@users.noreply.github.com>
Date: Fri Nov 20 19:00:37 2026 -0500
libclamav: Enforce OLE2 property recursion limit
OLE2 file properties may reference child properties. The file-child traversal did not increment rec_level, allowing a long acyclic chain to bypass MaxRecursion and exhaust the native stack.
Increment the recursion level for file children, matching root and directory child traversal so every recursive edge is bounded.
Reported by Nebula Security.
CLAM-3071
diff --git a/libclamav/ole2_extract.c b/libclamav/ole2_extract.c
index ccb3fb19c..ce60b1921 100644
--- a/libclamav/ole2_extract.c
+++ b/libclamav/ole2_extract.c
@@ -1044,7 +1044,7 @@ static int ole2_walk_property_tree(ole2_header_t *hdr, const char *dir, int32_t
cli_dbgmsg("OLE2: filesize exceeded\n");
}
if ((int)(prop_block[idx].child) != -1) {
- ret = ole2_walk_property_tree(hdr, dir, prop_block[idx].child, handler, rec_level, file_count, ctx, scansize, handler_ctx, pEncryptionStatus);
+ ret = ole2_walk_property_tree(hdr, dir, prop_block[idx].child, handler, rec_level + 1, file_count, ctx, scansize, handler_ctx, pEncryptionStatus);
if (ret != CL_SUCCESS) {
ole2_list_delete(&node_list);
return ret;