Skip to content

Commit 99bf85b

Browse files
Merge pull request #11 from uktrade/SR3652_part_iii
SR-3652 part iii - revenge of the log formatter
2 parents 148631c + b697172 commit 99bf85b

6 files changed

Lines changed: 19 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [0.9.4] - 2025-06-19
4+
5+
Fix of a security vulnerability: https://github.com/uktrade/djangosaml2idp2/security/code-scanning/1
6+
7+
### Added
8+
- Downgraded pre-commit package to work better with other downstream packages.
9+
310
## [0.9.3] - 2025-06-13
411

512
Update of aging dependencies that had vulnerabilities and also add support for newer Python and Django versions.

djangosaml2idp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.9.3'
1+
__version__ = '0.9.4'

djangosaml2idp/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import datetime
33
import xml.dom.minidom
44
from saml2.response import StatusResponse
5-
import xml.etree.ElementTree as ET
5+
import defusedxml.ElementTree as ET
6+
import defusedxml.minidom
67
import zlib
78
from xml.parsers.expat import ExpatError
89
from django.conf import settings
@@ -18,12 +19,12 @@ def repr_saml(saml: str, b64: bool = False):
1819
"""
1920
try:
2021
msg = base64.b64decode(saml).decode() if b64 else saml
21-
dom = xml.dom.minidom.parseString(msg)
22+
dom = defusedxml.minidom.parseString(msg)
2223
except (UnicodeDecodeError, ExpatError):
2324
# in HTTP-REDIRECT the base64 must be inflated
2425
compressed = base64.b64decode(saml)
2526
inflated = zlib.decompress(compressed, -15)
26-
dom = xml.dom.minidom.parseString(inflated.decode())
27+
dom = defusedxml.minidom.parseString(inflated.decode())
2728
return dom.toprettyxml()
2829

2930

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ exclude = '''
1616

1717
[tool.poetry]
1818
name = "djangosaml2idp2"
19-
version = "0.9.3"
19+
version = "0.9.4"
2020
description = "Forked from the original https://github.com/OTA-Insight/djangosaml2idp to provide bugfixes and upgrades to python and django support."
2121
authors = ["Department for Business and Trade Platform Team <sre-team@digital.trade.gov.uk>"]
2222
readme = "README.rst"
@@ -53,7 +53,7 @@ nodeenv = ">=1.9.1"
5353
packaging = ">=25.0"
5454
pip-tools = ">=7.4.1"
5555
pluggy = ">=1.6.0"
56-
pre-commit = ">=4.2.0"
56+
pre-commit = ">=3.5.0,<4.0.0"
5757
pycparser = ">=2.22"
5858
pyopenssl = ">=24.2.1,<24.3.0"
5959
pyparsing = ">=3.2.3"

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pluggy>=1.6.0
6060
# via
6161
# pytest
6262
# tox
63-
pre-commit>=4.2.0
63+
pre-commit>=3.5.0,<4.0.0
6464
# via -r requirements-dev.in
6565
py>=1.10.0
6666
# via

0 commit comments

Comments
 (0)