[pitboss] phase 17: Track L.15 — Gin / Echo / Fiber / Chi adapters + Axum / Actix / Rocket / Warp adapters

This commit is contained in:
pitboss 2026-05-20 12:24:31 -05:00
parent 5393fe22f2
commit 2b96c6005b
33 changed files with 3247 additions and 27 deletions

View file

@ -0,0 +1,26 @@
// Phase 17 (Track L.15) — echo benign control fixture.
//
// The /run route consults an allow-list before invoking exec, so
// attacker bytes never reach the sink directly.
package main
import (
"os/exec"
"github.com/labstack/echo/v4"
)
func Run(c echo.Context) error {
cmd := c.QueryParam("cmd")
allow := map[string]string{"ls": "ls", "ps": "ps"}
if safe, ok := allow[cmd]; ok {
return exec.Command(safe).Run()
}
return nil
}
func main() {
e := echo.New()
e.GET("/run", Run)
_ = e
}

View file

@ -0,0 +1,23 @@
// Phase 17 (Track L.15) — echo CMDI vuln fixture.
//
// The /run route forwards a `cmd` query parameter straight into
// `os/exec.Command`. Adapter binding: `e.GET("/run", Run)` with
// `cmd` flowing through `c.QueryParam`.
package main
import (
"os/exec"
"github.com/labstack/echo/v4"
)
func Run(c echo.Context) error {
cmd := c.QueryParam("cmd")
return exec.Command("sh", "-c", cmd).Run()
}
func main() {
e := echo.New()
e.GET("/run", Run)
_ = e
}