Skip to content

Update cryptography requirement from >=48.0.1 to >=50.0.0 in /backend - #4819

Open
dependabot[bot] wants to merge 2 commits into
mainfrom
dependabot/pip/backend/cryptography-gte-50.0.0
Open

Update cryptography requirement from >=48.0.1 to >=50.0.0 in /backend#4819
dependabot[bot] wants to merge 2 commits into
mainfrom
dependabot/pip/backend/cryptography-gte-50.0.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Aug 27, 2026

Copy link
Copy Markdown
Contributor

Updates the requirements on cryptography to permit the latest version.

Changelog

Sourced from cryptography's changelog.

50.0.0 - 2026-07-31


* **SECURITY ISSUE**:
  :func:`~cryptography.hazmat.primitives.serialization.pkcs7.pkcs7_decrypt_der`
  and its PEM and S/MIME variants no longer expose distinguishable errors or
  timing when unwrapping a ``RecipientInfo``'s ``encryptedKey``, which could
  act as a Bleichenbacher oracle for callers that decrypt untrusted messages.
  A random key is now substituted on failure, as described in :rfc:`3218`.
  Credit to **@X1AOxiang** for reporting the issue. **CVE-2026-69247**
* Deprecated Diffie-Hellman key exchange over finite fields (FFDH).
  Everything FFDH is deprecated, including the types in
  ``cryptography.hazmat.primitives.asymmetric.dh`` and loading FFDH keys or
  parameters with the key loading APIs. Users should migrate to a more
  modern key exchange algorithm.
* Added ``xof()`` class methods to
  :class:`~cryptography.hazmat.primitives.hashes.SHAKE128` and
  :class:`~cryptography.hazmat.primitives.hashes.SHAKE256` for constructing
  algorithm instances configured for use with
  :class:`~cryptography.hazmat.primitives.hashes.XOFHash`.
* The :mod:`X.509 verification <cryptography.x509.verification>` APIs are now
  considered stable and are subject to our API stability policy.
* Added the :doc:`/cobblestone` recipe, an implementation of the
  Cobblestone-128 and Cobblestone-256 instantiations of the `C2SP
  chunked-encryption specification
  <https://c2sp.org/chunked-encryption>`_ for streaming authenticated
  encryption of large messages.
* Parsing a Signed Certificate Timestamp list now rejects encodings that
  carry trailing bytes after the list or after an individual SCT, instead of
  silently ignoring them.
* Added support for using :class:`~cryptography.x509.Name` as a field type in
  the :doc:`/hazmat/asn1/index` module.
* Loading a public key or an EC private key now rejects DER where the
  ``subjectPublicKey`` (or EC ``publicKey``) ``BIT STRING`` declares a non-zero
  number of unused bits, instead of silently ignoring it.
* Parsing a CRL entry's ``InvalidityDate`` extension now rejects a
  ``GeneralizedTime`` that carries fractional seconds or another non-DER form,
  matching the strict encoding already required for every other X.509 time
  field.
* :func:`~cryptography.x509.ocsp.load_der_ocsp_request` and
  :func:`~cryptography.x509.ocsp.load_der_ocsp_response` now reject a request
  or response whose ``version`` field is not ``v1``, the only version defined
  by RFC 6960, matching the version validation already performed when loading
  certificates, CSRs and CRLs.
* :class:`~cryptography.hazmat.primitives.hashes.XOFHash` is now supported
  when building against AWS-LC.
* HMAC (and therefore PBKDF2-HMAC) with SHA-3 hashes is now supported when
  building against AWS-LC.
* Diffie-Hellman (:doc:`/hazmat/primitives/asymmetric/dh`) is now supported
  when building against AWS-LC.
</tr></table> 

... (truncated)

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [cryptography](https://github.com/pyca/cryptography) to permit the latest version.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](pyca/cryptography@48.0.1...50.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 50.0.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies python Pull requests that update Python code labels Aug 27, 2026
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pycon Ready Ready Preview Aug 27, 2026 3:19pm

@marcoacierno

Copy link
Copy Markdown
Member

@claude update the lock file

Remember you can rely on CI to run the full test suite

In your recap, assert how safe this upgrade is

@claude

claude Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @marcoacierno's task in 3m 19s —— View job


Lock file updated ✅

  • Gather context (read PR diff + backend/pyproject.toml)
  • Check current cryptography pin in backend/uv.lock
  • Run uv lock to regenerate the lock file
  • Audit repo usage of cryptography against 50.0.0 breaking changes
  • Run backend checks (mypy / ruff / relevant tests)
  • Commit & push (459cc67)
  • Recap with a safety assessment

What changed

uv lock resolved cleanly — cryptography 48.0.1 → 50.0.1, and nothing else moved:

Resolved 236 packages in 916ms
Updated cryptography v48.0.1 -> v50.0.1

The only non-wheel-hash lines in the uv.lock diff are the version and the requires-dist specifier:

-    { name = "cryptography", specifier = ">=48.0.1" },
+    { name = "cryptography", specifier = ">=50.0.0" },
-version = "48.0.1"
+version = "50.0.1"

Note it landed on 50.0.1, not 50.0.0 — that's the newest patch (uploaded 2026-08-25) and it satisfies the >=50.0.0 floor.

Safety assessment: safe to merge — high confidence

I'll be concrete about why, because "major version bump" normally warrants caution and here it genuinely doesn't.

1. Nothing in this repo imports cryptography directly. A grep across backend/**/*.py for cryptography, hazmat, pkcs7, serialization, and x509 returns zero real hits. The only x509 matches are auth_provider_x509_cert_url — a Django URLField in google_api/models.py:53, i.e. a string column, not a certificate parse.

2. Every 50.0.0 breaking change is in a code path we don't reach. Going through the changelog item by item:

50.0.0 change Our exposure
PKCS#7 Bleichenbacher oracle fix (CVE-2026-69247) None — no pkcs7 usage anywhere
FFDH / asymmetric.dh deprecated None — no DH usage
Stricter SCT-list, InvalidityDate, OCSP version, BIT STRING unused-bits parsing None — we never load certs, CRLs, or OCSP responses
xof() on SHAKE128/256, Cobblestone recipe, AWS-LC additions Purely additive

3. The transitive consumers all declare it under optional extras that we don't enable. This is the part I checked most carefully, since a transitive pin is the usual way a bump like this bites:

PyJWT       -> cryptography>=3.4.0   ; extra == "crypto"
celery      -> cryptography==46.0.5  ; extra == "auth"
django-ses  -> cryptography>=36.0.2  ; extra == "bounce" or extra == "events"
google-auth -> cryptography>=38.0.3  ; extra == "pyopenssl" / "enterprise-cert"
oauthlib    -> cryptography>=3.0.0   ; extra == "rsa" / "signedtoken"
pypdf       -> cryptography>3.0      ; extra == "crypto"
redis       -> cryptography>=36.0.1  ; extra == "ocsp"

pyproject.toml installs celery==5.6.3, django-ses==4.1.1, redis[hiredis]==8.1.0, PyJWT>=2.8.0, pypdf>=6.13.3none of those extras are enabled. That matters most for celery, which pins cryptography==46.0.5 exactly; because celery[auth] isn't installed, that pin is inert and doesn't conflict with 50.x. (uv resolving without a conflict confirms it.)

4. The one live crypto path is unaffected. Password-reset tokens use JWT with HS256 (api/users/mutations/request_reset_password.py:61, api/users/mutations/reset_password.py:38) — HMAC-SHA256, which PyJWT implements in pure Python via hashlib and never routes through cryptography. The 89 tests in api/users/tests/ pass.

Verification run

Check Result
uv sync cryptography==48.0.1cryptography==50.0.1, imports fine (bundled OpenSSL 4.0.2)
uv run pytest visa/tests/test_tasks.py api/users/tests/ 89 passed
uv run pytest google_api/ integrations/ pretix/ 73 passed
uv run python manage.py check --settings=pycon.settings.test App loads; 5 pre-existing fields.E010 I18n-default notices
uv run mypy . 3 errors — pre-existing
ruff check / ruff format --check 1 unused import + 19 files needing reformat — pre-existing

I picked visa/ (the pypdf/PDF path) and google_api/+integrations/+pretix/ (the OAuth/HTTP paths) as the modules most likely to touch crypto indirectly. Leaving the full suite to CI as you suggested.

On the mypy/ruff failures: they're not from this PR. git status shows the working tree only modified backend/uv.lock, and git diff --name-only origin/main...HEAD shows only backend/pyproject.toml — every Python source file is byte-identical to main. The failures are in badge_scanner/models.py, sponsors/tests/test_tasks.py, submissions/tests/*, visa/tests/test_tasks.py and friends, all untouched here.

Two things worth knowing (neither blocks merge)

Wheel platform coverage narrowed. 48.0.1 shipped macosx_10_9_universal2 and win32 wheels; 50.0.1 ships macosx_11_0_arm64 and win_amd64 only. So there's no prebuilt macOS x86_64 wheel any more — anyone developing on an Intel Mac outside Docker would have to build from sdist, which needs a Rust toolchain. Doesn't affect CI, Docker, or production (all linux x86_64/aarch64, fully covered).

Dependabot will stop auto-rebasing this PR, since its description says it only resolves conflicts "as long as you don't alter it yourself" and I've now pushed to the branch. If it goes stale, @dependabot recreate will rebuild it — though that would also drop this lock file commit, so it'd need redoing.

Not done

I didn't run the full backend test suite or the frontend checks — the frontend is untouched by this change, and per your note the full suite is CI's job. The Vercel failure showing above predates this commit and is a frontend deployment, unrelated to a Python dependency.
Branch: dependabot/pip/backend/cryptography-gte-50.0.0

Regenerates backend/uv.lock to match the pyproject.toml bump.
Resolves cryptography 48.0.1 -> 50.0.1; no other packages changed.

Co-authored-by: Marco Acierno <3382153+marcoacierno@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant