Skip to content

feat: report advisories that could not be assessed (BootUI 2.6.0) - #379

Draft
ffroliva wants to merge 98 commits into
mainfrom
feat/0.11.0-unassessed-advisories
Draft

ffroliva wants to merge 98 commits into
mainfrom
feat/0.11.0-unassessed-advisories

Conversation

@ffroliva

@ffroliva ffroliva commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

Task 1.9 of the 0.11.0 plan (#367), row C4 of the BootUI 2.6.0 delta: the vulnerability report states, per dependency,
which advisories the scan found but could not assess, instead of reporting such a dependency as clean.

  • src/sharpit/engine/collectors/vulns/assessment.py (new): assessment_dto builds DependencyAssessmentDto
    (queryComplete, detailAssessmentComplete, unassessedAdvisoryIds, unassessedAdvisoryCount) with BootUI's three
    invariants and messages; assessment is the builder (DependencyReports.assessment): distinct ids in order, a
    preview of at most 100 ids of at most 240 characters with no ISO control characters and no Java-blank ids, and a
    count of every distinct id.
  • src/sharpit/engine/collectors/vulns/service.py: advisories the OSV query names but whose details are not assessed
    (detail fetch failed, cut by the deadline, the body cap or the advisory cap) become candidates, never findings, and
    survive dismissals and EPSS. An advisory with an unparseable withdrawn value stays a finding with UNKNOWN severity
    and the scan is PARTIAL (OsvVulnerabilityScanner 687-692). No extra request is made at the advisory cap.
  • src/sharpit/engine/tools.py (get_vulnerabilities_report): dependencies sort findings first, then candidates,
    then clean; each keeps at most 3 candidate ids (query matches first; candidate ids pass through the text masker, while advisory
    ids are not masked, as before); a top-level
    advisories object (listed, omitted, detailsOmitted, perDependency, unassessedCandidates,
    candidateIdsListed, candidateIdsOmitted, hint) in BootUI's key order. The hint describes sharpit's view.
  • UI (ui/src/views/Vulnerabilities.svelte, lib/score.ts, lib/types.ts; rebuilt src/sharpit/ui/static/): a
    dependency with only candidates shows "Not assessed"; the summary shows "Assessment incomplete" when candidates exist
    and no active finding does.
  • docs/reference/BOOTUI-CONTRACT-MVP.md (the assessment DTO) and docs/reference/matrix-updates/0.11.0-vulns.tsv.

Deviations from BootUI

  • advisories.hint is reworded: sharpit keeps 5 advisories per dependency with their masked details (so
    detailsOmitted is 0), has no exact-query expansion, and omits clean dependencies when there is no query (BootUI
    lists them last); page.total counts the filtered list.
  • Under METADATA_ONLY exposure candidate ids are dropped (the count stays exact); BootUI has no such exposure level.
  • vulnerabilities_scan returns the full report, where BootUI returns a compact summary (an earlier deviation).

Review scope

The branch was cut from the 0.11.0 integration line, so against main the diff also shows the earlier 0.11.0 pull
requests (#368 to #378). This pull request's changes are in the files listed above and their tests.

Red evidence

Each test was run against a commit with the tests and a stub assessment returning a wrong value, or against the code
before the fix (scripts/dev/red_check.py); each red is an assertion.

Finding Test Red
Unassessed advisories were dropped; a dependency looked clean test_service.py::test_candidates_are_not_findings_and_survive_dismissals_and_epss, test_per_dependency_completion[...], test_all_detail_failures_retain_distinct_candidates_... assertion: no assessment
The cap fetched or lost candidates test_advisory_cap_retains_bounded_candidate_preview_and_exact_count_without_extra_fetches assertion (request count 2)
Preview bounds and invariants test_assessment.py (bounds, invariants, control characters) assertion
MCP view had no candidate ordering, cut or summary test_tools.py::test_mcp_query_only_candidates_remain_searchable_..., test_mcp_candidate_totals_survive_paging_and_search_..., test_mcp_vulnerabilities_masks_candidate_ids assertion
A malformed withdrawal became a candidate under a SCANNED status (review) test_per_dependency_completion[malformed-withdrawal-...] assertion: status
The hint described behaviour sharpit does not have (review) test_mcp_vulnerabilities_advisories_hint_is_exact, test_mcp_vulnerabilities_exact_package_query_keeps_five_advisories_with_details assertion
The UI said "Not assessed" for any partial scan (review) vulnerabilities.test.ts summary cases (SCANNED/PARTIAL with candidates, PARTIAL with none) assertion (3 cases)
The tool description said only vulnerable dependencies are listed (review) test_descriptions_ported_with_names_substituted assertion
Java-blank rules: NBSP kept, line and paragraph separators dropped (review) test_java_non_whitespace_space_separators_remain_candidate_ids, test_java_line_and_paragraph_separators_are_blank_candidate_ids assertion

Verification

uv run ruff check, uv run ruff format --check, uv run pyright (0 errors); targeted run over tests/engine,
tests/fastapi, tests/masking, tests/safety, tests/parity and the shape, citation, docs and UI-rule tests: 14,233
passed (the request-overhead budget test, which fails only under parallel load, passed alone); npm test in ui/:
378 passed. The full suite runs in CI.

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
… file

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…e protocol

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
The Origin header is parsed as scheme://host[:port] with an http or https scheme, as BootUI 2.6.0 does: a path (a trailing slash included), query, fragment, userinfo, control character, trailing colon, unsupported scheme or a port above 65535 makes the origin unreadable, and an unreadable origin is cross-site. The value is no longer trimmed.\n\nA port of more than five digits is refused before int() converts it, in the origin and in the request's own Host, so a very long port is a cross-site refusal and no longer an unhandled ValueError. Adds a property test of the origin parser.

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…UI 2.6.0)

A write that carries Sec-Fetch-Site must send same-origin or none (ASCII, case-insensitive); same-site, cross-site, an empty value and any unknown value are refused. A present but empty Origin header is an unreadable origin and is cross-site, no longer read as absent. A same-site navigation GET still loads the shell, and an API path still requires the request's own scheme, host and port. A request whose own origin cannot be formed stays cross-site where that comparison applies.\n\nDocuments the rule in SECURITY.md and the BootUI contract note, and records the deviations in the 0.11.0 guard matrix fragment.

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Record the two deviations of the inactivity log from BootUI 2.6.0 in a matrix fragment, update the MVP plan text that still described the old log line, extract the inactivity logging of install() into a helper to keep its complexity at the pinned count, and wrap one over-long test assertion.

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
An invalid SHARPIT_ENABLED must log exactly one record, the fixed warning, as BootUI does. The count of the remaining configuration warnings stays.

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
An invalid SHARPIT_ENABLED is already reported by the fixed inactive warning. Counting its settings warning as well produced a second WARNING record, where BootUI logs one.

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…tests

Port BootUiInactiveStartupDiagnosticTests.deliberateDisablementIsSilentAtInfo, cite the BootUI tests the other inactivity tests port, and keep the expected log texts in one test module. A single Inactivity alias types the inactivity category. The matrix row for the warning count records that it leaves out the invalid SHARPIT_ENABLED warning.

Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>

# Conflicts:
#	tests/fuzz/test_trust_boundary_fuzz.py
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>

This branch has not been deployed

No deployments
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