miracum / ahd2fhir

A REST service for mapping text analysis results from Averbis Health Discovery to FHIR resources.
Apache License 2.0
8 stars 0 forks source link

chore(deps): update dependency starlette to v0.40.0 [security] #194

Closed renovate[bot] closed 1 month ago

renovate[bot] commented 1 month ago

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
starlette (changelog) ==0.37.2 -> ==0.40.0 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2024-47874

Summary

Starlette treats multipart/form-data parts without a filename as text form fields and buffers those in byte strings with no size limit. This allows an attacker to upload arbitrary large form fields and cause Starlette to both slow down significantly due to excessive memory allocations and copy operations, and also consume more and more memory until the server starts swapping and grinds to a halt, or the OS terminates the server process with an OOM error. Uploading multiple such requests in parallel may be enough to render a service practically unusable, even if reasonable request size limits are enforced by a reverse proxy in front of Starlette.

PoC

from starlette.applications import Starlette
from starlette.routing import Route

async def poc(request):
    async with request.form():
        pass

app = Starlette(routes=[
    Route('/', poc, methods=["POST"]),
])
curl http://localhost:8000 -F 'big=</dev/urandom'

Impact

This Denial of service (DoS) vulnerability affects all applications built with Starlette (or FastAPI) accepting form requests.


Release Notes

encode/starlette (starlette) ### [`v0.40.0`](https://redirect.github.com/encode/starlette/releases/tag/0.40.0): Version 0.40.0 [Compare Source](https://redirect.github.com/encode/starlette/compare/0.39.2...0.40.0) This release fixes a Denial of service (DoS) via `multipart/form-data` requests. You can view the full security advisory: [GHSA-f96h-pmfr-66vw](https://redirect.github.com/encode/starlette/security/advisories/GHSA-f96h-pmfr-66vw) #### Fixed - Add `max_part_size` to `MultiPartParser` to limit the size of parts in `multipart/form-data` requests [fd038f3](https://redirect.github.com/encode/starlette/commit/fd038f3070c302bff17ef7d173dbb0b007617733). ### [`v0.39.2`](https://redirect.github.com/encode/starlette/releases/tag/0.39.2): Version 0.39.2 [Compare Source](https://redirect.github.com/encode/starlette/compare/0.39.1...0.39.2) ##### Fixed - Allow use of `request.url_for` when only "app" scope is available [#​2672](https://redirect.github.com/encode/starlette/pull/2672). - Fix internal type hints to support `python-multipart==0.0.12` [#​2708](https://redirect.github.com/encode/starlette/pull/2708). *** **Full Changelog**: https://github.com/encode/starlette/compare/0.39.1...0.39.2 ### [`v0.39.1`](https://redirect.github.com/encode/starlette/releases/tag/0.39.1): Version 0.39.1 [Compare Source](https://redirect.github.com/encode/starlette/compare/0.39.0...0.39.1) #### Fixed - Avoid regex re-compilation in `responses.py` and `schemas.py` [#​2700](https://redirect.github.com/encode/starlette/pull/2700). - Improve performance of `get_route_path` by removing regular expression usage [#​2701](https://redirect.github.com/encode/starlette/pull/2701). - Consider `FileResponse.chunk_size` when handling multiple ranges [#​2703](https://redirect.github.com/encode/starlette/pull/2703). - Use `token_hex` for generating multipart boundary strings [#​2702](https://redirect.github.com/encode/starlette/pull/2702). *** **Full Changelog**: https://github.com/encode/starlette/compare/0.39.0...0.39.1 ### [`v0.39.0`](https://redirect.github.com/encode/starlette/releases/tag/0.39.0): Version 0.39.0 [Compare Source](https://redirect.github.com/encode/starlette/compare/0.38.6...0.39.0) #### Added - Add support for HTTP Range to `FileResponse` [#​2697](https://redirect.github.com/encode/starlette/pull/2697) *** **Full Changelog**: https://github.com/encode/starlette/compare/0.38.6...0.39.0 ### [`v0.38.6`](https://redirect.github.com/encode/starlette/releases/tag/0.38.6): Version 0.38.6 [Compare Source](https://redirect.github.com/encode/starlette/compare/0.38.5...0.38.6) #### Fixed - Close unclosed `MemoryObjectReceiveStream` in `TestClient` [#​2693](https://redirect.github.com/encode/starlette/pull/2693). *** **Full Changelog**: https://github.com/encode/starlette/compare/0.38.5...0.38.6 ### [`v0.38.5`](https://redirect.github.com/encode/starlette/releases/tag/0.38.5): Version 0.38.5 [Compare Source](https://redirect.github.com/encode/starlette/compare/0.38.4...0.38.5) #### Fixed - Schedule `BackgroundTasks` from within `BaseHTTPMiddleware` [#​2688](https://redirect.github.com/encode/starlette/pull/2688). This behavior was removed in 0.38.3, and is now restored. *** **Full Changelog**: https://github.com/encode/starlette/compare/0.38.4...0.38.5 ### [`v0.38.4`](https://redirect.github.com/encode/starlette/releases/tag/0.38.4): Version 0.38.4 [Compare Source](https://redirect.github.com/encode/starlette/compare/0.38.3...0.38.4) #### Fixed - Ensure accurate `root_path` removal in `get_route_path` function [#​2600](https://redirect.github.com/encode/starlette/pull/2600) *** **Full Changelog**: https://github.com/encode/starlette/compare/0.38.3...0.38.4 ### [`v0.38.3`](https://redirect.github.com/encode/starlette/releases/tag/0.38.3): Version 0.38.3 [Compare Source](https://redirect.github.com/encode/starlette/compare/0.38.2...0.38.3) ##### Added - Support for Python 3.13 [#​2662](https://redirect.github.com/encode/starlette/pull/2662). ##### Fixed - Don't poll for disconnects in `BaseHTTPMiddleware` via `StreamingResponse` [#​2620](https://redirect.github.com/encode/starlette/pull/2620). *** **Full Changelog**: https://github.com/encode/starlette/compare/0.38.2...0.38.3 ### [`v0.38.2`](https://redirect.github.com/encode/starlette/releases/tag/0.38.2): Version 0.38.2 [Compare Source](https://redirect.github.com/encode/starlette/compare/0.38.1...0.38.2) #### Fixed - Fix `routing.get_name()` not to assume all routines have `__name__` [#​2648](https://redirect.github.com/encode/starlette/pull/2648) *** **Full Changelog**: https://github.com/encode/starlette/compare/0.38.1...0.38.2 ### [`v0.38.1`](https://redirect.github.com/encode/starlette/releases/tag/0.38.1): Version 0.38.1 [Compare Source](https://redirect.github.com/encode/starlette/compare/0.38.0...0.38.1) ##### Removed - Revert "Add support for ASGI pathsend extension" [#​2649](https://redirect.github.com/encode/starlette/2649). *** **Full Changelog**: https://github.com/encode/starlette/compare/0.38.0...0.38.1 ### [`v0.38.0`](https://redirect.github.com/encode/starlette/releases/tag/0.38.0): Version 0.38.0 [Compare Source](https://redirect.github.com/encode/starlette/compare/0.37.2...0.38.0) #### Added - Allow use of `memoryview` in `StreamingResponse` and `Response` [#​2576](https://redirect.github.com/encode/starlette/pull/2576) and [#​2577](https://redirect.github.com/encode/starlette/pull/2577). - Send 404 instead of 500 when filename requested is too long on `StaticFiles` [#​2583](https://redirect.github.com/encode/starlette/pull/2583). #### Changed - Fail fast on invalid `Jinja2Template` instantiation parameters [#​2568](https://redirect.github.com/encode/starlette/pull/2568). - Check endpoint handler is async only once [#​2536](https://redirect.github.com/encode/starlette/pull/2536). #### Fixed - Add proper synchronization to `WebSocketTestSession` [#​2597](https://redirect.github.com/encode/starlette/pull/2597). *** **Full Changelog**: https://github.com/encode/starlette/compare/0.37.2...0.38.0

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.



This PR was generated by Mend Renovate. View the repository job log.

github-actions[bot] commented 1 month ago

Trivy image scan report

ghcr.io/miracum/ahd2fhir:pr-194 (debian 12.6)

24 known vulnerabilities found (LOW: 4 CRITICAL: 7 HIGH: 4 MEDIUM: 9)

Show detailed table of vulnerabilities
Package ID Severity Installed Version Fixed Version
libexpat1 CVE-2024-45490 CRITICAL 2.5.0-1 2.5.0-1+deb12u1
libexpat1 CVE-2024-45491 CRITICAL 2.5.0-1 2.5.0-1+deb12u1
libexpat1 CVE-2024-45492 CRITICAL 2.5.0-1 2.5.0-1+deb12u1
libgssapi-krb5-2 CVE-2024-37371 CRITICAL 1.20.1-2+deb12u1 1.20.1-2+deb12u2
libgssapi-krb5-2 CVE-2024-37370 HIGH 1.20.1-2+deb12u1 1.20.1-2+deb12u2
libk5crypto3 CVE-2024-37371 CRITICAL 1.20.1-2+deb12u1 1.20.1-2+deb12u2
libk5crypto3 CVE-2024-37370 HIGH 1.20.1-2+deb12u1 1.20.1-2+deb12u2
libkrb5-3 CVE-2024-37371 CRITICAL 1.20.1-2+deb12u1 1.20.1-2+deb12u2
libkrb5-3 CVE-2024-37370 HIGH 1.20.1-2+deb12u1 1.20.1-2+deb12u2
libkrb5support0 CVE-2024-37371 CRITICAL 1.20.1-2+deb12u1 1.20.1-2+deb12u2
libkrb5support0 CVE-2024-37370 HIGH 1.20.1-2+deb12u1 1.20.1-2+deb12u2
libpython3.11-minimal CVE-2024-0397 MEDIUM 3.11.2-6+deb12u2 3.11.2-6+deb12u3
libpython3.11-minimal CVE-2024-8088 MEDIUM 3.11.2-6+deb12u2 3.11.2-6+deb12u3
libpython3.11-minimal CVE-2024-4032 LOW 3.11.2-6+deb12u2 3.11.2-6+deb12u3
libpython3.11-stdlib CVE-2024-0397 MEDIUM 3.11.2-6+deb12u2 3.11.2-6+deb12u3
libpython3.11-stdlib CVE-2024-8088 MEDIUM 3.11.2-6+deb12u2 3.11.2-6+deb12u3
libpython3.11-stdlib CVE-2024-4032 LOW 3.11.2-6+deb12u2 3.11.2-6+deb12u3
libssl3 CVE-2024-4603 MEDIUM 3.0.13-1~deb12u1 3.0.14-1~deb12u1
libssl3 CVE-2024-4741 MEDIUM 3.0.13-1~deb12u1 3.0.14-1~deb12u1
libssl3 CVE-2024-6119 MEDIUM 3.0.13-1~deb12u1 3.0.14-1~deb12u2
libssl3 CVE-2024-2511 LOW 3.0.13-1~deb12u1 3.0.14-1~deb12u1
python3.11-minimal CVE-2024-0397 MEDIUM 3.11.2-6+deb12u2 3.11.2-6+deb12u3
python3.11-minimal CVE-2024-8088 MEDIUM 3.11.2-6+deb12u2 3.11.2-6+deb12u3
python3.11-minimal CVE-2024-4032 LOW 3.11.2-6+deb12u2 3.11.2-6+deb12u3

No Misconfigurations found

Python

1 known vulnerabilities found (LOW: 0 CRITICAL: 0 HIGH: 1 MEDIUM: 0)

Show detailed table of vulnerabilities
Package ID Severity Installed Version Fixed Version
setuptools CVE-2024-6345 HIGH 65.5.1 70.0.0

No Misconfigurations found

github-actions[bot] commented 1 month ago

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 5 0 0.04s
✅ BASH bash-exec 2 0 0.05s
✅ BASH shellcheck 2 0 0.01s
✅ BASH shfmt 2 0 0.0s
✅ DOCKERFILE hadolint 2 0 0.2s
✅ JSON jsonlint 16 0 0.38s
✅ JSON npm-package-json-lint yes no 0.64s
✅ JSON prettier 16 0 1.75s
✅ MARKDOWN markdownlint 3 0 0.6s
✅ PYTHON bandit 31 0 1.55s
✅ PYTHON black 31 0 1.89s
✅ PYTHON flake8 31 0 1.11s
✅ PYTHON isort 31 0 0.43s
✅ PYTHON mypy 31 0 9.87s
✅ PYTHON pyright 31 0 9.74s
✅ PYTHON ruff 31 0 0.05s
✅ REPOSITORY checkov yes no 17.7s
✅ REPOSITORY gitleaks yes no 0.1s
✅ REPOSITORY git_diff yes no 0.02s
✅ REPOSITORY grype yes no 17.19s
✅ REPOSITORY kics yes no 33.29s
✅ REPOSITORY secretlint yes no 0.97s
✅ REPOSITORY syft yes no 0.6s
✅ REPOSITORY trivy yes no 11.67s
✅ REPOSITORY trivy-sbom yes no 3.12s
✅ REPOSITORY trufflehog yes no 5.27s
✅ YAML prettier 15 0 0.93s
✅ YAML yamllint 15 0 0.55s

See detailed report in MegaLinter reports

You could have same capabilities but better runtime performances if you request a new MegaLinter flavor.

_MegaLinter is graciously provided by OX Security_

miracum-bot commented 1 month ago

:tada: This PR is included in version 4.0.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: