Skip to content

Build a vulnerable-function watchlist from advisories #52

Closed

Description

@vsn411

To check a vulnerable function at runtime, the sensor first needs its name. Add secfoo runtime watchlist --project <name> -o watchlist.json, which builds the list for a project's open SCA findings.

Sources, in priority order:

  1. OSV affected[].ecosystem_specific.imports[].symbols. Go advisories fill this in well. The raw OSV records are already cached in the osv_lookups.vulns_json column, so no new network calls are needed.
  2. The GitHub advisory REST API's vulnerabilities[].vulnerable_functions. It is often empty and needs no auth for public advisories, but respect rate limits and keep it optional.
  3. When neither source has symbols: put the package in the watchlist with "symbols": [] and "granularity": "package". The sensor then only records whether the package was imported or used.

Format (proposal, please discuss in the thread before building):

{
  "version": 1,
  "generated_at": "2026-11-08T12:00:00Z",
  "entries": [
    {
      "finding_fingerprint": "<sca_findings.fingerprint>",
      "advisory": "GHSA-xxxx-xxxx-xxxx",
      "ecosystem": "PyPI",
      "package": "pyyaml",
      "version": "5.3",
      "granularity": "symbol",
      "symbols": ["yaml.load", "yaml.unsafe_load"],
      "source": "osv"
    }
  ]
}

Symbol notation per ecosystem. Probes in every runtime (#51) match on these exact forms, so normalise advisory symbols into them:

Ecosystem Notation Example
PyPI module.qualname yaml.load
npm package#export.path lodash#template
Maven fully.qualified.Class#method org.apache.logging.log4j.core.lookup.JndiLookup#lookup
NuGet Namespace.Type#Method System.Text.Json.JsonSerializer#Deserialize
Go importpath.Func / importpath.Type.Method (as OSV writes it) golang.org/x/net/html.Parse
crates.io crate::path::fn hyper::proto::h1::role::parse_headers
RubyGems Class#instance_method / Class.class_method Nokogiri::XML::Document.parse
Packagist Namespace\Class::method or function Symfony\Component\Yaml\Yaml::parse

When a symbol can't be normalised, keep the entry at "granularity": "package". Never drop it.

Where to look: src/secfoo/osv.py, src/secfoo/report/sca.py (fingerprint_for_row), the osv_lookups and sca_findings tables in src/secfoo/storage/schema.sql.

Done when: there's a JSON Schema for the file in src/secfoo/runtime/, and tests use fixture OSV records with and without symbols (no network).

Activity

  1. added
    enhancementNew feature or request
    help wantedExtra attention is needed
    hackathonOpen for the Secfoo hackathon
    difficulty: mediumLeaderboard: 6 points when the PR closing this is merged
    on Nov 8, 2026
  2. karthickmk2001 commented on Nov 11, 2026

    @karthickmk2001
    Collaborator

    I'd like to take this. I'll use the proposed v1 format as written (OSV symbols first, GHSA optional, package granularity as the fallback); happy to adjust if anyone wants changes. PR to follow.

  3. added 2 commits that reference this issue on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: mediumLeaderboard: 6 points when the PR closing this is mergedenhancementNew feature or requesthackathonOpen for the Secfoo hackathonhelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions