2026-05-20 14:32:00 -05:00
|
|
|
// Phase 19 (Track M.1) — class-method vuln fixture for Go.
|
|
|
|
|
//
|
|
|
|
|
// UserService.Run accepts user input and passes it to `sh -c` so the
|
2026-05-21 08:54:08 -05:00
|
|
|
// shell interprets it. The harness compiles in a generated
|
|
|
|
|
// `nyx_auto_registry.go` that publishes `UserService{}` so reflection
|
|
|
|
|
// works without a hand-rolled registry in the fixture.
|
2026-05-20 14:32:00 -05:00
|
|
|
package entry
|
|
|
|
|
|
|
|
|
|
import "os/exec"
|
|
|
|
|
|
|
|
|
|
type UserService struct{}
|
|
|
|
|
|
|
|
|
|
func (UserService) Run(input string) string {
|
|
|
|
|
// SINK: tainted input → shell -c
|
2026-05-23 10:31:57 -05:00
|
|
|
out, _ := exec.Command("sh", "-c", "true "+input).Output()
|
2026-05-20 14:32:00 -05:00
|
|
|
return string(out)
|
|
|
|
|
}
|