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
9,571 changes: 950 additions & 8,621 deletions .github/dapper-headers.json

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions .github/dapper-unfixed.json
Original file line number Diff line number Diff line change
Expand Up @@ -3829,6 +3829,34 @@
"scanRunId": 41327670634,
"scanArtifactId": 13091519384,
"scanArtifactSha256": "cb34b687d30a498064e8144fcc293944ce964e4c605da21cbe8ba34570706847"
},
{
"id": "CVE-2026-120208",
"package": "libheif1",
"version": "1.21.2-3ubuntu0.6",
"purl": "pkg:deb/ubuntu/libheif1@1.21.2-3ubuntu0.6?arch=amd64&distro=ubuntu-26.04",
"severity": "MEDIUM",
"status": "no_official_fix",
"officialEvidence": "https://git.launchpad.net/ubuntu-cve-tracker/plain/active/CVE-2026-120208",
"officialRawSha256": "348ecd6212deeb033109409c9faf52201a32d52c7cc2d07a82bc5dd5f6c1becd",
"officialUbuntuStatus": "needed",
"officialSourcePackage": "libheif",
"reason": "Official Ubuntu CVE tracker resolute_libheif: needed; no official fixed version. Exact existing disposable-builder package only; no general severity exemption.",
"checkedAt": "2026-11-05"
},
{
"id": "CVE-2026-120208",
"package": "libheif-plugin-aomdec",
"version": "1.21.2-3ubuntu0.6",
"purl": "pkg:deb/ubuntu/libheif-plugin-aomdec@1.21.2-3ubuntu0.6?arch=amd64&distro=ubuntu-26.04",
"severity": "MEDIUM",
"status": "no_official_fix",
"officialEvidence": "https://git.launchpad.net/ubuntu-cve-tracker/plain/active/CVE-2026-120208",
"officialRawSha256": "348ecd6212deeb033109409c9faf52201a32d52c7cc2d07a82bc5dd5f6c1becd",
"officialUbuntuStatus": "needed",
"officialSourcePackage": "libheif",
"reason": "Official Ubuntu CVE tracker resolute_libheif: needed; no official fixed version. Exact existing disposable-builder package only; no general severity exemption.",
"checkedAt": "2026-11-05"
}
]
}
4 changes: 2 additions & 2 deletions .github/scripts/check-builder-header-boundary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if ! docker run --rm --entrypoint sh "$1" -ec 'dpkg-query -W -f="\${Status}" lin
exit 0
fi
docker run --rm --entrypoint sh "$1" -ec '
test "$(dpkg-query -W -f="\${Version}" linux-libc-dev)" = 7.0.0-38.38
test "$(dpkg-query -W -f="\${Version}" linux-libc-dev)" = 7.0.0-42.42
if dpkg-query -W -f="\${db:Status-Abbrev} \${binary:Package}\\n" |
awk "\$1 == \"ii\" {print \$2}" | grep -Eq "^linux-(image|modules)([-:]|$)"; then
echo "Unexpected kernel runtime package" >&2; exit 1
Expand All @@ -25,4 +25,4 @@ docker run --rm --entrypoint sh "$1" -ec '
fi
done
'
printf '%s\n' '{"package":"linux-libc-dev","version":"7.0.0-38.38","kernel_images":false,"kernel_modules":false}'
printf '%s\n' '{"package":"linux-libc-dev","version":"7.0.0-42.42","kernel_images":false,"kernel_modules":false}'
119 changes: 119 additions & 0 deletions .github/scripts/check_builder_apt_fixed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
"""Verify the exact official APT fix and native Trivy delta; never filter findings."""
import argparse
from collections import Counter
from copy import deepcopy
import json
from pathlib import Path

ROOT = Path(__file__).resolve().parents[2]
CVE = "CVE-2026-109518"
VERSION = "3.2.1ubuntu0.1"
PURLS = {name: "pkg:deb/ubuntu/" + name + "@" + VERSION + "?arch=amd64&distro=ubuntu-26.04"
for name in ("apt", "libapt-pkg7.0")}
SHAS = {"apt": "0de729b8fe0e1c67c04e8e8d5bd6e0420dbd47f75b93f0b71c8e740edc2d5ffc",
"libapt-pkg7.0": "94e5d41303265b66af0f8c70ade18bfb77260ad286edee6c8045faddef82b94c"}


def validate_vex(vex):
if (set(vex) != {"@context", "@id", "author", "timestamp", "version", "statements"}
or vex["@context"] != "https://openvex.dev/ns/v0.2.0"
or vex["@id"] != "https://github.com/PastureStack/compose-cli/security/dapper/apt-usn-8996-1"
or vex["author"] != "PastureStack contributors" or vex["version"] != 1
or vex["timestamp"] != "2026-11-05T00:00:00Z" or len(vex["statements"]) != 1):
raise ValueError("Exact Compose fixed document required")
statement = vex["statements"][0]
if (set(statement) != {"vulnerability", "products", "status", "impact_statement"}
or statement["vulnerability"] != {"name": CVE} or statement["status"] != "fixed"
or Counter(json.dumps(p, sort_keys=True) for p in statement["products"])
!= Counter(json.dumps({"@id": p}, sort_keys=True) for p in PURLS.values())
or "https://ubuntu.com/security/notices/USN-8996-1" not in statement["impact_statement"]
or not all(sha in statement["impact_statement"] for sha in SHAS.values())):
raise ValueError("Only the exact official fixed APT pair is permitted")


def exact_finding(finding):
name = finding.get("PkgName")
return (finding.get("VulnerabilityID") == CVE and name in PURLS
and finding.get("InstalledVersion") == VERSION
and (finding.get("PkgIdentifier") or {}).get("PURL") == PURLS[name])


def validate(raw, effective, dpkg, vex):
validate_vex(vex)
installed = {}
for line in dpkg.splitlines():
fields = line.split("\t")
if len(fields) == 2 and fields[0].split(":")[0] in PURLS:
name = fields[0].split(":")[0]
if name in installed:
raise ValueError("Duplicate APT package")
installed[name] = fields[1]
if installed != dict.fromkeys(PURLS, VERSION):
raise ValueError("Actual installed fixed pair required")
if (raw.get("SchemaVersion") != 2 or effective.get("SchemaVersion") != 2
or not raw.get("Results") or not effective.get("Results")):
raise ValueError("Both original complete native reports are required")
packages = {}
for result in raw["Results"]:
if result.get("Type") == "ubuntu":
for package in result.get("Packages", []):
name = package.get("Name")
if name in PURLS:
if name in packages:
raise ValueError("Duplicate analyzed APT package")
packages[name] = (package.get("Version"), (package.get("Identifier") or {}).get("PURL"))
if packages != {name: (VERSION, purl) for name, purl in PURLS.items()}:
raise ValueError("Actual Ubuntu scan package identity required")
def sections(report):
values = {}
for result in report["Results"]:
key = (result.get("Target"), result.get("Class"), result.get("Type"))
if key in values:
raise ValueError("Duplicate scan section")
value = dict(result)
findings = value.pop("Vulnerabilities", []) or []
if not isinstance(findings, list):
raise ValueError("Malformed findings")
# Native output may reorder packages or findings; compare every record.
if "Packages" in value:
normalized = []
for package in value["Packages"]:
package = deepcopy(package)
# Trivy's per-scan UID is not a package identity. A second
# native scan may also materialize this derived ID.
if package.get("ID") == str(package.get("Name")) + "@" + str(package.get("Version")):
package.pop("ID")
if isinstance(package.get("Identifier"), dict):
package["Identifier"].pop("UID", None)
normalized.append(package)
value["Packages"] = sorted(normalized, key=lambda x: json.dumps(x, sort_keys=True))
values[key] = (value, findings)
return values
original, native = sections(raw), sections(effective)
if original.keys() != native.keys():
raise ValueError("Native scan section drift")
removed = 0
for key, (metadata, findings) in original.items():
new_metadata, new_findings = native[key]
if metadata != new_metadata or any(exact_finding(item) for item in new_findings):
raise ValueError("Native fix or package/secret metadata mismatch")
retained = [item for item in findings if not (key[2] == "ubuntu" and exact_finding(item))]
removed += len(findings) - len(retained)
if Counter(json.dumps(x, sort_keys=True) for x in retained) != Counter(json.dumps(x, sort_keys=True) for x in new_findings):
raise ValueError("Unrelated finding changed by native VEX")
if removed > 2:
raise ValueError("Duplicate fixed occurrence")
return {"status": "PASS_EXACT_COMPOSE_NATIVE_APT_FIXED_VEX", "fixedOccurrences": removed,
"packageVersions": installed, "purls": PURLS, "nativeTrivyFilter": True,
"pythonFiltered": False, "rawReportPreserved": True, "runtimePass": False}


if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--raw", type=Path, required=True)
parser.add_argument("--native", type=Path, required=True)
parser.add_argument("--dpkg", type=Path, required=True)
args = parser.parse_args()
proof = validate(json.loads(args.raw.read_text()), json.loads(args.native.read_text()),
args.dpkg.read_text(), json.loads((ROOT / "security/dapper-apt.openvex.json").read_text()))
print(json.dumps(proof, indent=2))
24 changes: 17 additions & 7 deletions .github/scripts/enforce-builder-vulnerabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from pathlib import Path

REPOSITORY = "PastureStack/compose-cli"
HEADER_VERSION = "7.0.0-38.38"
HEADER_PURL = "pkg:deb/ubuntu/linux-libc-dev@7.0.0-38.38?arch=amd64&distro=ubuntu-26.04"
HEADER_VERSION = "7.0.0-42.42"
HEADER_PURL = "pkg:deb/ubuntu/linux-libc-dev@7.0.0-42.42?arch=amd64&distro=ubuntu-26.04"


def violations(report, ledger, boundary, headers):
Expand All @@ -31,19 +31,25 @@ def violations(report, ledger, boundary, headers):
refreshed = {}
for entry in refresh.get("entries", []):
identifier = entry.get("id")
official = ("https://raw.githubusercontent.com/canonical/ubuntu-security-notices/"
+ str(refresh.get("officialSnapshot")) + "/osv/cve/2026/UBUNTU-"
+ str(identifier) + ".json")
official = 'https://git.launchpad.net/ubuntu-cve-tracker/plain/active/' + str(identifier)
if (identifier in refreshed or identifier not in headers.get("ids", [])
or entry.get("package") != "linux-libc-dev" or entry.get("version") != HEADER_VERSION
or entry.get("purl") != HEADER_PURL or entry.get("severity") != "MEDIUM"
or entry.get("decision") != "UNFIXED_MEDIUM_HEADER_ONLY"
or entry.get("officialFixedVersions") != []
or entry.get("officialRangeEvents") != [{"introduced": "0"}]
or refresh.get("sourceKind") != "UBUNTU_CVE_TRACKER_ACTIVE"
or entry.get("officialUbuntuSeries") != "resolute"
or entry.get("officialUbuntuStatus") != "needed"
or entry.get("officialPriority") != ["medium"]
or entry.get("sourcePackage") != "linux"
or entry.get("officialUrl") != official
or not entry.get("rawSha256") or not entry.get("target")):
raise ValueError("Invalid exact medium header refresh")
refreshed[identifier] = entry
medium_only = headers.get("mediumSeverityOnlyIds", [])
if (not isinstance(medium_only, list) or len(medium_only) != len(set(medium_only))
or not set(medium_only).issubset(headers.get("ids", []))):
raise ValueError("Invalid exact medium-only header ceiling")
reviewed = {}
for entry in ledger.get("unfixed", []):
key = (entry["id"], entry["package"], entry["version"], entry["purl"])
Expand All @@ -66,13 +72,17 @@ def violations(report, ledger, boundary, headers):
finding.get("InstalledVersion"), (finding.get("PkgIdentifier") or {}).get("PURL", ""))
fixed = str(finding.get("FixedVersion") or "").strip()
if key[1] == "linux-libc-dev":
if key[2] != HEADER_VERSION or key[3] != HEADER_PURL:
errors.append("Header finding does not match current exact installed42 proof")
continue
expected = {"package": "linux-libc-dev", "version": HEADER_VERSION,
"kernel_images": False, "kernel_modules": False}
if boundary != expected:
raise ValueError("Missing exact installed header-only proof")
if (not fixed and key[0] in headers.get("ids", [])
and key[2] == HEADER_VERSION and key[3] == HEADER_PURL
and (key[0] not in refreshed or finding.get("Severity") == "MEDIUM")):
and (key[0] not in refreshed and key[0] not in medium_only
or finding.get("Severity") == "MEDIUM")):
continue
severity = finding.get("Severity", "UNKNOWN")
entry = reviewed.get(key)
Expand Down
112 changes: 112 additions & 0 deletions .github/scripts/test_builder_apt_fixed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import importlib.util
import json
from copy import deepcopy
from pathlib import Path
import unittest

spec = importlib.util.spec_from_file_location("apt_fixed", Path(__file__).with_name("check_builder_apt_fixed.py"))
gate = importlib.util.module_from_spec(spec)
spec.loader.exec_module(gate)


class AptFixedTest(unittest.TestCase):
def setUp(self):
self.vex = json.loads((gate.ROOT / "security/dapper-apt.openvex.json").read_text())
self.raw = {"SchemaVersion": 2, "Results": [{"Target": "ubuntu", "Class": "os-pkgs", "Type": "ubuntu",
"Packages": [{"Name": name, "Version": gate.VERSION, "Identifier": {"PURL": purl}}
for name, purl in gate.PURLS.items()],
"Vulnerabilities": [{"VulnerabilityID": gate.CVE, "PkgName": name,
"InstalledVersion": gate.VERSION, "Severity": "HIGH", "PkgIdentifier": {"PURL": purl}}
for name, purl in gate.PURLS.items()]}]}
self.native = deepcopy(self.raw)
self.native["Results"][0]["Vulnerabilities"] = []
self.dpkg = "".join(name + "\t" + gate.VERSION + "\n" for name in gate.PURLS)

def check(self):
return gate.validate(self.raw, self.native, self.dpkg, self.vex)

def test_native_fixed_pair_and_unrelated_findings_are_exact(self):
finding = {"VulnerabilityID": "UNRELATED", "Severity": "HIGH"}
for report in (self.raw, self.native):
report["Results"][0]["Vulnerabilities"].append(deepcopy(finding))
self.assertEqual(self.check()["fixedOccurrences"], 2)
self.native["Results"][0]["Packages"][0]["Identifier"]["UID"] = "new-native-scan"
self.native["Results"][0]["Packages"][0]["ID"] = "apt@" + gate.VERSION
self.assertEqual(self.check()["fixedOccurrences"], 2)
# A refreshed database need not repeat a vendor-fixed finding.
self.raw["Results"][0]["Vulnerabilities"] = [finding]
self.assertEqual(self.check()["fixedOccurrences"], 0)

def test_proven_pip_owner_precedes_strict_apt_delta_without_dropping_other_layers(self):
import sys
scripts = str(gate.ROOT / 'scripts/pip-security')
sys.path.insert(0, scripts)
try:
spec = importlib.util.spec_from_file_location('pip_boundary_fixture',
gate.ROOT / 'scripts/pip-security/test-pip-vex.py')
fixture_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(fixture_module)
fixture = fixture_module.VexBoundary('test_exact_slice_only')
fixture.setUp() # Pure existing fixture; not a physical image proof.
self.raw['Results'].append(deepcopy(fixture.raw['Results'][0]))
self.native['Results'].append(deepcopy(fixture.raw['Results'][0]))
for report, layer in ((self.raw, 'first-sbom-layer'), (self.native, 'second-sbom-layer')):
for finding in report['Results'][-1]['Vulnerabilities']:
finding['Layer'] = {'DiffID': layer}
finding['PkgIdentifier']['UID'] = layer
with self.assertRaises(ValueError):
self.check() # Actual old ordering must reject differing layer attribution.
pip = fixture_module.vex
before = deepcopy(self.raw)
qualified_raw, _ = pip.apply(self.raw, fixture.proof, 'urn:test:same-image')
qualified_native, _ = pip.apply(self.native, fixture.proof, 'urn:test:same-image')
self.assertEqual(self.raw, before)
self.assertEqual(gate.validate(qualified_raw, qualified_native, self.dpkg, self.vex)['fixedOccurrences'], 2)
invalid_proof = deepcopy(fixture.proof)
invalid_proof['vendorFilesByteCompared'] = 298
with self.assertRaises(ValueError):
pip.apply(self.raw, invalid_proof, 'urn:test:same-image')
unrelated = {'VulnerabilityID': 'UNRELATED', 'Severity': 'HIGH',
'Layer': {'DiffID': 'must-stay-exact'}}
for report in (qualified_raw, qualified_native):
report['Results'][0]['Vulnerabilities'].append(deepcopy(unrelated))
self.assertEqual(gate.validate(qualified_raw, qualified_native, self.dpkg, self.vex)['fixedOccurrences'], 2)
qualified_native['Results'][0]['Vulnerabilities'][0]['Layer']['DiffID'] = 'changed'
with self.assertRaises(ValueError):
gate.validate(qualified_raw, qualified_native, self.dpkg, self.vex)
qualified_native['Results'][0]['Vulnerabilities'] = [deepcopy(unrelated), deepcopy(unrelated)]
with self.assertRaises(ValueError):
gate.validate(qualified_raw, qualified_native, self.dpkg, self.vex)
finally:
sys.path.remove(scripts)

def test_status_identity_scope_and_unrelated_delta_fail_closed(self):
original = deepcopy(self.vex)
for field, value in (("status", "not_affected"), ("vulnerability", {"name": "OTHER"}),
("products", [{"@id": "pkg:deb/ubuntu/apt@3.2.0?arch=amd64&distro=ubuntu-26.04"}]),
("products", [{"@id": gate.PURLS["apt"].replace("amd64", "arm64")}]),
("products", [{"@id": gate.PURLS["apt"].replace("ubuntu-26.04", "ubuntu-24.04")}]),
("products", [{"@id": "pkg:deb/ubuntu/*"}])):
self.vex = deepcopy(original)
self.vex["statements"][0][field] = value
with self.subTest(field=field, value=value), self.assertRaises(ValueError):
self.check()
self.vex = original
self.dpkg = self.dpkg.replace(gate.VERSION, "3.2.0", 1)
with self.assertRaises(ValueError): self.check()
self.setUp()
self.raw["Results"][0]["Packages"][0]["Version"] = "3.2.0"
with self.assertRaises(ValueError): self.check()
self.setUp()
self.native["Results"][0]["Vulnerabilities"] = [deepcopy(self.raw["Results"][0]["Vulnerabilities"][0])]
with self.assertRaises(ValueError): self.check()
self.setUp()
self.raw["Results"][0]["Vulnerabilities"].append({"VulnerabilityID": "OTHER", "Severity": "CRITICAL"})
with self.assertRaises(ValueError): self.check()
self.setUp()
self.raw["Results"][0]["Secrets"] = [{"RuleID": "secret"}]
with self.assertRaises(ValueError): self.check()


if __name__ == "__main__":
unittest.main()
Loading
Loading