Skip to content

fix: escape ticket_id before interpolating into PostgREST filters in ai.py - #26

Draft
sonnymay wants to merge 1 commit into
mainfrom
claude/sleepy-lamport-afq257
Draft

sonnymay wants to merge 1 commit into
mainfrom
claude/sleepy-lamport-afq257

Conversation

@sonnymay

Copy link
Copy Markdown
Owner

Summary

Test plan

  • Added backend/test_ai.py with regression tests asserting _fetch_ticket and _fetch_notes escape injected query-string delimiters in ticket_id.
  • Ran the full backend suite (python3 -m pytest -q): 44 passed including the 2 new tests, plus 1 pre-existing, unrelated failure (test_get_headers_uses_supabase_key) confirmed present on the unmodified tree too (environment-dependent, missing SUPABASE_URL in isolation).
  • Updated CHANGELOG.md under [Unreleased] / Fixed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SGNgeN62cZWwyUxDLGpNxi


Generated by Claude Code

…ai.py

POST /ai/suggest passed the request body's ticket_id straight into
db_get filter strings in _fetch_ticket and _fetch_notes, unlike every
other {id}-based lookup which now goes through escape_filter_value
(#18, #19). A crafted ticket_id could append extra query parameters
or filter conditions to the Supabase REST request. Add regression
tests covering both helpers.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGNgeN62cZWwyUxDLGpNxi
@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
supportops Ready Ready Preview Sep 16, 2026 2:08pm UTC

This branch was successfully deployed

1 active deployment
Preview — 45356996 Deployed Sep 16, 2026 by vercel[bot]
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