[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,27 @@
//! Phase 17 (Track L.15) — axum benign control fixture.
//!
//! The /run route allow-lists the `cmd` value before invoking
//! `std::process::Command`, so attacker bytes never reach the sink.
use axum::extract::Query;
use axum::Router;
use axum::routing::get;
use serde::Deserialize;
use std::process::Command;
#[derive(Deserialize)]
pub struct RunQuery {
pub cmd: String,
}
pub async fn run(Query(q): Query<RunQuery>) -> String {
let allow = ["ls", "ps"];
if allow.contains(&q.cmd.as_str()) {
let _ = Command::new(&q.cmd).status();
}
"ok".to_owned()
}
pub fn build() -> Router {
Router::new().route("/run", get(run))
}

View file

@ -0,0 +1,26 @@
//! Phase 17 (Track L.15) — axum CMDI vuln fixture.
//!
//! The /run route forwards a `cmd` query parameter straight into
//! `std::process::Command`. Adapter binding:
//! `Router::new().route("/run", get(run))` with `cmd` arriving via
//! `axum::extract::Query<RunQuery>`.
use axum::extract::Query;
use axum::Router;
use axum::routing::get;
use serde::Deserialize;
use std::process::Command;
#[derive(Deserialize)]
pub struct RunQuery {
pub cmd: String,
}
pub async fn run(Query(q): Query<RunQuery>) -> String {
let _ = Command::new("sh").arg("-c").arg(&q.cmd).status();
"ok".to_owned()
}
pub fn build() -> Router {
Router::new().route("/run", get(run))
}