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

RustSec integration #7

Open
tarcieri opened this issue Jul 28, 2023 · 5 comments
Open

RustSec integration #7

tarcieri opened this issue Jul 28, 2023 · 5 comments

Comments

@tarcieri
Copy link

Hello from @rustsec! 👋

We have a long standing issue (rustsec/rustsec#21) to use call graph analysis for false positive elimination.

Right now our advisories sometimes contain (unvalidated) information about functions affected by a given vulnerability we could use to "taint" a call graph. This would be particularly useful for transitive dependencies where we can say none of the immediate dependencies ever call an affected function in any of the transitive dependencies.

My immediate question would be what would be the best way to store/query this information so it could be consumed by a tool like cargo-audit? Could the database be made online somehow, either as a service or some sort of flat file format broken down by crates and versions?

@tarcieri
Copy link
Author

An immediate integration that might make sense is integrating with our advisory linter to ensure the call graph information is valid, i.e. that the affected functions in the advisory actually exist in the enumerated release(s)

@walterhpearce
Copy link
Contributor

I'd say this is basically the main and first thought beyond the tool! Right now, the big issue is finding a way we can serve queries against the database and pay for that. I see that as three paths that could really be independent.

  1. We (The Foundation) are working on the ability to fund the cost of the server to host the graph database and provide an API for querying against it. This is the end goal, so we can just provide the community with some endpoints to investigate the data.
  2. Provide a nightly snapshot of the raw neo4j database or some subset consumable dump of the graph.
  3. We could create and provide a nightly snapshot of the data specifically tailored for cargo-audit consumption by end users, so we wouldn't need to query the graph specifically; just export the pre-determined information.

You already mentioned option 1, basically, but I'd also like to bring up number 3 as something to discuss - as we are mainly wanting to think "What is the minimal subset of information cargo-audit or RustSec needs?

I think it may also bring up the need for a more unified formation for RustSec advisories to index the function and exploitability path for this.

@tarcieri
Copy link
Author

tarcieri commented Aug 1, 2023

You can view the information we already collect here, although at present it isn't validated: https://github.com/search?q=repo%3Arustsec%2Fadvisory-db%20functions&type=code

It's effectively a UFCS path to the affected functions for a given advisory, where each function is also annotated with a set of SemVer selectors for which releases that function existed (allowing the function to be renamed between releases but still identified as vulnerable)

@jacks0n9
Copy link

alright, can we just close this issue. it's been almost a year and i don't think anyone cares about this issue

@tarcieri
Copy link
Author

I would still love to use information from painter to at least lint the affected.functions fields in RustSec advisories in our CI process, but perhaps we could make a separate issue(s) for what concrete functionality is needed on the painter side for that sort of thing, i.e. some sort of API (or flat file naming convention) that lets us query call graph information for a particular version of a crate which has been released on crates.io.

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

No branches or pull requests

3 participants