-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
I am working on defining a dataflow source for web framework Beego.
I tried this query on my project written in beego (https://github.com/cokeBeer/go-sec-code):
import go
from Type c
where c.hasQualifiedName("go-sec-code/controllers", "CommandInjectVuln1Controller")
select c.getMethod("Get")
it turned out no results,but I do have a go-sec-code/controllers.CommandInjectVuln1Controller.Get Method
https://github.com/cokeBeer/go-sec-code/blob/main/controllers/commandInject.go#L23
I think the problem may come from that Beego.Controller is a composite type which looks like:
package controllers
import (
"fmt"
"go-sec-code/utils"
"os/exec"
beego "github.com/beego/beego/v2/server/web"
)
type CommandInjectVuln1Controller struct {
beego.Controller
}
moreover, I've noted that there is a BeegoControllerSource in CodeQL Go standard library semmle.go.frameworks.Beego.qll.
I tried only query the souce node with vscode's help on the same project, but it turned out not found GetString() method called
How can I make a source defination that can find all Controllers that composite Beego.Controller?