Security release: upgrade if you verify badges from untrusted sources, publish with openbadges-publish, bake SVG images you did not author, or issue to wallets over OID4VCI. It closes the twelve findings of the November 2026 audit (#335 to #346) and bounds the JSON-LD node map on CPython 3.11 and 3.12.
pip install -U openbadgeslibSecurity
- security(util):
download_fileno longer reads the body of a redirect. urllib drained every 30x body whole before following it, so the 5 MiB cap only guarded the last hop (#335). - security(ob3): a credential with more than 8
credentialStatusentries is refused before anything is fetched, each distinct status list is downloaded once per check, and the recipient is checked before the status, on JWT-VC and Data Integrity alike (#336). - security(publish):
openbadges-publishvalidates the configuredpublic_keyand writes the re-serialised public key; a file holding a private key, or one that is not the public half of the badge'sprivate_key, is refused. A crossed path used to publish the signing key asverify.pem/key.jsonwith exit 0 (#337). If you ever published withpublic_keypointing at the private key, replace the key pair: a republish does not remove the oldverify.pem. - security(did): a did:web identifier is validated before it becomes a URL (only the port's
%3Ais decoded, path components stay encoded, no dot-segments or URL delimiters), and the DID document must carry the DID as itsid(#338). - security(ob2): the HostedBadge
startsWithscope is tested on the path a server resolves: dot segments,//, backslashes, encoded slashes and double encoding are refused (bypass of the #314 fix, #339). - security(baking): the SVG active-content filter covers the whole document: a script outside the first
<svg>,xml-stylesheetprocessing instructions, whitespace inside ajavascript:scheme, SMIL animations ofhref, XHTML elements and the DOCTYPE internal subset no longer survive baking (#340). - security(oid4vci): a
tx_codeattempt is reserved before the guess is verified, so a concurrent burst getstx_code_max_attemptsverifications in total, not one per request in flight (#341); a non-stringtx_codeoraccess_tokenis refused cleanly instead of escaping asAttributeError, and an unexpectedtx_codecosts the same time as any other rejection (#344). - security(cli):
openbadges-signernever writes a badge or a hosted assertion through a symlink planted in the output directory (#342). - security(eudi):
issue_badge_sd_jwtand the wallet-binding path refuse aholder_jwkthat carries private members or is not an asymmetric public key, instead of signing it intocnf(#343). - security(ldp): the subject of an embedded endorsement may carry only
id,typeandendorsementComment(#345), and a blank node label is refused as theidof the credential, its issuer, a subject or a status entry (#346). - security(ldp): on CPython 3.11 and 3.12 the JSON-LD to RDF node map is bounded at 150,000 comparisons.
Known limits
- #345 and #346 are partial. A node the issuer itself describes twice (the issuer again as
achievement.creator, acriteriawith the achievement's id) can still have a member left only in the other description; and on ecdsa-sd-2023 presentations a blank node label is refused only on the credential and its issuer, because the delegate writes such labels on every node without an id. - On a live offer that uses no PIN, a
tx_codeis still answeredinvalid_requestrather than the uniforminvalid_grant.
Compatibility
- A DID document whose
idis not the DID it was resolved for is refused.did_web_from_urlround-trips only for apublish_urlwritten unencoded. OID4VCIStoregainsreserve_tx_attempt, andrecord_tx_failureno longer increments: a custom store must add the method.tx_code_attemptsnow counts verifications run, a successful one included.openbadges-publishrefuses apublic_keythat does not match the badge'sprivate_key.openbadges-signer -Hrefuses (or skips, in a batch) when the.assertion.jsonalready exists, unless--force;--forcereplaces the file by rename, so the new file gets a new badge's mode. The batch JSON may carry anassertion_filekey.bake_svgrefuses a document whose root is not<svg>in the SVG namespace (an<svg>withoutxmlnsincluded).- With
startsWith, paths are compared decoded; an id with a double-encoded escape or a non-UTF-8 escape is out of scope. - An embedded endorsement whose subject carries an extension member is refused on the Data Integrity path.
- With a wrong
expected_recipient, a status failure is now reported as a recipient mismatch.
The complete entries are in the Changelog.
Verification
Before tagging: flake8 and mypy clean and 3,309 tests passing on the tagged tree with no skips (OPENBADGES_REQUIRE_LDP_SD=1, OPENBADGES_REQUIRE_OID4VCI=1; CPython 3.14.10, openvc-core 1.35.0, pyld 3.3.0), and the same suite on CPython 3.10, 3.11, 3.12 and 3.13 with openvc-core 1.38.1 (3,308 to 3,309 passed; the skips are the opt-in Docker conformance module and, on 3.10, a tomllib doc check). CI on the pull request (#347): the 3.10 to 3.15 matrix, the Windows leg and both [eudi] legs green. CI on the tagged commit: the 3.10 to 3.15 matrix, the Windows leg and both [eudi] legs green, PyPI publish succeeded; pip install openbadgeslib==4.6.4 into a clean CPython 3.13 environment imports and reports 4.6.4. Not run: the Linux/Docker conformance validators. Each fix was written test-first and reviewed against its issue's reproduction; no independent adversarial review round preceded this release.
Full details in Changelog.txt.