Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

fix(deps): override semgrep's pyjwt pin and databricks' oauthlib cap (#1859)

Kaifb46f2b5509df
diff --git a/.github/requirements/README.md b/.github/requirements/README.md
index 32d0c36d..9ede7049 100644
--- a/.github/requirements/README.md
+++ b/.github/requirements/README.md
@@ -20,6 +20,11 @@ uv pip compile <input> --python-version 3.11 --python-platform linux \
`security-scan-tools.txt`, since those install standalone tooling with no
version relationship to the project's own dependency tree.)
+`security-scan-tools.txt` is additionally compiled with
+`--override security-scan-tools-overrides.txt` to force a patched pyjwt past
+semgrep's pin, and is therefore installed with `--no-deps` in
+security-scan.yml (see the overrides file for details).
+
Regenerate a file the same way after bumping a pinned version, and re-run it
whenever `requirements-ci.txt` changes if the file used `--constraint` (see
each file's own autogenerated header comment for its exact command).
diff --git a/.github/requirements/security-scan-tools-overrides.txt b/.github/requirements/security-scan-tools-overrides.txt
new file mode 100644
index 00000000..99b12662
--- /dev/null
+++ b/.github/requirements/security-scan-tools-overrides.txt
@@ -0,0 +1,9 @@
+# Overrides for security-scan-tools.txt (passed via `uv pip compile --override`).
+#
+# semgrep (latest 1.178.0) still pins pyjwt~=2.13.0, which carries a stack of
+# PyJWT advisories fixed in 2.14.0/2.15.0. semgrep only imports jwt in its MCP
+# token verifier, which the CI scan never runs. Because this forces a version
+# outside semgrep's declared range, security-scan.yml installs the compiled
+# file with --no-deps (every transitive dep is already hash-pinned in it).
+# Drop this once semgrep relaxes its pin.
+pyjwt[crypto]>=2.15.1
diff --git a/.github/requirements/security-scan-tools.txt b/.github/requirements/security-scan-tools.txt
index 56f218c5..08b11202 100644
--- a/.github/requirements/security-scan-tools.txt
+++ b/.github/requirements/security-scan-tools.txt
@@ -1,5 +1,5 @@
# This file was autogenerated by uv via the following command:
-# uv pip compile .github/requirements/security-scan-tools.in --generate-hashes --python-version 3.11 --python-platform linux -o .github/requirements/security-scan-tools.txt
+# uv pip compile .github/requirements/security-scan-tools.in --override .github/requirements/security-scan-tools-overrides.txt --generate-hashes --python-version 3.11 --python-platform linux -o .github/requirements/security-scan-tools.txt
annotated-types==0.8.0 \
--hash=sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7 \
--hash=sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0
@@ -730,10 +730,11 @@ pygments==2.21.0 \
--hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \
--hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c
# via rich
-pyjwt==2.13.0 \
- --hash=sha256:41571c89ca91598c79e8ef18a2d07367d4810fbbd6f637794879baf1b7703423 \
- --hash=sha256:66adcc2aff09b3f1bbd95fc1e1577df8ac8723c978552fd43304c8a290ac5728
+pyjwt==2.15.1 \
+ --hash=sha256:42d59d631f7768a1028a64c7ff581a9bf7519804daf91fc5b6c56e30eec5e193 \
+ --hash=sha256:4f259e80cdfb6b3fc18a7de51fd1ef9ec79652f25019bae68975ca2468a34df8
# via
+ # --override .github/requirements/security-scan-tools-overrides.txt
# mcp
# semgrep
python-dotenv==1.2.3 \
diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml
index 13c2fb11..1168b5d0 100644
--- a/.github/workflows/security-scan.yml
+++ b/.github/workflows/security-scan.yml
@@ -102,7 +102,10 @@ jobs:
# Tooling AFTER the pinned set: installing it first would let the
# pinned requirements overwrite the tooling's own transitive deps.
pip install -r .github/requirements/pip-audit.txt --require-hashes
- pip install -r .github/requirements/security-scan-tools.txt --require-hashes
+ # --no-deps: security-scan-tools.txt overrides semgrep's pyjwt pin
+ # (see security-scan-tools-overrides.txt), which pip's resolver would
+ # otherwise reject. The file already hash-pins every transitive dep.
+ pip install -r .github/requirements/security-scan-tools.txt --require-hashes --no-deps
- name: Run pip-audit (Package Vulnerabilities)
continue-on-error: true
diff --git a/pyproject.toml b/pyproject.toml
index ccf4a60d..2835f90f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -336,6 +336,14 @@ include = ["semantica*", "integrations*", "semantica_mcp*"]
# static/* covers index.html / favicon; static/assets/* covers all JS/CSS chunks.
"semantica" = ["static/*", "static/assets/*", "ontology/vocabulary/*.ttl"]
+[tool.uv]
+# databricks-sql-connector (latest 4.6.0) still caps oauthlib<4.0.0, but the
+# fixes for GHSA PKCE timing / RevocationEndpoint JSONP only ship in 4.0.0.
+# The connector only uses WebApplicationClient (prepare_authorization_request,
+# parse_request_uri_response, prepare_request_body, prepare_refresh_body),
+# which is unchanged in 4.0.0. Drop this once the connector lifts its cap.
+override-dependencies = ["oauthlib>=4.0.0"]
+
[tool.black]
line-length = 88
diff --git a/uv.lock b/uv.lock
index 554dfe9f..4bd75711 100644
--- a/uv.lock
+++ b/uv.lock
@@ -14,6 +14,9 @@ resolution-markers = [
"python_full_version < '3.11'",
]
+[manifest]
+overrides = [{ name = "oauthlib", specifier = ">=4.0.0" }]
+
[[package]]
name = "accelerate"
version = "1.15.0"
@@ -5494,11 +5497,11 @@ wheels = [
[[package]]
name = "oauthlib"
-version = "3.3.1"
+version = "4.0.0"
source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/0b/5f/19930f824ffeb0ad4372da4812c50edbd1434f678c90c2733e1188edfc63/oauthlib-3.3.1.tar.gz", hash = "sha256:0f0f8aa759826a193cf66c12ea1af1637f87b9b4622d46e866952bb022e538c9", size = 185918, upload-time = "2025-06-19T22:48:08.269Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/7a/d8/a1bcc8ba112a627f8ffbdc212a78ce18d3ac07e91a5ca65d27918eee25a1/oauthlib-4.0.0.tar.gz", hash = "sha256:efb274799819440f95b4ab3b818869f1ce9ae26c5beacba0201d1a1b76b54f86", size = 187232, upload-time = "2026-09-28T06:01:18.77Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/be/9c/92789c596b8df838baa98fa71844d84283302f7604ed565dafe5a6b5041a/oauthlib-3.3.1-py3-none-any.whl", hash = "sha256:88119c938d2b8fb88561af5f6ee0eec8cc8d552b7bb1f712743136eb7523b7a1", size = 160065, upload-time = "2025-06-19T22:48:06.508Z" },
+ { url = "https://files.pythonhosted.org/packages/d9/f4/78229a1066068ca14fc60fb26cf7381cabe4382261392b90e5f9552722d4/oauthlib-4.0.0-py3-none-any.whl", hash = "sha256:624c28c13a0a59cabf9747dfa52af63be3e512a7f2714df16e91b5b3a145e6cd", size = 159715, upload-time = "2026-09-28T06:01:17.008Z" },
]
[[package]]