CVE-2024-28860: Slice Parameter Concurrent Mutation Append

Appending directly to a slice parameter might modify its underlying array in-place if capacity > length. In a concurrent context, this causes data races and memory corruption (e.g., cryptographic keys). Allocate a new slice using `make`, then copy or append the parameter's contents into it.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Go
greprules fetch cve-2024-28860-slice-parameter-concurrent-mutation-append --engine opengrep

Description

Appending directly to a slice parameter might modify its underlying array in-place if capacity > length. In a concurrent context, this causes data races and memory corruption (e.g., cryptographic keys). Allocate a new slice using `make`, then copy or append the parameter's contents into it.