CVE-2024-39906: Ruby Uri Open Cmd Injection

Calling `URI.open` with a user-controlled string variable can result in arbitrary OS command execution if the string begins with a pipe character (`|`). To safely fetch URLs, parse the string into a URI object first using `URI(url).open` or `URI.parse(url).open`.

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Ruby
greprules fetch cve-2024-39906-ruby-uri-open-cmd-injection --engine opengrep

Description

Calling `URI.open` with a user-controlled string variable can result in arbitrary OS command execution if the string begins with a pipe character (`|`). To safely fetch URLs, parse the string into a URI object first using `URI(url).open` or `URI.parse(url).open`.