| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@c00kiemon5ter Is there anything you need or I could help you with to bring this forward? |
Sorry, something went wrong.
This PR upgrade pyopenssl dependency. Current constraints is `<24.3.0`(up to 24.2.x). New constratints is `<24.4.0`(up to 24.3.x). This PR is for addressing security alert `GHSA-79v4-65xg-pq4g`. GHSA-79v4-65xg-pq4g // I guess this constratints is for pyopenssl->cryptography migration. IdentityPython#977 IdentityPython@735bfa5
|
Hi ! At work we use @prauscher branch in production on multiple backends since yesterday with Python@3.13 and djangosaml2@1.10.1 and it works like a charm. I hope this small datapoint will give more confidence to merge this PR :) |
Sorry, something went wrong.
|
I also merged @prauscher branch to our repo and, with my exception above, have seen no problems. Thanks! |
Sorry, something went wrong.
|
Thanks @johanlundberg, my new commit should eliminiate these problems |
Sorry, something went wrong.
|
Working great for us too! Just noting that for since the deps have been updated, the poetry.lock file also needs to be regenerated. poetry lock --no-update gives me this patch (I'd make a suggested change, but Github won't let me 😄) diff --git a/poetry.lock b/poetry.lock
index 93e08556..6357d2b7 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1248,24 +1248,6 @@ snappy = ["python-snappy"]
test = ["pytest (>=8.2)", "pytest-asyncio (>=0.24.0)"]
zstd = ["zstandard"]
-[[package]]
-name = "pyopenssl"
-version = "24.2.1"
-description = "Python wrapper module around the OpenSSL library"
-optional = false
-python-versions = ">=3.7"
-files = [
- {file = "pyOpenSSL-24.2.1-py3-none-any.whl", hash = "sha256:967d5719b12b243588573f39b0c677637145c7a1ffedcd495a487e58177fbb8d"},
- {file = "pyopenssl-24.2.1.tar.gz", hash = "sha256:4247f0dbe3748d560dcbb2ff3ea01af0f9a1a001ef5f7c4c647956ed8cbf0e95"},
-]
-
-[package.dependencies]
-cryptography = ">=41.0.5,<44"
-
-[package.extras]
-docs = ["sphinx (!=5.2.0,!=5.2.0.post0,!=7.2.5)", "sphinx-rtd-theme"]
-test = ["pretend", "pytest (>=3.0.1)", "pytest-rerunfailures"]
-
[[package]]
name = "pytest"
version = "8.3.4"
@@ -1971,4 +1953,4 @@ s2repoze = ["paste", "repoze.who", "zope.interface"]
[metadata]
lock-version = "2.0"
python-versions = "^3.9"
-content-hash = "03ec3d72ebbfd582b62c153e6921c3032ff637943724b8a9222bc9593eae71e0"
+content-hash = "ac583ea6afeb45d9c6a66f1a5a49ce08d58b4c0ef554be7d65c55761bc8e8c42" |
Sorry, something went wrong.
|
Thank you @alecbarber - I also found types-pyopenssl to be obsolete now |
Sorry, something went wrong.
|
It also looks like the dependency on pytz can be removed. |
Sorry, something went wrong.
|
@rvanlaar good catch - as dateutil is no longer required too I removed pytz and dateutil as well as both typing classes. |
Sorry, something went wrong.
Applies [@praushcer](https://github.com/prauscher)'s changes to remove pyopenssl. see [upstream IdentityPython#977](IdentityPython#977)
|
I would love it if this went in! |
Sorry, something went wrong.
|
@c00kiemon5ter Is there anything I can help you with to get this merged? |
Sorry, something went wrong.
|
@c00kiemon5ter I have merged master into this branch, so it should now be mergeable. As I do not understand any of this poetry magic, I hope my poetry lock does not trigger new problems, but please tell me if I should rebuild the poetry.lock somehow. |
Sorry, something went wrong.
|
Hi @prauscher and @c00kiemon5ter - we've been relying on your fork/branch in our app and have noticed a breaking change as of 2 days ago. It looks like: requires-python = "^3.9" is not accepted by our build chain (pip/uv within docker). Further research suggests that the caret is not PEP 440-compliant. A possible fix would be: requires-python = ">=3.9,<4.0" Happy to be challenged on this, as I am not very versed in poetry magic :-) |
Sorry, something went wrong.
|
Latest master (or v7.5.4) have fixed this. @prauscher I would avoid merges from other branches to keep the diff clean. |
Sorry, something went wrong.
|
Rebased to current master, so @hsenot should be working again. Personally I prefer merge over rebase to avoid force pushes, but ymmv. From what I can tell from the change preview, this should be clean-ish now. |
Sorry, something went wrong.
|
Thanks heaps @prauscher , much appreciated. |
Sorry, something went wrong.
|
I'm also keen to see this merged. I've tested the branch and it works flawlessly and would allow us to remove pyopenssl as dependency in out project. |
Sorry, something went wrong.
|
@c00kiemon5ter do you need assistance with anything to review and merge this? I'd be happy to help |
Sorry, something went wrong.
|
Thanks for the hard work @prauscher. Is there any update on this PR? This would be extremely helpful for us. |
Sorry, something went wrong.
|
Also chiming in and curious @prauscher @c00kiemon5ter if there's any progress on getting this reviewed/merged 👋 Attempting to use pysaml2 on a project, but also running afoul of security scanners that (rightfully) don't like pyopenssl Thank you! |
Sorry, something went wrong.
|
Hello everyone and thank you for the patience. |
Sorry, something went wrong.
|
Is there anything we can do to help move the merging process forward? |
Sorry, something went wrong.
|
I think #1021 helps with this (removes some usage of pyopenssl) and with CVE-2026-26007 this seems to increase in priority. |
Sorry, something went wrong.
|
@c00kiemon5ter is there anything we can do to help? This is blocking us from updating cryptrography. Are there any other maintainers we can ping to help move this along? Thanks for your hard work! |
Sorry, something went wrong.
|
@c00kiemon5ter I wanted to follow up to see if there’s anything I can do to help move this forward. This change is currently blocking updates to the cryptography module, and remaining on an outdated version—particularly one with known critical vulnerabilities—makes addressing this pull request quite important. |
Sorry, something went wrong.
|
@Gijutsu / @peppelinux / @jkakavas are any of you three able to help move this forward (considering you are part of the IdentityPython org) or let the community know what we can do to help? |
Sorry, something went wrong.
|
We are currently developing a SAML-based SSO implementation using pysaml2. However, we are blocked due to CVE-2026-26007 in the cryptography dependency, which is causing our security/compliance checks to fail. Thanks for all efforts in raising this PR, this change would unblock our adoption and ongoing development. Would appreciate it if this could be reviewed and merged at the earliest. The community is ready to help move this forward. This would also help a broader community currently impacted by this CVE. |
Sorry, something went wrong.
There was a problem hiding this comment.
Went through the diff and the discussion. Looks good to me, ready to merge.
Nice work @prauscher , the patience here is impressive.
Left two small comments inline, nothing blocking.
Sorry, something went wrong.
| ).public_key( | ||
| k.public_key(), | ||
| ) | ||
| cert = builder.sign(k, hashes.SHA256()) |
There was a problem hiding this comment.
Noticed that the old hash_alg parameter is gone and SHA-256 is now hardcoded.
Totally reasonable default, just want to confirm this is intentional since it's technically a breaking change for anyone passing a different algorithm.
Worth a note in the CHANGELOG maybe?
Sorry, something went wrong.
There was a problem hiding this comment.
Could be added to CHANGELOG, but I do not know where such items are spooled until the next version
Sorry, something went wrong.
| assert authn_info[0][1] == ["http://www.example.com/login"] | ||
| now = datetime.now(timezone.utc) | ||
| dt = parser.parse(authn_info[0][2]) | ||
| dt = datetime.strptime(authn_info[0][2], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc) |
There was a problem hiding this comment.
| dt = datetime.strptime(authn_info[0][2], "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc) | |
| dt = datetime.fromisoformat(authn_info[0][2].replace("Z", "+00:00")) |
Minor: this can use the C-level ISO parser instead of strptime, and it works on Python 3.9+ too
Sorry, something went wrong.
There was a problem hiding this comment.
Resolved - as ISO 8601 also supports providing Z as timezone, string replacement is not necessary
Sorry, something went wrong.
|
see: #1021 (comment) I am surviving with my fork |
Sorry, something went wrong.
|
Can we please get some guidance how to proceed? @Gijutsu / @peppelinux / @jkakavas |
Sorry, something went wrong.
I also ended up pushing #1021 into my fork, tagged a release there, and I'm deploying that from a tarball. |
Sorry, something went wrong.
I am using my fork from years, therefore yes, personal forks work. |
Sorry, something went wrong.
Replace pyopenssl with cryptography (upstream PR IdentityPython#977)
Unblock the wedged dependency security updates: dependabot's pyjwt security job fails on every run (security_update_not_possible) because grafana-django-saml2-auth — archived by Grafana 2026-06-16, frozen at 3.21.0 forever — pins pyjwt==2.12.1 via django-saml2-auth-community, whose pysaml2==7.5.4 pin in turn caps pyopenssl<24.3.0 and transitively cryptography<44. The Pipfile.lock had drifted unsound (cryptography 48.0.1 alongside pyopenssl 24.2.1's <44 cap), so any honest pipenv relock downgraded cryptography five majors onto two HIGH advisories. Approach: convert the root app from pipenv to uv (the toolchain /mcp_server already uses) and declare the one-line resolver override `pyopenssl>=26.2`, lifting pysaml2's stale cap so pyopenssl/cryptography float together honestly. Swap the dead grafana distribution name for django-saml2-auth-community>=3.22.0 (identical django_saml2_auth import paths; no code changes). Resulting lock: pyjwt 2.13.0, cryptography 49.0.0, pyopenssl 26.3.0 — fully consistent, no unsoundness. Django stays 5.2.15. Pros: - Every blocked security update lands via honest resolution; the recurring red dependabot job and its deploy-gate fallout end - One dependency toolchain repo-wide; dependabot's uv updater runs `uv lock`, so the override survives every future bot PR - Production precedent for this exact override: Flagsmith's SAML stack Cons: - Overriding pysaml2's metadata asserts pyopenssl>=26.2 compatibility; verified empirically (standard SP flows execute no pyOpenSSL code), but validate_certificate/PEFIM cert-generation must stay off until pysaml2 ships IdentityPython/pysaml2#977 or #1021 (override removable then) - Contributors switch pipenv muscle memory to `uv run`/`uv sync` Full analysis, alternatives considered, and retirement triggers: docs/rfcs/0002-dependency-security-unblock-uv-migration.md
Unblock the wedged dependency security updates: dependabot's pyjwt security job fails on every run (security_update_not_possible) because grafana-django-saml2-auth — archived by Grafana 2026-06-16, frozen at 3.21.0 forever — pins pyjwt==2.12.1 via django-saml2-auth-community, whose pysaml2==7.5.4 pin in turn caps pyopenssl<24.3.0 and transitively cryptography<44. The Pipfile.lock had drifted unsound (cryptography 48.0.1 alongside pyopenssl 24.2.1's <44 cap), so any honest pipenv relock downgraded cryptography five majors onto two HIGH advisories. Approach: convert the root app from pipenv to uv (the toolchain /mcp_server already uses) and declare the one-line resolver override `pyopenssl>=26.2`, lifting pysaml2's stale cap so pyopenssl/cryptography float together honestly. Swap the dead grafana distribution name for django-saml2-auth-community>=3.22.0 (identical django_saml2_auth import paths; no code changes). Resulting lock: pyjwt 2.13.0, cryptography 49.0.0, pyopenssl 26.3.0 — fully consistent, no unsoundness. Django stays 5.2.15. Pros: - Every blocked security update lands via honest resolution; the recurring red dependabot job and its deploy-gate fallout end - One dependency toolchain repo-wide; dependabot's uv updater runs `uv lock`, so the override survives every future bot PR - Production precedent for this exact override: Flagsmith's SAML stack Cons: - Overriding pysaml2's metadata asserts pyopenssl>=26.2 compatibility; verified empirically (standard SP flows execute no pyOpenSSL code), but validate_certificate/PEFIM cert-generation must stay off until pysaml2 ships IdentityPython/pysaml2#977 or #1021 (override removable then) - Contributors switch pipenv muscle memory to `uv run`/`uv sync` Full analysis, alternatives considered, and retirement triggers: docs/rfcs/0002-dependency-security-unblock-uv-migration.md
… uv migration (RFC 0002) (#679) * chore(deps): migrate root app to uv; swap to django-saml2-auth-community Unblock the wedged dependency security updates: dependabot's pyjwt security job fails on every run (security_update_not_possible) because grafana-django-saml2-auth — archived by Grafana 2026-06-16, frozen at 3.21.0 forever — pins pyjwt==2.12.1 via django-saml2-auth-community, whose pysaml2==7.5.4 pin in turn caps pyopenssl<24.3.0 and transitively cryptography<44. The Pipfile.lock had drifted unsound (cryptography 48.0.1 alongside pyopenssl 24.2.1's <44 cap), so any honest pipenv relock downgraded cryptography five majors onto two HIGH advisories. Approach: convert the root app from pipenv to uv (the toolchain /mcp_server already uses) and declare the one-line resolver override `pyopenssl>=26.2`, lifting pysaml2's stale cap so pyopenssl/cryptography float together honestly. Swap the dead grafana distribution name for django-saml2-auth-community>=3.22.0 (identical django_saml2_auth import paths; no code changes). Resulting lock: pyjwt 2.13.0, cryptography 49.0.0, pyopenssl 26.3.0 — fully consistent, no unsoundness. Django stays 5.2.15. Pros: - Every blocked security update lands via honest resolution; the recurring red dependabot job and its deploy-gate fallout end - One dependency toolchain repo-wide; dependabot's uv updater runs `uv lock`, so the override survives every future bot PR - Production precedent for this exact override: Flagsmith's SAML stack Cons: - Overriding pysaml2's metadata asserts pyopenssl>=26.2 compatibility; verified empirically (standard SP flows execute no pyOpenSSL code), but validate_certificate/PEFIM cert-generation must stay off until pysaml2 ships IdentityPython/pysaml2#977 or #1021 (override removable then) - Contributors switch pipenv muscle memory to `uv run`/`uv sync` Full analysis, alternatives considered, and retirement triggers: docs/rfcs/0002-dependency-security-unblock-uv-migration.md * docs(rfc): fill in companion PR number (#679) * docs(rfc): add live-deployment validation of the SAML gap (§5) * docs(rfc): confirm SAML gap from inside the deployed machine (§5) * chore(deps): refresh lock post-rebase — track main's django 5.2.16, pick up cryptography 50 Rebasing over the merged 2026-08-01 dependabot batch (#682–#692) required re-resolving: bump the exact django pin to match main's #689 and run uv lock --upgrade so the uv lock carries everything the batch delivered under pipenv — django-oauth-toolkit 3.4.0, faker 40.36.0, boto3 1.43.64 — plus cryptography 50.0.0/pyopenssl 26.4.0, superseding both artifacts main's #692 relock introduced (cryptography 43.0.3 downgrade and the duplicate grafana/community saml distributions in Pipfile.lock). Full backend suite passes locally on the refreshed lock (977 passed). * docs(rfc): record Simon's allauth end-state for SAML; update version tables (§2, §5, §6) Simon's review answer (2026-08-04): allauth now backs patient login and password reset, so SAML should ideally live there too. §5 gains a Resolution recording the community-fork swap as transitional with django-allauth[saml] as the destination, notes the xmlsec1/libxmlsec1 Docker gap carries over to python3-saml rather than disappearing, and §6 trigger 3 becomes the planned retirement path. §2's table refreshed to the post-rebase lock (cryptography 50.0.0, pyopenssl 26.4.0) and documents the now-live main artifacts this PR supersedes. * docs(rfc): tighten RFC 0002 — half the length, same content Reviewer feedback: the RFC read as verbose and partly redundant. Condensed each section (279 → ~160 lines), folded the visible-breakage list into the problem narrative, absorbed the post-#692 main drift into §1, refreshed the version table to the current lock (cryptography 50.0.0, django 5.2.16), and replaced §5's superseded follow-up-issue/xmlsec-carries-over wording with the final resolution (#697 / RFC 0003). No substantive positions changed.
| Back | FazBrowse Home | New Git URL |
Closes #879 #952 #975 #1012
Description
The feature or problem addressed by this PR
This PR replaces pyopenssl whose usage is discouraged by its own developers. This is especially current since pyopenssl was forced to a version before 24.3.0 in response to #975. This inturn forces older cryptography-versions, making automated vulnerability checkers go brr.
What your changes do and why you chose this solution
The replacement of pyopenssl is quite direct, so probably cryptography could be used to a larger extend, reducing own security functions. On the other hand, cryptography is currently quite fixed to client/server authentification, enforcing stricter regulations on Certificate extensions etc, which might not be suitable here.
I ran the test suite on my machine which looked good, however while pyopenssl usually accepts strings or bytes, cryptography is usually fixed to bytes, forcing encoding to its user, so there may be dragons.
This being my first PR here, I'd highly value feedback and be happy to assist.
Checklist