diff --git a/changelog.d/13172.misc b/changelog.d/13172.misc
new file mode 100644
index 0000000000000000000000000000000000000000..124a1b3662dd4b5d0c1ee161b0e504ec481ed361
--- /dev/null
+++ b/changelog.d/13172.misc
@@ -0,0 +1 @@
+Always use a version of canonicaljson that supports the C implementation of frozendict.
diff --git a/poetry.lock b/poetry.lock
index 3a08c9478d06f9c6c95c006a431ec339084e0395..41ab40edd156db5b237af941d7373096e5ece190 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1563,7 +1563,7 @@ url_preview = ["lxml"]
 [metadata]
 lock-version = "1.1"
 python-versions = "^3.7.1"
-content-hash = "e96625923122e29b6ea5964379828e321b6cede2b020fc32c6f86c09d86d1ae8"
+content-hash = "c24bbcee7e86dbbe7cdbf49f91a25b310bf21095452641e7440129f59b077f78"
 
 [metadata.files]
 attrs = [
diff --git a/pyproject.toml b/pyproject.toml
index f77c02ca27e68464363d5decbdb1e09be6966891..21bea2ba016b0ef8120f65c2b6367d2660e50948 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -110,7 +110,9 @@ jsonschema = ">=3.0.0"
 frozendict = ">=1,!=2.1.2"
 # We require 2.1.0 or higher for type hints. Previous guard was >= 1.1.0
 unpaddedbase64 = ">=2.1.0"
-canonicaljson = "^1.4.0"
+# We require 1.5.0 to work around an issue when running against the C implementation of
+# frozendict: https://github.com/matrix-org/python-canonicaljson/issues/36
+canonicaljson = "^1.5.0"
 # we use the type definitions added in signedjson 1.1.
 signedjson = "^1.1.0"
 # validating SSL certs for IP addresses requires service_identity 18.1.