Repository navigation
fix(security): bump pyathena to 3.35.4 - #32137
Conversation
pyathena below 3.35.4 is affected by CVE-2026-65321 (CVSS 9.3, CWE-89): DELETE and CTAS statements are routed to the Hive-style backslash escaper, but Athena/Trino treats a backslash as an ordinary character inside a string literal, so a parameter containing a single quote breaks out of the literal and injects arbitrary SQL. setup.py pinned `pyathena~=3.25.0`, which caps the athena extra at <3.26 and cannot pick up the fix. Verified against a real 3.35.4 install on Python 3.10 with SQLAlchemy 2.0.52 that every pyathena symbol the Athena connector and profiler rely on still exists, including the private ones: AthenaStatementCompiler, AthenaDialect (_get_table, _get_column_type, _pattern_column_type), pyathena.sqlalchemy.util._HashableDict, the AthenaTableMetadata accessors, and the awsathena+rest dialect entry point. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Code Review ✅ ApprovedBumps OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
✅ Playwright Results — workflow succeededValidated commit ✅ 110 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 52m 43s ⏱️ Max setup 5m 11s · max shard execution 12m 30s · max shard-job elapsed before upload 22m 12s · reporting 3s 🌐 218.10 requests/attempt · 1.79 app boots/UI scenario · 0.00% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |



Advisory
CVE-2026-65321 / GHSA-xwj5-g6cv-4r5c / SNYK-PYTHON-PYATHENA-19270043 — critical, CVSS 9.3
(
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:P), CWE-89 SQL Injection.Vulnerable range
[,3.35.4); fixed in 3.35.4.Raw scanner finding
ingestion-dep-scan.json, security-scan run 33031058562 (head36f5148884) — the only non-base-image critical in this run:Snyk reports
isUpgradable: Falsebecause the fix falls outside the declared pinpyathena~=3.25.0(>=3.25.0, <3.26.0) — the pin itself is what blocks the fix, so the pin iswhat this PR changes.
What I verified
1 — the advisory is coherent.
pyathena3.35.4 is a real published release(
https://pypi.org/pypi/pyathena/3.35.4/json,requires_python: >=3.10), and 3.25.0 is genuinelybelow it. It is a minor bump inside the 3.x line, not a major.
2 — the full pyathena API surface this repo uses still exists at 3.35.4. The Athena connector
does not just import pyathena, it monkey-patches private internals, so I installed 3.35.4 into a
clean Python 3.10 venv (the version CI runs) with
sqlalchemy 2.0.52— inside this repo'sdeclared
sqlalchemy>=2.0.0,<3range — and checked every symbol:pyathena.sqlalchemy.compiler.AthenaStatementCompilerprofiler/interface/sqlalchemy/athena/profiler_interface.py:25AthenaStatementCompiler.visit_column(patched)pyathena.sqlalchemy.util._HashableDict(private).../database/athena/utils.py:17,274,275pyathena.sqlalchemy.base.AthenaDialect.../database/athena/metadata.py:19AthenaDialect._pattern_column_type(private).../athena/utils.py:37base.py:185)AthenaDialect._get_table/_get_column_type/get_columns/get_view_definition/get_table_options/_raw_connectionathena/metadata.py:74-77, defined inathena/utils.pyAthenaTableMetadata.{columns, partition_keys, parameters, location, compression, row_format, file_format, serde_properties, table_properties}athena/utils.pyget_columns/get_table_optionsawsathena+restdialect entry pointathenaConnection.json:18scheme enumAthenaRestDialectsa.create_engine("awsathena+rest://…")resolves toAthenaRestDialecton 3.35.4.3 — no dependency floor is violated. 3.35.4 declares
boto3>=1.41.2/botocore>=1.41.2;this repo already pins
boto3~=1.41.5(setup.py:30), which satisfies both. Itssqlalchemyextra declares
>=1.0.0, satisfied by the repo'ssqlalchemy>=2.0.0,<3.4 — it is consistent with the rest of the repo.
ingestion/airflow-constraints-3.3.1.txt:50already carries
PyAthena==3.35.4. That constraint file is only applied to theopenmetadata-airflow-apisinstall inDockerfile.ci, not to the ingestion install, so there isno live resolver conflict today — but 3.35.4 is what the pinned Airflow 3.3.1 constraint set
expects, and after this change the two agree.
5 — formatting/lint.
ruff format --checkandruff check(withingestion/pyproject.toml)both pass on the changed file; the new line is 119 chars against the configured
line-length = 120.Manifests touched
ingestion/setup.py—VERSIONS["pyathena"]:pyathena~=3.25.0→pyathena~=3.35.4.This one entry feeds both the
athenaextra (setup.py:218) and the test/dev set (setup.py:550).No lockfile to regenerate on the Python side.
What I did NOT test
pip install -e '.[athena]'against the real ingestiondependency set. The verification above is a targeted API-surface check in an isolated venv
containing only
pyathena+sqlalchemy. It proves the symbols exist and the dialect resolves;it does not prove the whole ingestion resolver still solves with 3.35.4 alongside every other
pinned connector. CI is the check for that — please let it run before this leaves draft.
equivalence of
get_columns/get_table_options/ struct-column profiling against a realAthena catalog is unverified.
releases between 3.25 and 3.35 beyond the symbol check above. That gap is the main reason this
is a draft.
Real-world exposure
The injection vector is
DELETEandCTASstatement compilation. OpenMetadata's Athena connectoris read-only (metadata reflection via the Athena/Glue API plus
SELECTfor profiling), so it isnot obviously on the vulnerable path — but
pyathenais also exposed to users through the profilerand is a shipped dependency of the ingestion image, so a CVSS 9.3 SQL injection in it should not be
carried.
🤖 Generated with Claude Code
Greptile Summary
The PR upgrades PyAthena from the 3.25 release line to the security-fixed 3.35 release line.
Confidence Score: 5/5
The PR appears safe to merge, with no concrete blocking or non-blocking defects identified in the dependency update.
The upgraded dependency requirements remain jointly satisfiable, the supported runtime is compatible, and available evidence does not establish a regression in the Athena connector paths.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(security): bump pyathena to 3.35.4" | Re-trigger Greptile