Skip to content

fix(security): sanitize CWE-209 response errors - #1725

Draft
groupthinking with Copilot wants to merge 2 commits into
mainfrom
copilot/claudedetermined-maxwell-7xje6x
Draft

fix(security): sanitize CWE-209 response errors#1725
groupthinking with Copilot wants to merge 2 commits into
mainfrom
copilot/claudedetermined-maxwell-7xje6x

Conversation

Copilot AI commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Canonical issue

Outcome

Prevents exception diagnostics from reaching HTTP clients through generated endpoints, persisted response trees, and 5xx response constructors while retaining server-side logs.

Scope

  • Included:
    • Static client-safe errors for generated, cloud, real API, and adapter paths.
    • Recursive sanitization of persisted error, error_message, and errors response fields.
    • AST guard coverage for 500–599 statuses, positional JSONResponse bodies, and src/uvai/ml.
  • Explicitly excluded:
    • Workflow, dependency, and deployment changes.
except Exception:
    logger.exception("Generated endpoint failed")
    raise HTTPException(status_code=500, detail="Internal server error")

Risk

  • Risk level: low
  • Failure mode: Clients receive stable generic error text instead of provider diagnostics.
  • Rollback: Revert b22dda0.

Verification

Current head: b22dda0

  • Focused tests — 221 passed
  • Required CI
  • Review threads resolved

Production evidence

Not applicable: changes affect Python backend paths; Vercel preview builds apps/web.

Agent handoff

  • One canonical issue is linked
  • No competing PR implements the same issue
  • Acceptance criteria are satisfied
  • Required checks pass on the current head
  • Human decision is requested only for product, security, irreversible infrastructure, or production approval

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
v0-uvai Ready Ready Preview, v0 Sep 8, 2026 10:57pm UTC

Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove CWE-209 response-body leaks for security fix(security): sanitize CWE-209 response errors Sep 8, 2026
Copilot AI requested a review from groupthinking September 8, 2026 22:58
# round-trip, which would otherwise re-serialise the payload on
# the event loop in proportion to its size.
return Response(content=video_data, media_type="application/json")
return Response(

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.

The CWE-209 response sanitization (JSON parse + recursive tree-walk + re-serialize) runs synchronously on the asyncio event loop in get_video_analysis and get_processed_videos_list, reintroducing the exact size-proportional loop stall the surrounding worker-thread offload was designed to prevent.

Fix on Vercel

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.

Execution: remove CWE-209 response-body leaks (PR #831)

2 participants