CVE-2026-47125: Go Env File Write Without Key Regex Validation

User-supplied environment variable keys are persisted (e.g. to a .env file) after being normalized only with strings.TrimSpace, without being validated against a strict POSIX env-name pattern such as `^[A-Za-z_][A-Za-z0-9_]*$`. A key containing a newline or `=` allows arbitrary additional `KEY=VALUE` lines to be injected into the destination file, which comb

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Go
greprules fetch cve-2026-47125-go-env-file-write-without-key-regex-validation --engine opengrep

Description

User-supplied environment variable keys are persisted (e.g. to a .env file) after being normalized only with strings.TrimSpace, without being validated against a strict POSIX env-name pattern such as `^[A-Za-z_][A-Za-z0-9_]*$`. A key containing a newline or `=` allows arbitrary additional `KEY=VALUE` lines to be injected into the destination file, which comb