Skip to content

fix: remediate CVEs for unstructured-api#571

Merged
lawrence-u10d merged 3 commits into
mainfrom
fix/cves-2026-05-09
May 11, 2026
Merged

fix: remediate CVEs for unstructured-api#571
lawrence-u10d merged 3 commits into
mainfrom
fix/cves-2026-05-09

Conversation

@lawrence-u10d
Copy link
Copy Markdown
Contributor

@lawrence-u10d lawrence-u10d commented May 9, 2026

Summary

Test plan

  • uv sync --locked succeeds (lockfile is consistent)
  • make check-src passes (ruff format, ruff check, mypy)
  • CI lint + unit tests pass
  • Docker smoke tests pass

🤖 Generated with Claude Code


Note

Medium Risk
Primarily dependency/version changes, but removing the starlette==0.41.2 constraint can introduce runtime incompatibilities due to a major Starlette upgrade affecting FastAPI/middleware behavior.

Overview
Updates the service to 0.1.6 and documents a new security release in CHANGELOG.md.

Removes the starlette==0.41.2 constraint from pyproject.toml (allowing Starlette to upgrade to remediate CVE-2025-54121 and CVE-2025-62727) and bumps python-multipart to a non-vulnerable release to address CVE-2026-40347.

Reviewed by Cursor Bugbot for commit ddaeefc. Bugbot is set up for automated code reviews on this repo. Configure here.

…urity]

- starlette 0.41.2 -> 1.0.0: fixes CVE-2025-54121 (MEDIUM), CVE-2025-62727 (HIGH)
- python-multipart 0.0.22 -> 0.0.27: fixes CVE-2026-40347 (MEDIUM)
- Remove starlette==0.41.2 constraint pin (only CORS middleware used, no breakage)
- Bump service version 0.1.5 -> 0.1.6

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 9, 2026

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ddaeefc. Configure here.

Comment thread pyproject.toml
# Constraints for transitive dependencies that need pinning for functional reasons
constraint-dependencies = [
# later versions of Starlette break middleware
"starlette==0.41.2",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Monkey-patched _get_form missing max_part_size parameter from starlette 1.0.0

High Severity

Removing the starlette==0.41.2 constraint allows upgrade to starlette 1.0.0, but prepline_general/api/app.py monkey-patches Request._get_form with a signature that only accepts max_files and max_fields. Starlette 0.44.0 (PR #2815, Dec 2024) added max_part_size to _get_form's signature, and form() forwards it. At runtime, starlette 1.0.0's form() will call _get_form(max_files=..., max_fields=..., max_part_size=...), causing a TypeError on the patched version. This breaks all multipart form uploads — the API's core functionality.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ddaeefc. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

resolved below

@lawrence-u10d lawrence-u10d marked this pull request as draft May 10, 2026 03:15
lawrence-u10d and others added 2 commits May 9, 2026 22:51
The lockfile was resolving all packages from the Azure DevOps private
feed, which requires authentication. CI lacks Azure credentials, causing
lint failures (401 Unauthorized on mypy-extensions download).

Add explicit PyPI index as default in pyproject.toml and regenerate the
lockfile so all public packages resolve from PyPI. The Azure feed
remains available via the uv-wrapper for local development when private
packages are needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Starlette 1.0.0 added max_part_size to _get_form's signature and
form() forwards it. Without this parameter, the monkey-patch raises
TypeError on all multipart form uploads.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lawrence-u10d lawrence-u10d marked this pull request as ready for review May 11, 2026 16:53
@lawrence-u10d lawrence-u10d merged commit 58d9c34 into main May 11, 2026
13 checks passed
@lawrence-u10d lawrence-u10d deleted the fix/cves-2026-05-09 branch May 11, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants