CVE-2025-58157: Gnark Quorem Truncation Division And Aliasing

The QuoRem implementation performs division via truncation (using `Div`) instead of symmetric rounding. This mathematically violates the Euclidean domain property, leading to infinite loops in Half-GCD operations (Denial of Service). Additionally, mutating the receiver `z` early before completion can lead to aliasing bugs if it points to the same memory as t

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Go
greprules fetch cve-2025-58157-gnark-quorem-truncation-division-and-aliasing --engine opengrep

Description

The QuoRem implementation performs division via truncation (using `Div`) instead of symmetric rounding. This mathematically violates the Euclidean domain property, leading to infinite loops in Half-GCD operations (Denial of Service). Additionally, mutating the receiver `z` early before completion can lead to aliasing bugs if it points to the same memory as t