Skip to content

Fix starlette security vulnerabilities#464

Closed
hbrodin wants to merge 3 commits intomainfrom
fix/dependabot-starlette-vulnerability
Closed

Fix starlette security vulnerabilities#464
hbrodin wants to merge 3 commits intomainfrom
fix/dependabot-starlette-vulnerability

Conversation

@hbrodin
Copy link
Copy Markdown
Collaborator

@hbrodin hbrodin commented Feb 4, 2026

Summary

  • Upgrade FastAPI from ~0.115.6 to ~0.128.0 in orchestrator
  • Allows starlette >= 0.49.1 (now resolves to 0.50.0)
  • Fixes two security vulnerabilities in starlette

Security Issues Fixed

Dependabot Alert CVE Severity Description
#34 CVE-2025-62727 High O(n^2) DoS via Range header merging in FileResponse
#33 CVE-2025-54121 Medium DoS via large multipart file parsing

Why This Matters

The orchestrator uses FileResponse and StaticFiles (the vulnerable components) in orchestrator/src/buttercup/orchestrator/ui/competition_api/main.py.

Test plan

  • All orchestrator tests pass (297 passed, 2 skipped)
  • Linting passes
  • Verified starlette upgraded from 0.46.2 to 0.50.0

hbrodin and others added 3 commits January 30, 2026 13:59
This refactors the uncovered lines tracking to properly handle functions
that use macros or have code spanning multiple files.

Key changes:
- Track coverage per file (FileLineCoverage) instead of mixing line numbers
- Identify primary file (where function is defined) by CODE region count
- Track macro call sites separately with call line + uncovered count
- Add UncoveredRanges utility for line set to protobuf conversion
- Add UncoveredLinesMap for Redis storage of uncovered lines data

The old model mixed lines from different files, making it impossible for
an LLM to know which file uncovered line numbers referred to. The new
model stores only primary file lines in uncovered ranges, with macro
call sites tracked separately.

Protobuf changes:
- Add MacroCallSite message
- Add UncoveredLines message with run-length encoding
- Add FunctionUncoveredLines with primary_file_path and macro_sites

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Documents a tree-based coverage representation that mirrors macro expansion
structure, designed to provide actionable guidance for LLMs generating
targeted fuzzing inputs.

Key concepts:
- CodeBlock: contiguous non-macro code with line-level coverage
- MacroExpansion: call site with recursive children from macro body
- FunctionCoverageHierarchy: complete tree for partial coverage functions

Only functions with partial coverage (0 < covered < total) are processed,
as fully covered or uncovered functions don't benefit from this analysis.

Includes algorithm for building the tree from LLVM coverage JSON,
protobuf message definitions, and LLM prompt generation format.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Upgrade FastAPI from ~0.115.6 to ~0.128.0 in orchestrator to allow
starlette >= 0.49.1, fixing:

- CVE-2025-62727 (High): O(n^2) DoS via Range header in FileResponse
- CVE-2025-54121 (Medium): DoS via large multipart file parsing

The orchestrator uses FileResponse and StaticFiles (the affected
components) in the competition API UI.

Resolves: Dependabot alerts #33, #34
@hbrodin hbrodin closed this Feb 4, 2026
@hbrodin hbrodin deleted the fix/dependabot-starlette-vulnerability branch February 4, 2026 13:54
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.

1 participant