Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,68 @@ what has already shipped, and for nothing else. See `RELEASING.md`.

### Fixed

- **The law check carries mailradar's fixes of 2026-11-17 (maksimtech/mailradar#103).** `law_fetcher.py`
and `law_cache.py` were the copies mailradar had before that pull request, apart from the variable
`PATCHRADAR_HOME`; they are now its copies after it, with the same name kept.
- *A citation is "verified" only when the reference it cites is in the text downloaded now.* The
check looked at the article: with article 32 in Cellar's page and paragraph 2 missing from what was
parsed, the citation of `32(2)` for a critical CVE fell back to the cache, old SHA-256 and date
included, under "verified against Cellar", or stood beside `SHA256: not available` with an empty
cache. A missing reference now makes the act a fetch failure.
- *A failed download always reaches the EUR-Lex fallback and the cache*: a redirect to a host httpx
cannot encode (`http://xn--/DOC_1`) raised `idna.core.IDNAError` out of the whole law check.
- *Redirects stay on the source's host* (publications.europa.eu, eur-lex.europa.eu, www.normattiva.it,
default port), so the hosts in `docs/nis2-compliance.md` are the only ones the check can reach.
- *A page is read up to 32 MiB, and a fetch ends after 120 seconds*, redirects included.
- *A change in the law is reported even when the cache cannot be written*: the comparison was made
by the save, so with a read-only cache a changed text was cited without the warning and an unchanged
one was dated to the day of the audit. `law_cache.merge` now runs before the save.
- *Statuses name the source that was tried.* `ActStatus` carries `tried`, `failure` and `reason`, and
`scan` prints "Cellar answered without the text cited" or "Cellar and EUR-Lex unreachable" where it
printed "EUR-Lex unreachable" whatever had happened.
- *A deeply nested `law_cache.json` is an empty cache*, not a `RecursionError`; Normattiva's "-bis",
"-ter", ... paragraphs can be cited on their own.

- **The law check no longer cites CVEs the same scan judged "not affected".** `scan` handed every CVE
found by name to the law check, verdict or not: for 7-Zip 26.06 it printed "not affecting it: 2" and
then cited CVE-2025-0411 (fixed in 24.09) and CVE-2026-14266 (fixed in 26.02) under GDPR art. 25 and
art. 32, and a critical unpatched one would have reached D.Lgs. 138/2024 art. 24 too. Only the CVEs
that affect the installed version, could not be evaluated, or belong to an entry matched by name are
cited now. The API runs no law check, so it had nothing to change.

- **A CPE typed with capitals no longer turns every CVE into "not affected".** `add --cpe` and
`POST /api/watchlist/{name}?cpe=` accepted `cpe:2.3:a:Mozilla:Thunderbird` as typed, and the verdict
compared its vendor and product with NVD's lower-case `cpeMatch` names as strings: nothing matched, so
every CVE of the program was judged "not affected" and hidden from the table — a false all-clear. CPE
2.3 names match without regard to case: the CPE is now stored in lower case, and the verdict compares
vendor and product without regard to case, which also covers entries stored before.

- **"Affected" only when NVD's statement is about the version alone.** The verdict read the version of a
`cpeMatch` entry and ignored the rest: the fields after the version and the AND configuration around
it. On NVD's own records (2026-11-17), Chrome 150 on Windows was "affected" by CVE-2026-16424, which NVD
lists for Chrome *on Android* only, and Chrome 151 by CVE-2026-17709, macOS only; Firefox ESR 115.17.0
was "affected, fix in 131.0.2" by CVE-2024-9680, whose ESR line was fixed in 115.16.1; and 7-Zip 4.43
was affected by entries written `7-zip:4.43:beta`. The watchlist knows the version and the CPE, not the
operating system: a range that contains the version only on a platform an AND configuration requires,
or only for an update or edition the watched CPE does not name, now gives "not evaluable" with the
condition in the reason ("NVD lists it as affecting 150.0.7871.100 only on Android"). A CPE that names
its edition or update (`cpe:2.3:a:mozilla:firefox:*:*:*:*:esr:*:*:*`) is judged on those ranges only,
in the CLI and the API alike. A `-` counts as a condition only where the record names the product with
another value in the same field, so VS Code's lone `target_sw: -` changes nothing.

- **The exploited CVEs of a product with a CPE are found whatever CISA calls it.** The KEV collector
matched the watchlist name against CISA's `vendorProject` and `product` only. CISA files Chrome under
"Google / Chromium V8", "Chromium Mojo", "Chromium" and so on: on the 2026-11-17 catalogue, "chrome"
matched 6 of the 72 exploited Chrome CVEs, and a scan reported the other 66 as not known to be
exploited. For an entry with a CPE the catalogue is now also read through NVD, which flags every CVE in
KEV and maps it to the products it affects (`hasKev` with `virtualMatchString=cpe:2.3:<part>:<vendor>:
<product>`, one paged request per entry): for `cpe:2.3:a:google:chrome` it returned the 72 and six more
whose CISA entry names no browser (Adobe Flash Player, WebRTC, Skia, Dawn). NVD's records come with
them, so those CVEs are judged without a lookup by id each. An alias table (chrome → Chromium) was the
alternative; it would have fixed one product and left every other one CISA names by a component as it
was. Entries without a CPE are still matched by name; if NVD cannot be asked, the name's matches stand
and the scan says it is incomplete. `docs/nis2-compliance.md` lists the new query.

- **The weekly mutation run gets past its stats phase again.** It had been red since 2026-10-24, four
Saturdays, on `assert [13226] == []` in `tests/test_sql_is_not_formatted.py`. mutmut runs the suite
from `mutants/`, where database.py holds every mutant beside the code, and one of them drops the
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,12 @@ affected versions:
- **affected** — listed in the table, with "fixed in X" only where NVD states it;
- **not evaluable** — NVD has not yet said which products the CVE affects (the
usual state for weeks after publication), NVD could not be asked about a CVE
that came from KEV or MSRC alone — those are looked up in NVD by id — or NVD's
versions belong to another scheme: listed, because "cannot tell" is not an
all-clear;
that came from KEV or MSRC alone — those are looked up in NVD by id — NVD's
versions belong to another scheme, or NVD lists the version only on another
platform (Chrome on Android) or for an update or edition the CPE does not name
(the ESR line of Firefox, a beta): listed, with the condition, because
"cannot tell" is not an all-clear. A CPE that names its edition, such as
`cpe:2.3:a:mozilla:firefox:*:*:*:*:esr:*:*:*`, is judged on that edition;
- **not affected** — counted, and listed only with `--all`.

One line gives the split, one says which update closes how many of the
Expand Down Expand Up @@ -228,6 +231,13 @@ is worth more than a score: on a sample of 695 CVEs matched against installed
software, sorting by CVSS put five 10.0 entries on top, none of them exploited,
while the four listed in KEV scored 9.8, 8.8, 8.6 and 7.8.

CISA names products its own way, so for an entry added with `--cpe` the catalogue
is also read through NVD, which flags every CVE in KEV and knows which products
it affects: on 2026-11-17 the word "chrome" was in 6 of the 72 exploited Chrome
CVEs (the rest are "Chromium V8", "Chromium Mojo", ...), and NVD asked for
`cpe:2.3:a:google:chrome` returned all 72 and six more. Entries without a CPE
are matched by name only.

EPSS is the row marked *enrichment* because it finds nothing. The four sources
above answer "which CVEs affect this software"; FIRST answers "how likely is
this one to be exploited in the next 30 days", for a CVE you already have. So it
Expand Down
14 changes: 13 additions & 1 deletion docs/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ product, neither `*` nor `-`. A product written with a CPE special character
unescaped — `notepad++` instead of `notepad\+\+` — is refused with the escaped
form shown, because NVD would match nothing and the scan would read as clean.

CPE 2.3 names match without regard to case, and NVD writes them in lower case:
the CPE is stored in lower case, and the verdict compares vendor and product
without regard to case. Compared as typed, `cpe:2.3:a:Mozilla:Thunderbird`
matched nothing and made every CVE "not affected".

The version must be one `affected.py` can order. One it cannot read is refused
at `add`, not discovered as "not evaluable" on every CVE of every scan.

Expand All @@ -88,7 +93,14 @@ name is judged against the installed version with NVD's own `configurations`:
which products the CVE affects (no `configurations`, the usual state of a CVE
for weeks after publication), NVD could not be asked about a CVE that came
from KEV or MSRC alone, or NVD's versions belong to another scheme than the
installed one (`2.07` against `16.0.14334`).
installed one (`2.07` against `16.0.14334`). Also a CVE whose range contains
the version only under a condition the watchlist cannot confirm, which the
reason names: an AND configuration with another product, mostly the
operating system (Chrome *on Android*), or an update or edition the watched
CPE does not name (`7-zip:4.43:beta`, Firefox `sw_edition: esr` beside `-`).
A CPE that names it (`cpe:2.3:a:mozilla:firefox:*:*:*:*:esr:*:*:*`) is judged
on that edition's ranges only. A `-` in a field counts as a condition only
when the record names the product with another value there too.

A CVE that reached the scan only through KEV or MSRC, which carry no
`cpeMatch`, is looked up in NVD by id (`cveId=`) for an entry that can be judged,
Expand Down
2 changes: 1 addition & 1 deletion docs/nis2-compliance.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ cosa ricevono:
<!-- hosts:start -->
| Host | Quando | Cosa riceve |
| --- | --- | --- |
| `services.nvd.nist.gov` | `scan`, da riga di comando o dall'interfaccia web | il nome di ogni software della watchlist (o quello passato a `scan`) come parola chiave di ricerca, con l'intervallo di date; per un software con versione installata e CPE, l'identificativo di ogni CVE trovata solo da CISA KEV o MSRC (`cveId`); la chiave `NVD_API_KEY`, se impostata, in un'intestazione |
| `services.nvd.nist.gov` | `scan`, da riga di comando o dall'interfaccia web | il nome di ogni software della watchlist (o quello passato a `scan`) come parola chiave di ricerca, con l'intervallo di date; per un software con versione installata e CPE, l'identificativo di ogni CVE trovata solo da CISA KEV o MSRC (`cveId`); per un software con CPE, la parte, il fornitore e il prodotto della CPE (`virtualMatchString`, con `hasKev`), per trovare le CVE del catalogo KEV che NVD attribuisce a quel prodotto; la chiave `NVD_API_KEY`, se impostata, in un'intestazione |
| `api.msrc.microsoft.com` | `scan` | il mese dei bollettini richiesti; nessun nome di software, il filtro avviene sulla macchina |
| `www.cisa.gov` | `scan` | nulla: scarica il catalogo KEV intero e lo filtra sulla macchina |
| `security-tracker.debian.org` | `scan` dall'interfaccia web; `patchradar debian` senza `--file` | nulla: scarica il tracker intero e lo filtra sulla macchina |
Expand Down
Loading