Repository navigation
v4.6.3
Security release: upgrade if you verify or sign OB 3.0 Data Integrity (LDP) badges, or run verification in threads. GHSA-9x82-7w46-cxf9 (high) affects 3.2.0 to 4.6.2. The verifier did its expensive work before checking the signature, on a document nobody had authenticated: a few KB of crafted blank nodes cost 15 to 40 s of CPU, 258 KB of repeated types 9 to 15 s, and an ecdsa-sd-2023 credential tens of seconds to minutes. pyld's shared caches were not thread-safe (4.6.2 failed about 90% of the verifications of 8 threads), and an inline @import could rewrite a pinned context for the whole process through the low-level functions.
pip install -U openbadgeslibSecurity
- security(ldp): RDF canonicalization runs through
ob3/_canon_guard.pyunder a work budget and a CPU allowance (pyld's own URDNA2015 with a per-call meter); the duplicate checks of the JSON-LD to RDF conversion are counted and capped;[ldp]and[ldp-sd]requirepyld<4, and the guard fails closed (OB3GuardUnavailable) on a pyld it was not calibrated for. - security(ldp):
ob3/_structure_screen.pybounds type multiplicity, typed objects, type entries (every term with a scoped context counts per value), objects,@contextentries and nesting depth before any JSON-LD processing, and refuses an inline@import. - security(ldp): pyld's context caches are kept per thread; the inverse-context cache and
fork()are guarded by a narrow lock; an exception out of pyld drops the cache it may have torn. - security(ldp): ecdsa-sd-2023: the screen, the statement count and the mandatory-statement check read the dataset openvc-core verifies, under the budget; a credential of more than 1,600 statements, or one openvc-core cannot canonicalize, is refused before the delegate runs; the delegate runs under the process lock.
- security(deps):
cryptography>=50(45.0.0 is yanked; CVE-2026-69249 was reachable throughverify_badge_sd_jwt(x5c_trust_anchors=...)) and a weekly audit of the declared floors. - fix: hostile JWS/JWT/OB1/OB2/OID4VCI inputs end in the library's own errors (new
_safejson: depth, lone surrogates, non-finite numbers);download_fileenforces its 60 second budget;openbadges-verifier --jsonalways prints one valid JSON object.
Known limit
On CPython 3.11 and 3.12 a crafted document of about 28 KB inside every limit can still cost 5 to 10 s of CPU at some caller stack depths (a CPython data-stack-chunk behaviour; 3.10 and 3.13 to 3.15 are not affected). Mitigated, not closed: run verification workers with a CPU limit on those interpreters. Details in Changelog.txt and the Security Model wiki page.
Compatibility
Documents over the new limits are refused (OB3VerificationError, ErrorSigningFile when signing): symmetric blank-node groups beyond a few identical siblings, more than about 1,400 distinct values in one property, more than 1,600 typed objects, CLRs of more than a couple of hundred embedded signed members (split them), ecdsa-sd-2023 credentials of more than 1,600 statements. Legitimate verification is 15 to 25% slower and signing about 45% slower. The cryptography floor and the pyld ceiling act as pins. The complete list is the "Compatibility" entry of the Changelog.
Verification
Before tagging: flake8 and mypy clean and 2,799 tests passing (no unexpected skips; OPENBADGES_REQUIRE_LDP_SD=1, OPENBADGES_REQUIRE_OID4VCI=1) on CPython 3.10, 3.11, 3.12, 3.13, 3.14 and 3.15rc, with openvc-core 1.37.0 and, on 3.12, the 1.35.0 floor. CI on the tagged commit: the 3.10 to 3.15 matrix and the [eudi] floor and latest legs green, PyPI publish succeeded. The Windows core-only leg failed on three tests that sign a document without skipping when pyld is absent (a test defect, the package is unaffected); it is fixed in 598a57b. The Linux/Docker pre-run was not done (no Docker daemon). Two rounds of independent adversarial review (every finding re-run by a second reviewer) preceded the release.
Full details in Changelog.txt.