mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-21 21:31:03 +02:00
[pitboss] phase 08: Track J.6 + Track L.6 — HEADER_INJECTION corpus + every HTTP framework
This commit is contained in:
parent
59d627cb22
commit
e0e49f65d3
45 changed files with 2552 additions and 41 deletions
15
tests/dynamic_fixtures/header_injection/go/benign.go
Normal file
15
tests/dynamic_fixtures/header_injection/go/benign.go
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Phase 08 (Track J.6) — Go HEADER_INJECTION benign control fixture.
|
||||
//
|
||||
// Same shape as `vuln.go` but URL-encodes the value via
|
||||
// `net/url.QueryEscape` before the header set, so CRLF bytes land as
|
||||
// `%0D%0A` and the wire keeps a single header.
|
||||
package benign
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
func Run(w http.ResponseWriter, value string) {
|
||||
w.Header().Set("Set-Cookie", url.QueryEscape(value))
|
||||
}
|
||||
13
tests/dynamic_fixtures/header_injection/go/vuln.go
Normal file
13
tests/dynamic_fixtures/header_injection/go/vuln.go
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Phase 08 (Track J.6) — Go HEADER_INJECTION vuln fixture.
|
||||
//
|
||||
// The function assigns the attacker-controlled `value` directly into a
|
||||
// `Set-Cookie` header via `http.ResponseWriter.Header().Set`. A
|
||||
// payload carrying `\r\nSet-Cookie: nyx-injected=pwn` splits the
|
||||
// single header into two on the wire.
|
||||
package vuln
|
||||
|
||||
import "net/http"
|
||||
|
||||
func Run(w http.ResponseWriter, value string) {
|
||||
w.Header().Set("Set-Cookie", value)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue