Git Product home page Git Product logo

google / osv.dev Goto Github PK

View Code? Open in Web Editor NEW
1.4K 41.0 172.0 20.07 MB

Open source vulnerability DB and triage service.

Home Page: https://osv.dev

License: Apache License 2.0

Dockerfile 2.04% Shell 4.69% Python 54.99% Go 28.52% HTML 3.92% JavaScript 0.50% SCSS 2.47% Makefile 0.22% HCL 2.65%
security security-tools vulnerability-scanners vulnerability-management vulnerability vulnerability-databases

osv.dev's Issues

Support SEMVER and ECOSYSTEM version ranges.

To support package ecosystems.

OSV's infra should:

  • Support enumerating package versions to provide fast version querying.
  • Deducing commit ranges where possible based on repo version tags to support commit queries as well, if there was a reliable way to get the repo URL.

vulnfeeds: support re-evaluating existing entries

I don't believe it is currently possible to re-evaluate an existing entry. It would be useful to re-run analysis over existing entries when we add enhancements to the code to better classify things, etc. It would also be useful for cases where there is no fixed version at the time an advisory is published, but a fixed version is later released. Currently I just have some python scripts I run manually to try and check some of this and manually update when needed.

vulnfeeds: consider adding GitHub security advisory data as input

I thought it could be useful to add GHSA data as an input source for the pypi vulnfeed. We can combine it with the matching CVE source data and then extract the best information from the combination. That could help prevent bad matches like the one that happened with pypa/advisory-database#34 as we could have evaluated the GHSA record and realised that it was not a match for that cve and pypi package combination. Also, there are many instances where there is a GHSA record, but no CVE is ever requested for it, but we may still want a PYSEC and advisory created.

We'd have to make some decisions around which source to prefer when both exist. I suspect that the GHSA record will usually be more trustworthy for identifying the affected pypi package since it will be created by the project itself, and probably the version range info is more reliable as well? We could aggregate all of the reference links from both sources. For the details field, I think the GHSA ones tend to be more verbose and contain more markdown syntax than the nvd ones, so unsure which should be preferred there.

@oliverchang , any thoughts on this? And are you already collecting all of the GHSA JSON entries somewhere where we could just download a zip of them or would we need something new for that? I know there is a process in aquasecurity/vuln-list-update which creates the JSON entries at aquasecurity/vuln-list which is used by trivy.

Support repo/dump of the data

I was wondering if you are planning to also release a dump of the data, perhaps storing each vulnerability object in a folder that can be accessed (e.g. GitHub) or downloaded. I think it would be a great addition to have.

Incorrect response on API call for gopkg.in/yaml.v2

I am trying to get the OSV for gopkg.in/yaml.v2 and here is curl command
curl -X POST -d '{"version":"2.4.0", "package": {"name": "gopkg.in/yaml.v2", "ecosystem": "Go"}}' "https://api.osv.dev/v1/query"

Here is the result of the call.

But as per result, it has been fixed in 2.2.8 and in 2.2.3 , so 2.4.0 should return clean. It isn't. This is correct results I am seeing in https://deps.dev/go/gopkg.in%2Fyaml.v2/v2.4.0

What am I doing wrong?

Thanks

{
  "vulns": [
    {
      "id": "GO-2020-0036",
      "package": {
        "name": "gopkg.in/yaml.v2",
        "ecosystem": "Go"
      },
      "details": "Due to unbounded aliasing, a crafted YAML file can cause consumption\nof significant system resources. If parsing user supplied input, this\nmay be used as a denial of service vector.\n",
      "affects": {
        "ranges": [
          {
            "type": "SEMVER",
            "fixed": "2.2.8"
          }
        ]
      },
      "aliases": [
        "CVE-2019-11254"
      ],
      "modified": "2021-04-14T12:00:00Z",
      "published": "2021-04-14T12:00:00Z",
      "ecosystem_specific": {
        "symbols": [
          "yaml_parser_fetch_more_tokens"
        ]
      },
      "database_specific": {
        "source": "https://storage.googleapis.com/go-vulndb/gopkg.in/yaml.v2.json",
        "url": "https://go.googlesource.com/vulndb/+/refs/heads/master/reports/GO-2020-0036.yaml"
      },
      "references": [
        {
          "type": "FIX",
          "url": "https://github.com/go-yaml/yaml/pull/555"
        },
        {
          "type": "FIX",
          "url": "https://github.com/go-yaml/yaml/commit/53403b58ad1b561927d19068c655246f2db79d48"
        },
        {
          "type": "WEB",
          "url": "https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18496"
        }
      ],
      "affected": [
        {
          "package": {
            "name": "gopkg.in/yaml.v2",
            "ecosystem": "Go"
          },
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.2.8"
                }
              ]
            }
          ],
          "ecosystem_specific": {
            "symbols": [
              "yaml_parser_fetch_more_tokens"
            ]
          },
          "database_specific": {
            "url": "https://go.googlesource.com/vulndb/+/refs/heads/master/reports/GO-2020-0036.yaml",
            "source": "https://storage.googleapis.com/go-vulndb/gopkg.in/yaml.v2.json"
          }
        },
        {
          "package": {
            "name": "github.com/go-yaml/yaml",
            "ecosystem": "Go"
          },
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "ecosystem_specific": {
            "symbols": [
              "yaml_parser_fetch_more_tokens"
            ]
          },
          "database_specific": {
            "url": "https://go.googlesource.com/vulndb/+/refs/heads/master/reports/GO-2020-0036.yaml",
            "source": "https://storage.googleapis.com/go-vulndb/gopkg.in/yaml.v2.json"
          }
        }
      ]
    },
    {
      "id": "GO-2021-0061",
      "package": {
        "name": "gopkg.in/yaml.v2",
        "ecosystem": "Go"
      },
      "details": "Due to unbounded alias chasing, a maliciously crafted YAML file\ncan cause the system to consume significant system resources. If\nparsing user input, this may be used as a denial of service vector.\n",
      "affects": {
        "ranges": [
          {
            "type": "SEMVER",
            "fixed": "2.2.3"
          }
        ]
      },
      "modified": "2021-04-14T12:00:00Z",
      "published": "2021-04-14T12:00:00Z",
      "ecosystem_specific": {
        "symbols": [
          "decoder.unmarshal"
        ]
      },
      "database_specific": {
        "url": "https://go.googlesource.com/vulndb/+/refs/heads/master/reports/GO-2021-0061.yaml",
        "source": "https://storage.googleapis.com/go-vulndb/gopkg.in/yaml.v2.json"
      },
      "references": [
        {
          "type": "FIX",
          "url": "https://github.com/go-yaml/yaml/pull/375"
        },
        {
          "type": "FIX",
          "url": "https://github.com/go-yaml/yaml/commit/bb4e33bf68bf89cad44d386192cbed201f35b241"
        }
      ],
      "affected": [
        {
          "package": {
            "name": "gopkg.in/yaml.v2",
            "ecosystem": "Go"
          },
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.2.3"
                }
              ]
            }
          ],
          "ecosystem_specific": {
            "symbols": [
              "decoder.unmarshal"
            ]
          },
          "database_specific": {
            "url": "https://go.googlesource.com/vulndb/+/refs/heads/master/reports/GO-2021-0061.yaml",
            "source": "https://storage.googleapis.com/go-vulndb/gopkg.in/yaml.v2.json"
          }
        },
        {
          "package": {
            "name": "github.com/go-yaml/yaml",
            "ecosystem": "Go"
          },
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "ecosystem_specific": {
            "symbols": [
              "decoder.unmarshal"
            ]
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/go-vulndb/gopkg.in/yaml.v2.json",
            "url": "https://go.googlesource.com/vulndb/+/refs/heads/master/reports/GO-2021-0061.yaml"
          }
        }
      ]
    }
  ]
}

Data license?

I was wondering what is the license of the data you provide?
I could not find something explicit.
This is to possibly import these in nexB/vulnerablecode#341 as we were alredy planning to import oss-fuzz data otherwise.
Thanks

Inconsistent states of issues in oss-fuzz and OSV

Hi,

I just had a first look at OSV and have to say that it really looks like a great help to me. Thank you very much for starting this.

Unfortunately, I noticed that at least one issue's states are inconsistent in oss-fuzz and OSV:
oss-fuzz 24266 is "Verified" since January 5th, so all versions greater than v6.0.0 should be fixed, but the resulting OSV-2020-902 still reads "Not fixed". Could you please double-check this?

In case it matters: The issue was found in Qt built from branch 5.15. It was marked "Verified" immediately after I moved to building from the dev branch.

Cheers,
Robert

OSV CI

Parts of OSV (impact analysis, bisection) may be run as part of a CI workflow instead.

Improve cherry pick detection

Currently cherry picks are detected based on the git patch-id.

We can add additional heuristics like searching for the "cherry picked from" string in commit messages in cases where the cherry pick results in different patch-ids.

Generic pipeline for importing Vulnerabilities.

Extend the current OSS-Fuzz pipeline to support generic data sources.

  • Input: Partially filled Vulnerability data from a repository.
  • Output: Vulnerability with appended affected commit range and versions info pushed back to the same repository and location.

More requirements:

  • Parts of OSV will also be made to run as part of CI workflows (#51)
  • Users can also submit PRs to fix up details in Vulnerability entries.
  • OSS-Fuzz data will be dumped as well in the same format.

Current sketch (subject to change):

Architecture

Existing artifact vuln scanners, databases, and specs?

What are the existing [container] artifact vuln scanners, databases, and specs?

tools, vuln databases

awesome-docker-security >
Container [vuln] scanning:

standards

SBOM standards:

vulnfeeds: detect when version range has introduced > fixed

For PyPI vulnfeeds, there are some cases of bad data in the form of:

introduced: 1.0
fixed: 1.0b4

Encoded like so, this means that everything after and including 1.0 is affeted (because 1.0b4 comes before 1.0). This should instead be something like

introduced: 1.0a0
fixed: 1.0b4

We need to detect these cases in the vulnfeeds tool.

Remove API key requirement

  • For the /vulns/ GET endpoint, there is no need for rate limiting.
  • For the query endpoint, we can support anonymous rate limiting.

triage tool: perform some normalization of reference links to further improve matching

Here are a few suggestions to improve matching based on links for pypi packages

  • strip .git from the end of source control links. For instance, in the pypi_links.json input file, for the notebook package, we have https://github.com/jupyter/notebook.git, but in the actual CVE references it is just https://github.com/jupyter/notebook, so a match is never found

  • Convert older-style pypi urls to https://pypi.org/project/ urls. There are at least a couple of older ones: https://pypi.python.org/pypi/, https://upload.pypi.org/legacy/. We could also transform https://pypi.org/simple/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.