Skip to content

how can i analysis two project with "database import" command? #7644

@k6ymaker

Description

@k6ymaker

analysis two project with "database import" command

Hello,i want to analysis two project with "database import" command.

The first project is "hello-springboot-7". It just a springboot web demo, and it relies on the second project.

The first project is "hello-springboot-7" . And there is a taintedPathWeb function which is a spring web controller function in "hello-springboot-7". The taintedPathWeb will call FileHelper.isExist function which is defined in the second project.
3441642582716_ pic

The second project is "filehelper" which is a tool project.And the FileHelper.isExist function is in it.

3451642583177_ pic

The "hello-springboot-7"" relies on "filehelper" through maven depdendency.

3461642583408_ pic

I run the follow command generate the code database of hello-springboot-7 and filehelper.

codeql database init --language=java --source-root=./cmdhelper --allow-missing-source-root=false --allow-already-existing -- ./cmdhelperdb

codeql database trace-command --working-dir=./cmdhelper --index-traceless-dbs --no-db-cluster -- ./cmdhelperdb mvn clean install

codeql database init --language=java --source-root=./hello-springboot-7 --allow-missing-source-root=false --allow-already-existing -- ./webdb

codeql database trace-command --working-dir=./hello-springboot-7 --index-traceless-dbs --no-db-cluster -- ./webdb mvn clean install

And then i run "database import" command. Add cmdhelperdb to webdb
codeql database import -- ./webdb ./cmdhelperdb

Finally, i run "database finalize" command finalize webdb.
codeql database finalize --mode=normal --no-db-cluster -- ./webdb

I run the TaintedPath.ql
(https://github.com/github/codeql/blob/main/java/ql/src/Security/CWE/CWE-022/TaintedPath.ql) in this database.
I want get the result that codeql can find the taint flow from filename parameter in Hellocontroller.taintedPathWeb to new File(filename) in FileHelper.isExist.
But i did't get the result which i desired. It can't get the taint flow from project a to project b.

Did i use "database import" command in a wrong way? Or i misunderstanding the mean of the "database import" command.Please give me some suggestion. 。^‿^。

Two projects in the zip file.project.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions