Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New CodeQL queries for ML libraries #2

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open

New CodeQL queries for ML libraries #2

wants to merge 19 commits into from

Conversation

fegge
Copy link
Collaborator

@fegge fegge commented May 13, 2024

This PR adds a number of CodeQL queries for the GGML library used by e.g. llama.cpp and whisper.cpp.

@fegge fegge marked this pull request as draft May 13, 2024 08:02
@fegge fegge marked this pull request as draft May 13, 2024 08:02
@fegge fegge requested a review from fcasal May 13, 2024 08:03
@fegge fegge self-assigned this May 13, 2024
@fegge fegge removed the request for review from fcasal May 13, 2024 08:03
@fegge fegge marked this pull request as ready for review June 27, 2024 13:51
@fegge fegge changed the title [WIP]: New CodeQL queries for ML libraries New CodeQL queries for ML libraries Jun 27, 2024
@fegge fegge requested review from 0xalpharush and fcasal June 27, 2024 13:52
Copy link
Contributor

@GrosQuildu GrosQuildu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The queries look to be generic, not ML-focused? So what if we move them from src/ml to src/security?
Then we can keep the queries in the generic security and has ML specific libraries, and in the future can add more libraries (not necessarily ML) for the queries

where
leak.reaches(source, var, sink)
select
source.getLocation(), toMessage(source, sink, var)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest making selects like this:

select 
  source, "The variable `" + var + "` is allocated on line $@ and may leak on line $@",
  source, toLine(source), sink, toLine(sink)

first arg doesn't need getLocation (or does it?).
Using $@ makes the line clickable (easier to triage results)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants