Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ classifiers = [
]

dependencies = [
"Authlib==1.2.1", # For Auth plugins
"Authlib==1.6.12", # For Auth plugins

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Authlib changelog breaking changes from version 1.2.1 to 1.6.12 migration guide

💡 Result:

Authlib changelog “breaking changes” from 1.2.1 to 1.6.12 (migration guidance): 1) Versions 1.2.1 (2023-06-25): remove/behavior changes you may need to account for - Removed has_client_secret method and its documentation. [1][2] - Removed request_invalid and token_revoked remaining occurrences and documentation. [1][2] - ClientSecretJWT.sign now applies headers (via PR #552), which can affect how client secrets are signed. [1][2] - authorize_redirect fix for Starlette v0.26.0. [1][2] - grant uri params: “Allow falsy but non-None grant uri params” (PR #544) may change validation logic around grant URI parameters. [1][2] - Fixed RFC7591 grant_types and response_types default values. [1][2] 2) Authlib 1.6.x line: additional breaking changes called out in the changelog - Authlib 1.6.0 page exists and indicates there are “Breaking changes” sections between 1.x releases; use the changelog view to extract the specific items for the versions you are skipping. [3] - In the repo changelog file, Authlib 1.6.9 shows breaking changes including: a) Support for acr and amr claims in id_token, requiring a migration in OAuth2AuthorizationCodeMixin to support new fields. [4] b) Stop support for Python 3.8. [4] c) Raise InvalidGrantError for invalid code, redirect_uri and no user errors in OAuth 2.0 server (i.e., changed error behavior). [4] d) authlib.jose.jwt only works with JWS algorithms by default; to use JWT with JWE algorithms you must pass an algorithms parameter (example shown in changelog). [4] 3) 1.6.12 (2026-05-04): last-mile change in your target range - v1.6.12 fixes redirecting to an unvalidated redirect_uri on InvalidScopeError in OpenIDImplicitGrant and OpenIDHybridGrant. [5] 4) Most important “migration guide” aspect in this range: prepare for the jose -> joserfc migration Authlib’s upgrade material for the broader 1.x -> 2.0 transition highlights a major module migration: - There is an explicit “Upgrade Guide: joserfc migration.” link on the Authlib upgrades changelog pages. [6] - Authlib notes it will remove the authlib.jose module in 2.0.0, and to use joserfc instead (migration PR message). [7] Practical migration approach (how to apply the above): - Start by searching the Authlib stable changelog between exactly the versions you skip (1.2.1 -> 1.6.12) and copy the “Breaking changes” bullet points for each intermediate release that you’re not already on. The official changelog provides a full list of changes “between each Authlib release.” [1] - Specifically review for removed APIs: has_client_secret, and request_invalid/token_revoked documentation/occurrences. [1][2] - Specifically review for behavior changes around OAuth error handling and validation: InvalidGrantError changes and redirect_uri handling in 1.6.12. [4][5] - If you rely on id_token customization: ensure OAuth2AuthorizationCodeMixin migration for acr/amr support (1.6.9 breaking change). [4] - If your deployment still targets Python 3.8, this must change (1.6.9 breaking change). [4] - If you use authlib.jose JWT/JWE: pass algorithms explicitly to use JWE algorithms (1.6.9 breaking change). [4] - Plan for jose -> joserfc migration even though it’s not necessarily “breaking” for 1.6.12 itself; the project is actively documenting and moving away from authlib.jose. [6][7] If you want, paste your stack (OAuth2 vs OIDC, client vs server, frameworks, and which classes you use), and I’ll map the above breaking bullets to the most likely code changes in your app.

Citations:


Authlib 1.6.12 upgrade: changelog shows auth/OIDC/JWT breaking/behavior changes

Even though the security fix is important, the jump from Authlib 1.2.1 → 1.6.12 crosses multiple “breaking changes” in the 1.2.x–1.6.x line. Key items to validate for your auth plugins:

  • Removed/changed APIs: has_client_secret; request_invalid / token_revoked remnants; ClientSecretJWT.sign behavior now applies headers
  • OAuth/OIDC error/redirect behavior: InvalidGrantError handling changes; 1.6.12 redirect_uri validation fix on InvalidScopeError in OpenIDImplicitGrant / OpenIDHybridGrant
  • OIDC id_token claim support: 1.6.9 introduces acr/amr support in id_token (may require OAuth2AuthorizationCodeMixin migration if you customize)
  • jose/JWT/JWE compatibility: authlib.jose.jwt algorithm handling changes (JWE may require passing algorithms)
  • Environment constraints: 1.6.9 drops Python 3.8 support
  • Also consider the broader documented authlib.josejoserfc migration path

Run/confirm integration coverage for the specific auth/OIDC/JWT codepaths in this backend (redirect_uri handling, token/authorization flows, and any client secret/JWT/JWE logic) before relying on the change.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@backend/pyproject.toml` at line 16, You upgraded Authlib to 1.6.12 which
crosses several breaking changes; either pin the dependency to a safe tested
version (e.g., maintain 1.2.x) or run and update our auth/OIDC/JWT codepaths:
audit usages of has_client_secret, request_invalid, token_revoked,
ClientSecretJWT.sign, InvalidGrantError handling,
OpenIDImplicitGrant/OpenIDHybridGrant redirect_uri behavior, any custom
OAuth2AuthorizationCodeMixin code, and authlib.jose.jwt JWE/JWT algorithm
handling (and check Python 3.8 support), then update callers/handlers and tests
to match the new APIs before merging.

"boto3~=1.34.0", # For Unstract-cloud-storage
"celery[amqp]>=5.3.4", # For Celery
"cron-descriptor==1.4.0", # For cron string description
Expand Down
16 changes: 8 additions & 8 deletions backend/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion unstract/connectors/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies = [
"snowflake-connector-python[pandas]~=4.6.0", # For Snowflake
"google-cloud-bigquery==3.11.4", # For Bigquery
"pymssql==2.3.4", # For MSSQL
"PyMySQL==1.1.0", # For MySQL
"PyMySQL==1.1.1", # For MySQL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify PyMySQL version 1.1.1 is current and secure

# Check PyPI for the latest PyMySQL version
echo "=== Latest PyMySQL version on PyPI ==="
curl -s https://pypi.org/pypi/pymysql/json | jq -r '.info.version'

# Check for security advisories using GitHub CLI
echo -e "\n=== Security advisories for PyMySQL ==="
gh api graphql -f query='
{
  securityVulnerabilities(first: 10, ecosystem: PIP, package: "pymysql") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
      vulnerableVersionRange
      firstPatchedVersion {
        identifier
      }
    }
  }
}'

Repository: Zipstack/unstract

Length of output: 1986


🌐 Web query:

PyPI latest version pymysql 1.1.1

💡 Result:

As of June 11, 2026, the latest version of PyMySQL on PyPI is 1.2.0, which was released on May 19, 2026 [1][2][3]. PyMySQL 1.1.1 was released on May 21, 2024 [4][5]. It is a historical version that included a fix for a security vulnerability (CVE-2024-36039), which addressed a potential SQL injection issue related to dict parameters in Cursor.execute() [5][6]. Users are encouraged to update to the latest available version (1.2.0) to ensure they have the most recent security patches and features [3].

Citations:


🌐 Web query:

OSV or GitHub security advisories for pymysql affected versions

💡 Result:

The primary security advisory for PyMySQL is CVE-2024-36039, which is documented in the GitHub Advisory Database as GHSA-v9hf-5j83-6xpp [1][2]. Affected Versions All versions of PyMySQL up to and including 1.1.0 are affected by this vulnerability [3][2]. Patched Version The vulnerability was resolved in version 1.1.1 [4][5]. Users are strongly recommended to upgrade to version 1.1.1 or later to mitigate this risk [6][5]. Vulnerability Details The issue is an SQL injection vulnerability (CWE-89) [3][2]. It occurs because the library's escape_dict function does not properly escape dictionary keys when processing untrusted JSON input, potentially allowing an attacker to execute arbitrary SQL commands [2][7]. In version 1.1.1, the maintainers addressed this by prohibiting the use of dictionary parameters in the Cursor.execute method, as this usage pattern did not produce valid SQL and introduced the injection risk [6][4][5]. If an immediate upgrade is not possible, maintainers recommend ensuring that any input from untrusted sources is strictly validated to have the expected type, as dictionary inputs are the primary attack vector [6][8][5].

Citations:


Update PyMySQL pin: 1.1.1 is patched but not latest (as of 2026-06-11).

  • PyMySQL==1.1.1 fixes the SQL-injection issue for CVE-2024-36039 / GHSA-v9hf-5j83-6xpp (affected through 1.1.0), so the security intent of the bump is correct.
  • PyPI latest is PyMySQL==1.2.0 (released 2026-05-19), so consider bumping from 1.1.11.2.0 to stay current with any additional patches.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@unstract/connectors/pyproject.toml` at line 42, Replace the pinned dependency
string "PyMySQL==1.1.1" with the current release "PyMySQL==1.2.0" in the
project's pyproject.toml dependency list to move to the latest patched version;
update any lockfile or regenerate dependencies (e.g., poetry lock / pip-compile)
and run tests to ensure compatibility with the bumped PyMySQL version.

"oracledb==2.4.0", # For OracleDB
"fsspec[sftp]~=2024.10.0", # For SFTP
]
Expand Down
8 changes: 4 additions & 4 deletions unstract/connectors/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions workers/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading