pypi openbadgeslib 4.6.4
v4.6.4

latest release: 4.6.5
10 days ago

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 openbadgeslib

Security

  • security(util): download_file no 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 credentialStatus entries 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-publish validates the configured public_key and writes the re-serialised public key; a file holding a private key, or one that is not the public half of the badge's private_key, is refused. A crossed path used to publish the signing key as verify.pem / key.json with exit 0 (#337). If you ever published with public_key pointing at the private key, replace the key pair: a republish does not remove the old verify.pem.
  • security(did): a did:web identifier is validated before it becomes a URL (only the port's %3A is decoded, path components stay encoded, no dot-segments or URL delimiters), and the DID document must carry the DID as its id (#338).
  • security(ob2): the HostedBadge startsWith scope 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-stylesheet processing instructions, whitespace inside a javascript: scheme, SMIL animations of href, XHTML elements and the DOCTYPE internal subset no longer survive baking (#340).
  • security(oid4vci): a tx_code attempt is reserved before the guess is verified, so a concurrent burst gets tx_code_max_attempts verifications in total, not one per request in flight (#341); a non-string tx_code or access_token is refused cleanly instead of escaping as AttributeError, and an unexpected tx_code costs the same time as any other rejection (#344).
  • security(cli): openbadges-signer never writes a badge or a hosted assertion through a symlink planted in the output directory (#342).
  • security(eudi): issue_badge_sd_jwt and the wallet-binding path refuse a holder_jwk that carries private members or is not an asymmetric public key, instead of signing it into cnf (#343).
  • security(ldp): the subject of an embedded endorsement may carry only id, type and endorsementComment (#345), and a blank node label is refused as the id of 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, a criteria with 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_code is still answered invalid_request rather than the uniform invalid_grant.

Compatibility

  • A DID document whose id is not the DID it was resolved for is refused. did_web_from_url round-trips only for a publish_url written unencoded.
  • OID4VCIStore gains reserve_tx_attempt, and record_tx_failure no longer increments: a custom store must add the method. tx_code_attempts now counts verifications run, a successful one included.
  • openbadges-publish refuses a public_key that does not match the badge's private_key.
  • openbadges-signer -H refuses (or skips, in a batch) when the .assertion.json already exists, unless --force; --force replaces the file by rename, so the new file gets a new badge's mode. The batch JSON may carry an assertion_file key.
  • bake_svg refuses a document whose root is not <svg> in the SVG namespace (an <svg> without xmlns included).
  • 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.

Don't miss a new openbadgeslib release

NewReleases is sending notifications on new releases.