mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-12 19:55:14 +02:00
[pitboss] phase 21: Track M.3 — ScheduledJob + GraphQLResolver + WebSocket + Middleware + Migration
This commit is contained in:
parent
00b0fbaea9
commit
f9bd51c024
84 changed files with 5898 additions and 40 deletions
10
tests/dynamic_fixtures/graphql_resolver/juniper/benign.rs
Normal file
10
tests/dynamic_fixtures/graphql_resolver/juniper/benign.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
//! Phase 21 — Juniper resolver benign control.
|
||||
// use juniper::graphql_object;
|
||||
|
||||
pub fn resolve_user(id: &str) -> String {
|
||||
let safe: String = id
|
||||
.chars()
|
||||
.filter(|c| c.is_ascii_alphanumeric() || *c == '_' || *c == '-')
|
||||
.collect();
|
||||
format!("user-{}", safe)
|
||||
}
|
||||
15
tests/dynamic_fixtures/graphql_resolver/juniper/vuln.rs
Normal file
15
tests/dynamic_fixtures/graphql_resolver/juniper/vuln.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
//! Phase 21 (Track M.3) — Juniper GraphQL resolver vuln fixture.
|
||||
//!
|
||||
//! `resolve_user(id)` is a Juniper resolver (substring marker only —
|
||||
//! the real `juniper` crate is not on the workdir's Cargo.toml). The
|
||||
//! resolver builds a SQL query via raw string concat — classic
|
||||
//! GraphQL → SQLi shape.
|
||||
|
||||
// use juniper::graphql_object;
|
||||
|
||||
pub fn resolve_user(id: &str) -> String {
|
||||
// SINK: tainted id concatenated into SQL.
|
||||
let query = format!("SELECT * FROM users WHERE id = '{}'", id);
|
||||
let _ = query;
|
||||
format!("user-{}", id)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue