Skip to content

feat: justify advisory entry points, keep their conditions and record evidence levels - #109

Merged
SizzleUnrlsd merged 6 commits into
mainfrom
feat/advisory-evidence
Sep 22, 2026
Merged

SizzleUnrlsd merged 6 commits into
mainfrom
feat/advisory-evidence

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Groundwork for the curated advisories (CoreTrace-Entreprise/coretrace-python-analyzer-plugins#2).

Schema (still "schema": 1, every new field optional)

  • affected_symbols: the internal functions the fix changed.
  • entry_points: the public APIs through which a project reaches them, each with a justification (the commit, or the call path) and conditions.
  • conditions: {"kind": "argument", "argument", "values"} for what the engine can check, {"kind": "semantic", "text"} for what it cannot yet. Not one is dropped: both kinds are recorded on the finding, and every condition is listed as conditions_pending_review until checked (a ponytail: note marks the ceiling; see the follow-up issue).
  • modules: the top-level modules the package installs (pyyaml → yaml), defaulting to the package name.

Evidence levels

Every dependency finding carries level: declared (requirement allows a vulnerable version), imported (a module of the package is imported in the project — an internal state on the finding, not a new finding), reachable (a call to an entry point or affected symbol), exploitable (attacker input reaches it). reachable/exploitable also carry entry_point, justification, conditions, conditions_pending_review; a direct call to an affected symbol is justified as "affected symbol, changed by the fix".

correlation.evidence() owns the metadata; both bundled dependency plugins and the correlation use it.

Tests

tests/test_advisory_evidence.py: schema round trip, module default, and the four transitions on one synthetic advisory — declared only, imported without a call, reachable through an entry point (with justification and conditions), reachable through the affected symbol itself, exploitable. 911 passed; ruff and mypy clean.

… evidence levels

An advisory now distinguishes the affected_symbols a fix changed from the
public entry_points through which a project reaches them; each entry point
carries the justification tying it to the fix and the conditions under
which it is affected. A condition the engine cannot check is kept on the
finding as pending review, never dropped. modules names what the package
installs, so a required package can be told from an imported one. Every
dependency finding records its evidence level: declared, imported,
reachable or exploitable.

Part of CoreTrace-Entreprise/coretrace-python-analyzer-plugins#2
The affected-symbol map kept the first advisory per symbol, so a call to
yaml.load under a release affected by four CVEs reported one. The map now
carries every advisory of the symbol; the reachable plugin and the
correlation report one finding per advisory.
…ules

Two contributions of the same advisory with different ranges both survived
and produced two findings. The later contributor now replaces the earlier
one, so a curated plugin refines the bundled sample and a local file wins
over every plugin. The sample advisories say which modules pyyaml and
pillow install.
@SizzleUnrlsd SizzleUnrlsd self-assigned this Sep 22, 2026
@SizzleUnrlsd
SizzleUnrlsd merged commit 02fb722 into main Sep 22, 2026
10 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the feat/advisory-evidence branch September 22, 2026 14:56
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.

1 participant