From f0d0b9f7f6f785238426aa7037633122a355b3f1 Mon Sep 17 00:00:00 2001 From: shuningc Date: Fri, 24 Jul 2026 15:34:13 -0700 Subject: [PATCH] VULN-88813: upgrade starlette to >=1.3.1, fastapi to ^0.135.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pin starlette >=1.3.1 (optional dep) and bump dev fastapi to ^0.135.0 to resolve DoS in request.form() urlencoded body handling. Document Starlette 0.x→1.x breaking change and pydantic v2 dev requirement. Co-authored-by: Cursor --- CHANGELOG.md | 4 ++++ CONTRIBUTING.md | 2 ++ poetry.lock | 32 ++++++++++++++++++-------------- pyproject.toml | 4 ++-- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a0046d0..3db30886 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ ## Unreleased +### Security + +- **deps (VULN-88813)**: Raise the optional `starlette` floor to `>=1.3.1` (from `>=0.27.0`) to remediate urlencoded form limit bypass in `request.form()`. Starlette 1.x removes APIs deprecated since 0.x; consumers of the `middleware`, `openai`, or `crewai` extras who rely on removed Starlette 0.x APIs may need to update custom middleware. + ### Features - **New `generated_output` field**: Add `generated_output` field to `DatasetRecord` for storing model-generated outputs separately from ground truth. This allows you to track both the expected output (ground truth) and the actual model output in the same dataset record. In the UI, this field is displayed as "Generated Output". diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5617ed8c..9f09c1f0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,6 +46,8 @@ poetry run pytest ``` + Dev dependencies (including `fastapi ^0.135.0`) resolve against **Pydantic v2** (`>=2.9.0`). Use `poetry install --sync` after pulling lockfile changes so your local environment matches CI. + ## Auto-generating the API client 1. Run `./scripts/import-openapi-yaml.sh https://api.galileo.ai/client` to update the openapi.yml file with the latest client spec diff --git a/poetry.lock b/poetry.lock index eb825a16..cd855d9e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -976,24 +976,27 @@ testing = ["hatch", "pre-commit", "pytest", "tox"] [[package]] name = "fastapi" -version = "0.115.14" +version = "0.135.4" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" optional = false -python-versions = ">=3.8" +python-versions = ">=3.10" groups = ["dev"] files = [ - {file = "fastapi-0.115.14-py3-none-any.whl", hash = "sha256:6c0c8bf9420bd58f565e585036d971872472b4f7d3f6c73b698e10cffdefb3ca"}, - {file = "fastapi-0.115.14.tar.gz", hash = "sha256:b1de15cdc1c499a4da47914db35d0e4ef8f1ce62b624e94e0e5824421df99739"}, + {file = "fastapi-0.135.4-py3-none-any.whl", hash = "sha256:539d3531f8aba9b286ab44658344553f4a4adc218529137501e5d97be071a78b"}, + {file = "fastapi-0.135.4.tar.gz", hash = "sha256:d87c41b0a7bcaa6f14629d73fe48e360821605c7b6d518caacbc00dcf8fa5e0e"}, ] [package.dependencies] -pydantic = ">=1.7.4,<1.8 || >1.8,<1.8.1 || >1.8.1,<2.0.0 || >2.0.0,<2.0.1 || >2.0.1,<2.1.0 || >2.1.0,<3.0.0" -starlette = ">=0.40.0,<0.47.0" +annotated-doc = ">=0.0.2" +pydantic = ">=2.9.0" +starlette = ">=0.46.0" typing-extensions = ">=4.8.0" +typing-inspection = ">=0.4.2" [package.extras] -all = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=3.1.5)", "orjson (>=3.2.1)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.18)", "pyyaml (>=5.3.1)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0)", "uvicorn[standard] (>=0.12.0)"] -standard = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.5)", "httpx (>=0.23.0)", "jinja2 (>=3.1.5)", "python-multipart (>=0.0.18)", "uvicorn[standard] (>=0.12.0)"] +all = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.8)", "httpx (>=0.23.0,<1.0.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=3.1.5)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.18)", "pyyaml (>=5.3.1)", "uvicorn[standard] (>=0.12.0)"] +standard = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.8)", "httpx (>=0.23.0,<1.0.0)", "jinja2 (>=3.1.5)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.18)", "uvicorn[standard] (>=0.12.0)"] +standard-no-fastapi-cloud-cli = ["email-validator (>=2.0.0)", "fastapi-cli[standard-no-fastapi-cloud-cli] (>=0.0.8)", "httpx (>=0.23.0,<1.0.0)", "jinja2 (>=3.1.5)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.18)", "uvicorn[standard] (>=0.12.0)"] [[package]] name = "fastuuid" @@ -5120,22 +5123,23 @@ uvicorn = ["uvicorn (>=0.34.0)"] [[package]] name = "starlette" -version = "0.46.2" +version = "1.3.1" description = "The little ASGI library that shines." optional = false -python-versions = ">=3.9" +python-versions = ">=3.10" groups = ["main", "dev"] files = [ - {file = "starlette-0.46.2-py3-none-any.whl", hash = "sha256:595633ce89f8ffa71a015caed34a5b2dc1c0cdb3f0f1fbd1e69339cf2abeec35"}, - {file = "starlette-0.46.2.tar.gz", hash = "sha256:7f7361f34eed179294600af672f565727419830b54b7b084efe44bb82d2fccd5"}, + {file = "starlette-1.3.1-py3-none-any.whl", hash = "sha256:c7372aae11c3c3f26a42df7bd626cec2f47d03483d261d369516a615a53714c6"}, + {file = "starlette-1.3.1.tar.gz", hash = "sha256:05d0213193f2fbaae60e2ecb593b4add4262ad4e46536b54abe36f11a71724e0"}, ] markers = {main = "extra == \"openai\" or extra == \"all\" or extra == \"middleware\" or python_version <= \"3.13\" and (extra == \"openai\" or extra == \"all\" or extra == \"middleware\" or extra == \"crewai\")"} [package.dependencies] anyio = ">=3.6.2,<5" +typing-extensions = {version = ">=4.10.0", markers = "python_version < \"3.13\""} [package.extras] -full = ["httpx (>=0.27.0,<0.29.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.18)", "pyyaml"] +full = ["httpx (>=0.27.0,<0.29.0)", "httpx2 (>=2.0.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.18)", "pyyaml"] [[package]] name = "sympy" @@ -6539,4 +6543,4 @@ openai = ["openai", "openai-agents", "packaging"] [metadata] lock-version = "2.1" python-versions = "^3.11,<3.15" -content-hash = "17558442036169d72254036e99d9d45a127aba90287be42b80b47d558e7d9326" +content-hash = "4be09f07a946e37f06e9a22b5c1030028f221d96b2b7c87e89d14fce070f9b97" diff --git a/pyproject.toml b/pyproject.toml index f9664c24..6867c1fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ openai-agents = { version = ">=0.4.0,<1.0.0", optional = true } litellm = { version = ">=1.83.14,<2.0.0", optional = true, python = ">=3.11,<3.14" } galileo-core = "^4.4.0" httpx = ">=0.27.0,<0.29.0" -starlette = { version = ">=0.27.0", optional = true } +starlette = { version = ">=1.3.1", optional = true } backoff = "^2.2.1" crewai = { version = ">=0.152.0,<2.0.0", optional = true, python = ">=3.11,<3.14" } tqdm = { version = ">=4.0.0" } @@ -78,7 +78,7 @@ pre-commit = "^4.0.1" mypy = "^1.16.0" invoke = "^2.2.0" openai = ">=2.8.0,<3.0.0" -fastapi = "^0.115.0" +fastapi = "^0.135.0" ruff = "^0.15.22" openapi-python-client = "^0.29.0" yq = "^3.4.3"