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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Demo: fictional Oracle Java SE rows for CVE-2026-114938 (Java4Shell) with a recorded NVD document (status Received, official Oracle CVSS 3.1 8.1, CNA affected versions, no invented CPE ranges or EPSS). The CVE is not in the demo KEV catalog. `from_nvd_cve` now reads NVD `affected` / `affectedData` when present; CPE `configurations` still win when both exist.
- Dependencies: runtime, dev and build requirements in `pyproject.toml` are pinned to exact versions (`==`). CI installs from the hash-pinned `requirements-ci.txt` (`pip install --require-hashes`), then the project itself with `--no-deps`. Prompted by the malicious `agent-framework` 1.26.1/1.26.2 releases on PyPI ([MAL-2026-20101](https://osv.dev/vulnerability/MAL-2026-20101)); none of these projects depend on it.
- `--columns NAMES` with `--format csv` on `scan` and `demo`: write only the named columns, in the given order. Unknown or repeated names exit 2 before any request.
- Docs: `docs/windows-autopatch.md` maps findings to the Windows Autopatch approval model (automatic/manual approval, deferral, expedite, pause), with Microsoft sources. A test keeps its example in sync with the demo output.
Expand Down
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ python -m pip install -e .
python -m patchorder demo
```

`demo` reads bundled fixtures recorded on 2026-10-21 (Ivanti Connect Secure records on 2026-11-03) and does not use the network. Add `--format html` or `--format json`. `--output briefing.md` is the explicit way to write a file. With no `--output`, nothing is written.
`demo` reads bundled fixtures recorded on 2026-10-21 (Ivanti Connect Secure records on 2026-11-03, CVE-2026-114938 on 2026-11-18) and does not use the network. Add `--format html` or `--format json`. `--output briefing.md` is the explicit way to write a file. With no `--output`, nothing is written.

```bash
python -m patchorder demo --format html --output briefing.html
Expand All @@ -66,6 +66,28 @@ The demo has two fictional VPN gateway rows on Ivanti Connect Secure. The CVEs,

Ivanti release strings such as `22.8R2.4` are split into CPE version `22.8` and update `r2.4`, the way NVD writes them.

The demo also has fictional Oracle Java SE rows for [CVE-2026-114938](https://nvd.nist.gov/vuln/detail/CVE-2026-114938) (also called Java4Shell). The id, CVSS, and affected versions are a recording of the official NVD document on 2026-11-18. At that time NVD status was `Received` and the record had no CPE `configurations`, so patchorder matches the Oracle CNA `affected` list: exact supported versions, not a reconstructed range.

- `jdk-app`, Oracle Java SE 17.0.21.0.3, internet-facing: CVE-2026-114938 is affected (exact CNA version).
- `jdk-app-patched`, 17.0.21.1, internet-facing: not affected. Oracle's Java 17 security baseline for the November 2026 Critical Security Patch Update is `17.0.21.1+4`.
- `jdk-11`, 11.0.33.0.3, internal: not affected. The [OpenJDK advisory](https://openjdk.org/groups/vulnerability/advisories/2026-11-17) marks this CVE on the 17, 21, 25, and 27 lines, not 8 or 11. Oracle's CNA list also omits standard Java 8 and 11; it does list the Java 8 Enterprise Performance Pack build `8u511b33-perf`.

Official CVSS 3.1 is 8.1 High (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`), scored by Oracle and repeated in the OpenJDK advisory. The CVE was not in CISA KEV catalog version 2026.11.17, so the demo KEV fixture is unchanged. FIRST EPSS had no score for this id at recording time, so the finding has no EPSS points.

Red Hat's bulletin describes OpenJDK 17.0.6 and later as affected on x86-64 CPUs with AVX-512 VBMI, and says standard OpenJDK 8 and 11 are not affected. That broader 17.0.6+ range is not in the NVD/CVE.org structured data yet, so the matcher does not invent it. A version such as 17.0.6 is therefore currently reported as outside the official exact list.

Sources recorded or cited for this example:

- [CVE.org record](https://www.cve.org/CVERecord?id=CVE-2026-114938) (CNA: Oracle)
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2026-114938)
- [Oracle Critical Security Patch Update, November 2026](https://www.oracle.com/security-alerts/cspunov2026.html)
- [OpenJDK Vulnerability Advisory: 2026/11/17](https://openjdk.org/groups/vulnerability/advisories/2026-11-17)
- [CISA alert, 17 November 2026](https://www.cisa.gov/news-events/alerts/2026/11/17/critical-java-vulnerability-requires-immediate-patching)
- [Red Hat security bulletin RHSB-2026-018](https://access.redhat.com/security/vulnerabilities/RHSB-2026-018)
- Oracle fixed builds: [17.0.21.1](https://www.oracle.com/java/technologies/javase/17-0-21-1-relnotes.html), [21.0.13.1](https://www.oracle.com/java/technologies/javase/21-0-13-1-relnotes.html), [25.0.5.1](https://www.oracle.com/java/technologies/javase/25-0-5-1-relnotes.html), [27.0.1.1](https://www.oracle.com/java/technologies/javase/27-0-1-1-relnotes.html), and [8u513-perf](https://www.oracle.com/java/technologies/javase/8u513-perf-relnotes.html)
- Amazon Corretto changelogs, which address this CVE in [17.0.21.1.2](https://github.com/corretto/corretto-17/blob/develop/CHANGELOG.md) and [27.0.1.1.4](https://github.com/corretto/corretto-27/blob/develop/CHANGELOG.md)
- CISA KEV catalog version 2026.11.17 (not listed), checked at <https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json>

### Start from a spreadsheet

Most inventories already live in a CMDB export or a spreadsheet. Turn the CSV into inventory YAML, then lint it before the first scan:
Expand Down Expand Up @@ -247,7 +269,7 @@ python -m pip install -e ".[dev]"
python -m pytest
```

Pytest blocks sockets. CI runs the same suite on Python 3.11, 3.12, and 3.13, then runs the offline demo with `--fail-on kev` (expected to exit 4) and `inventory check` on the example (`.github/workflows/ci.yml`).
The suite currently has 96 tests. Pytest blocks sockets. CI runs the same suite on Python 3.11, 3.12, and 3.13, then runs the offline demo with `--fail-on kev` (expected to exit 4) and `inventory check` on the example (`.github/workflows/ci.yml`).

## How to contribute

Expand Down Expand Up @@ -285,4 +307,4 @@ Neu in 0.2: `inventory from-csv` macht aus einem CSV-Export ein Inventar, `inven

Für Windows-Geräte, die über Windows Autopatch aktualisiert werden, erklärt [docs/windows-autopatch.md](docs/windows-autopatch.md) mit Microsoft-Quellen, wie ein Fund zum Freigabemodell passt: automatische Freigabe mit 0 bis 30 Tagen Verzögerung für monatliche Sicherheitsupdates, manuelle Freigabe als Standard für Vorschau- und Out-of-Band-Updates, Beschleunigen und Pausieren.

Neu: Jeder KEV-Fund nennt das `dueDate` aus dem CISA-Katalog und die Tage seit Ablauf. `--fail-on kev-overdue` schlägt nur bei abgelaufener Frist an. Die Punkte ändern sich dadurch nicht. Die Demo enthält zwei fiktive VPN-Gateways mit Ivanti Connect Secure und den echten KEV-Einträgen CVE-2026-104935 und CVE-2026-111357.
Neu: Jeder KEV-Fund nennt das `dueDate` aus dem CISA-Katalog und die Tage seit Ablauf. `--fail-on kev-overdue` schlägt nur bei abgelaufener Frist an. Die Punkte ändern sich dadurch nicht. Die Demo enthält zwei fiktive VPN-Gateways mit Ivanti Connect Secure und den echten KEV-Einträgen CVE-2026-104935 und CVE-2026-111357 sowie fiktive Oracle-Java-SE-Zeilen zu CVE-2026-114938 (Java4Shell; offizieller CVSS-3.1-Wert 8.1, nicht im KEV-Katalog 2026.11.17, Abgleich über die exakten CNA-Versionen, weil die NVD am 18.11.2026 noch keine CPE-Konfigurationen hatte).
18 changes: 18 additions & 0 deletions examples/inventory.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,21 @@ entries:
confidence: 1.0
origin: user
note: Pinned for the fictional Harbor Workshop demo.
jdk-app:
cpe: cpe:2.3:a:oracle:jdk
pinned: true
confidence: 1.0
origin: user
note: Pinned for the fictional Harbor Workshop demo.
jdk-app-patched:
cpe: cpe:2.3:a:oracle:jdk
pinned: true
confidence: 1.0
origin: user
note: Pinned for the fictional Harbor Workshop demo.
jdk-11:
cpe: cpe:2.3:a:oracle:jdk
pinned: true
confidence: 1.0
origin: user
note: Pinned for the fictional Harbor Workshop demo.
21 changes: 21 additions & 0 deletions examples/inventory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,24 @@ assets:
count: 1
owner: network
exposure: internal
- id: jdk-app
product: Oracle Java SE
vendor: Oracle
version: "17.0.21.0.3"
count: 5
owner: apps
exposure: internet
- id: jdk-app-patched
product: Oracle Java SE
vendor: Oracle
version: "17.0.21.1"
count: 2
owner: apps
exposure: internet
- id: jdk-11
product: Oracle Java SE
vendor: Oracle
version: "11.0.33.0.3"
count: 3
owner: apps
exposure: internal
2 changes: 1 addition & 1 deletion src/patchorder/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def cmd_demo(args: argparse.Namespace) -> int:
if args.llm_preview:
report.llm_preview = preview_json(cve_texts(report.findings), os.environ.get("PATCHORDER_LLM_MODEL", "unset"))
_emit(_render(report, args.format, columns), args.output)
print("patchorder demo: offline, fixtures recorded 2026-10-21 and 2026-11-03", file=sys.stderr)
print("patchorder demo: offline, fixtures recorded 2026-10-21, 2026-11-03 and 2026-11-18", file=sys.stderr)
return _apply_gates(report, gates)


Expand Down
4 changes: 2 additions & 2 deletions src/patchorder/data/demo/MANIFEST.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"recorded": "2026-10-21; Ivanti Connect Secure records, KEV header and the two Ivanti EPSS rows 2026-11-03",
"note": "NVD and KEV bodies are reduced recordings: English description, CVSS base score, and the CPE matches the demo decides. They are not full upstream documents. The EPSS file and KEV catalog header are recorded responses. The CSAF files are fictional (Example CERT and a patchorder fixture), not copies of published advisories. The KEV vulnerabilities array contains 3 of the catalog's published entries (catalog 2026.10.30). The Ivanti Connect Secure rows in the inventory are fictional hosts; the CVE ids, KEV entries, NVD configurations and EPSS scores are real recordings.",
"recorded": "2026-10-21; Ivanti Connect Secure records, KEV header and the two Ivanti EPSS rows 2026-11-03; CVE-2026-114938 NVD record 2026-11-18",
"note": "NVD and KEV bodies are reduced recordings: English description, CVSS base score, and the CPE matches the demo decides. They are not full upstream documents. The EPSS file and KEV catalog header are recorded responses. The CSAF files are fictional (Example CERT and a patchorder fixture), not copies of published advisories. The KEV vulnerabilities array contains 3 of the catalog's published entries (catalog 2026.10.30). The Ivanti Connect Secure and Oracle Java SE rows in the inventory are fictional hosts. The CVE ids, KEV entries, NVD configurations and EPSS scores for the existing demo CVEs are real recordings. CVE-2026-114938 is a recording of the NVD 2.0 document as of 2026-11-18: vulnStatus Received, official Oracle CVSS 3.1 8.1, and the CNA affected version list. NVD published no CPE configurations and FIRST EPSS returned no score, so those fields are omitted rather than invented. The CVE is not in the recorded KEV catalog (and was not in CISA KEV catalog 2026.11.17).",
"sources": {
"nvd_cve": "https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=",
"epss": "https://api.first.org/data/v1/epss",
Expand Down
18 changes: 18 additions & 0 deletions src/patchorder/data/demo/inventory.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,21 @@ entries:
confidence: 1.0
origin: user
note: Pinned for the fictional Harbor Workshop demo.
jdk-app:
cpe: cpe:2.3:a:oracle:jdk
pinned: true
confidence: 1.0
origin: user
note: Pinned for the fictional Harbor Workshop demo.
jdk-app-patched:
cpe: cpe:2.3:a:oracle:jdk
pinned: true
confidence: 1.0
origin: user
note: Pinned for the fictional Harbor Workshop demo.
jdk-11:
cpe: cpe:2.3:a:oracle:jdk
pinned: true
confidence: 1.0
origin: user
note: Pinned for the fictional Harbor Workshop demo.
21 changes: 21 additions & 0 deletions src/patchorder/data/demo/inventory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,24 @@ assets:
count: 1
owner: network
exposure: internal
- id: jdk-app
product: Oracle Java SE
vendor: Oracle
version: "17.0.21.0.3"
count: 5
owner: apps
exposure: internet
- id: jdk-app-patched
product: Oracle Java SE
vendor: Oracle
version: "17.0.21.1"
count: 2
owner: apps
exposure: internet
- id: jdk-11
product: Oracle Java SE
vendor: Oracle
version: "11.0.33.0.3"
count: 3
owner: apps
exposure: internal
133 changes: 133 additions & 0 deletions src/patchorder/data/demo/nvd/CVE-2026-114938.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"resultsPerPage": 1,
"startIndex": 0,
"totalResults": 1,
"format": "NVD_CVE",
"version": "2.0",
"vulnerabilities": [
{
"cve": {
"id": "CVE-2026-114938",
"sourceIdentifier": "[email protected]",
"published": "2026-11-17T22:18:23.777",
"lastModified": "2026-11-18T05:19:00.783",
"vulnStatus": "Received",
"descriptions": [
{
"lang": "en",
"value": "Vulnerability in the Oracle Java SE, Oracle GraalVM for JDK, Oracle GraalVM Enterprise Edition product of Oracle Java SE (component: Compiler). Supported versions that are affected are Oracle Java SE: 8u511b33-perf, 17.0.21.0.3, 21.0.13.0.3, 25.0.5.0.3, 27.0.1.0.3; Oracle GraalVM for JDK: 17.0.21.0.3 and 21.0.13.0.3; Oracle GraalVM Enterprise Edition: 21.3.20.0.3. Difficult to exploit vulnerability allows unauthenticated attacker with network access via multiple protocols to compromise Oracle Java SE, Oracle GraalVM for JDK, Oracle GraalVM Enterprise Edition. Successful attacks of this vulnerability can result in takeover of Oracle Java SE, Oracle GraalVM for JDK, Oracle GraalVM Enterprise Edition. Note: This vulnerability can only be exploited by supplying data to APIs in the specified Component without using Untrusted Java Web Start applications or Untrusted Java applets, such as through a web service. CVSS 3.1 Base Score 8.1 (Confidentiality, Integrity and Availability impacts). CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H)."
}
],
"metrics": {
"cvssMetricV31": [
{
"source": "[email protected]",
"type": "Secondary",
"cvssData": {
"version": "3.1",
"vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H",
"baseScore": 8.1,
"baseSeverity": "HIGH"
}
}
]
},
"affected": [
{
"source": "[email protected]",
"affectedData": [
{
"vendor": "Oracle Corporation",
"product": "Oracle Java SE",
"versions": [
{
"version": "8u511b33-perf",
"status": "affected"
},
{
"version": "17.0.21.0.3",
"status": "affected"
},
{
"version": "21.0.13.0.3",
"status": "affected"
},
{
"version": "25.0.5.0.3",
"status": "affected"
},
{
"version": "27.0.1.0.3",
"status": "affected"
}
]
},
{
"vendor": "Oracle Corporation",
"product": "Oracle GraalVM for JDK",
"versions": [
{
"version": "17.0.21.0.3",
"status": "affected"
},
{
"version": "21.0.13.0.3",
"status": "affected"
}
]
},
{
"vendor": "Oracle Corporation",
"product": "Oracle GraalVM Enterprise Edition",
"versions": [
{
"version": "21.3.20.0.3",
"status": "affected"
}
]
}
]
}
],
"references": [
{
"url": "https://www.oracle.com/security-alerts/cspunov2026.html",
"source": "[email protected]"
},
{
"url": "http://www.openwall.com/lists/oss-security/2026/11/17/31",
"source": "af854a3a-2127-422b-91ae-364da2661108"
},
{
"url": "https://access.redhat.com/security/cve/cve-2026-114938",
"source": "af854a3a-2127-422b-91ae-364da2661108"
},
{
"url": "https://calif.io/java4shell",
"source": "af854a3a-2127-422b-91ae-364da2661108"
},
{
"url": "https://github.com/Azure/azure-functions-java-worker/issues/909",
"source": "af854a3a-2127-422b-91ae-364da2661108"
},
{
"url": "https://github.com/chainguard-dev/cg-skills/pull/17",
"source": "af854a3a-2127-422b-91ae-364da2661108"
},
{
"url": "https://github.com/corretto/corretto-27/blob/27.0.1.1.4/CHANGELOG.md",
"source": "af854a3a-2127-422b-91ae-364da2661108"
},
{
"url": "https://news.ycombinator.com/item?id=50538240",
"source": "af854a3a-2127-422b-91ae-364da2661108"
},
{
"url": "https://www.cisa.gov/news-events/alerts/2026/11/17/critical-java-vulnerability-requires-immediate-patching",
"source": "af854a3a-2127-422b-91ae-364da2661108"
}
]
}
}
]
}
4 changes: 2 additions & 2 deletions src/patchorder/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from patchorder.sources import CSAF_PROVIDER, LiveFetcher

DEMO_ROOT = Path(__file__).resolve().parent / "data" / "demo"
RECORDED = "2026-10-21 (Ivanti Connect Secure records 2026-11-03)"
RECORDED = "2026-10-21 (Ivanti Connect Secure records 2026-11-03; CVE-2026-114938 2026-11-18)"


def utc_now() -> str:
Expand Down Expand Up @@ -46,7 +46,7 @@ def run_demo(as_of: str | None = None) -> Report:
advisories = load_csaf_path(root / "csaf")
sources = [
f"NVD CVE API 2.0: {len(records)} records bundled as fixtures recorded {RECORDED}, "
"reduced to the CPE matches this demo decides. Not a live query.",
"reduced to the version data this demo decides. Not a live query.",
f"CISA KEV: catalog {kev.catalog_version}. {kev.note or str(len(kev.entries)) + ' entries loaded'}".strip(),
"FIRST EPSS: bundled scores. Not a live query.",
"Vulnerability-Lookup: not queried in demo mode. Live scans call cpesearch and then filter versions locally.",
Expand Down
25 changes: 24 additions & 1 deletion src/patchorder/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,29 @@ def _refs(items: object) -> list[str]:
return found


def _cve5_affected_from_nvd(cve: dict) -> list:
"""Lift official CNA affected products out of an NVD 2.0 CVE object.

NVD may publish that list as `affected` entries that already look like
CVE List 5 blocks, or as `{source, affectedData: [...]}` wrappers, before
any CPE `configurations` exist. The matcher still prefers configurations
when both are present.
"""
raw = cve.get("affected")
if not isinstance(raw, list):
return []
blocks: list = []
for item in raw:
if not isinstance(item, dict):
continue
data = item.get("affectedData")
if isinstance(data, list):
blocks.extend(entry for entry in data if isinstance(entry, dict))
elif "vendor" in item or "product" in item or "versions" in item:
blocks.append(item)
return blocks


def from_nvd_cve(cve: dict, source: str = "nvd") -> Record | None:
if not isinstance(cve, dict) or not isinstance(cve.get("id"), str):
return None
Expand All @@ -81,7 +104,7 @@ def from_nvd_cve(cve: dict, source: str = "nvd") -> Record | None:
cve_id=cve["id"],
description=_description(cve.get("descriptions")),
configurations=configurations,
cve5_affected=[],
cve5_affected=_cve5_affected_from_nvd(cve),
cvss=score,
severity=severity,
vector=vector,
Expand Down
Loading
Loading