The vulnerability lies in several bulk renaming views and mixins within Nautobot that use Python's re module for regular expression-based find-and-replace operations. The core of the issue is that the re.sub function was used on user-supplied regular expressions without any timeout mechanism. This makes the application susceptible to Regular Expression Denial of Service (ReDoS) attacks. An attacker could provide a specially crafted regular expression that causes 'catastrophic backtracking', leading to excessive CPU consumption and causing the application to hang or become unresponsive.
The identified vulnerable functions are BulkRenameView.post, ModuleBayCommonViewSetMixin._bulk_rename, and ObjectBulkRenameViewMixin._bulk_rename. These functions are directly involved in processing user-submitted data for bulk renaming operations. The patches for this vulnerability consistently show a shift from using the standard re module to the regex module, which supports a timeout parameter in its substitution function. By wrapping the regex operations in a try...except TimeoutError block and setting a reasonable timeout, the patch ensures that a malicious regex will not be able to tie up server resources indefinitely, thus mitigating the denial of service risk.