Skip to content

Commit eb25d0d

Browse files
author
Yunus AYDIN
committed
Add test cases
1 parent 85636cc commit eb25d0d

File tree

596 files changed

+515841
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

596 files changed

+515841
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| WebCacheDeceptionFiber.go:15:10:15:17 | "/api/*" | Wildcard Endpoint used with "/api/*" |
2+
| WebCacheDeceptionFiber.go:20:11:20:18 | "/api/*" | Wildcard Endpoint used with "/api/*" |
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package bad
2+
3+
import (
4+
"fmt"
5+
"log"
6+
7+
"github.com/gofiber/fiber/v2"
8+
)
9+
10+
func badRouting() {
11+
app := fiber.New()
12+
log.Println("We are logging in Golang!")
13+
14+
// GET /api/register
15+
app.Get("/api/*", func(c *fiber.Ctx) error {
16+
msg := fmt.Sprintf("✋")
17+
return c.SendString(msg) // => ✋ register
18+
})
19+
20+
app.Post("/api/*", func(c *fiber.Ctx) error {
21+
msg := fmt.Sprintf("✋")
22+
return c.SendString(msg) // => ✋ register
23+
})
24+
25+
// GET /flights/LAX-SFO
26+
app.Get("/flights/:from-:to", func(c *fiber.Ctx) error {
27+
msg := fmt.Sprintf("💸 From: %s, To: %s", c.Params("from"), c.Params("to"))
28+
return c.SendString(msg) // => 💸 From: LAX, To: SFO
29+
})
30+
31+
// GET /dictionary.txt
32+
app.Get("/:file.:ext", func(c *fiber.Ctx) error {
33+
msg := fmt.Sprintf("📃 %s.%s", c.Params("file"), c.Params("ext"))
34+
return c.SendString(msg) // => 📃 dictionary.txt
35+
})
36+
37+
log.Fatal(app.Listen(":3000"))
38+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
experimental/CWE-525/WebCacheDeceptionFiber.ql
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module test
2+
3+
go 1.21.1
4+
5+
require github.com/gofiber/fiber/v2 v2.51.0
6+
7+
require (
8+
github.com/andybalholm/brotli v1.0.5 // indirect
9+
github.com/google/uuid v1.4.0 // indirect
10+
github.com/klauspost/compress v1.16.7 // indirect
11+
github.com/mattn/go-colorable v0.1.13 // indirect
12+
github.com/mattn/go-isatty v0.0.20 // indirect
13+
github.com/mattn/go-runewidth v0.0.15 // indirect
14+
github.com/rivo/uniseg v0.2.0 // indirect
15+
github.com/valyala/bytebufferpool v1.0.0 // indirect
16+
github.com/valyala/fasthttp v1.50.0 // indirect
17+
github.com/valyala/tcplisten v1.0.0 // indirect
18+
golang.org/x/sys v0.14.0 // indirect
19+
)

go/ql/test/experimental/CWE-525/vendor/github.com/andybalholm/brotli/LICENSE

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/ql/test/experimental/CWE-525/vendor/github.com/andybalholm/brotli/README.md

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/ql/test/experimental/CWE-525/vendor/github.com/andybalholm/brotli/backward_references.go

Lines changed: 185 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)