CVE-2025-30206: Go Request Slice Field To Os Open

A struct-field slice (selector expression like `params.Log`) is iterated and each element is passed directly to os.Open / os.ReadFile / os.OpenFile. When the struct is bound from an HTTP request body, the attacker controls the path and can read arbitrary host files (path traversal / arbitrary file read, CVE-2025-30206). Restrict the iteration source to a har

Provally CuratedPublic repositoryHighHigh confidenceVerifiedApache-2.0Go
greprules fetch cve-2025-30206-go-request-slice-field-to-os-open --engine opengrep

Description

A struct-field slice (selector expression like `params.Log`) is iterated and each element is passed directly to os.Open / os.ReadFile / os.OpenFile. When the struct is bound from an HTTP request body, the attacker controls the path and can read arbitrary host files (path traversal / arbitrary file read, CVE-2025-30206). Restrict the iteration source to a har