Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix examples
  • Loading branch information
am0o0 committed Oct 9, 2023
commit 2579791f51785ecf1b97500215919c3614d5a267
9 changes: 7 additions & 2 deletions go/ql/src/experimental/CWE-321-V2/Example.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
package main

import (
"fmt"
"log"
)

var JwtKey = []byte("AllYourBase")

func main() {
// BAD: usage of a harcoded Key
// BAD: usage of a harcoded Key
verifyJWT(token)
}

Expand All @@ -18,4 +23,4 @@ func verifyJWT(signedToken string) {
} else {
log.Fatal(err)
}
}
}
8 changes: 6 additions & 2 deletions go/ql/src/experimental/CWE-347/Example.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package main


import (
"fmt"
"log"
)

func main() {
// BAD: only decode jwt without verification
Expand Down Expand Up @@ -30,4 +34,4 @@ func verifyJWT(signedToken string) {
} else {
log.Fatal(err)
}
}
}