Skip to content

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

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

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

Conversation

@sonnymay

Copy link
Copy Markdown
Owner

Summary

Test plan

  • Added backend/test_ai.py with regression tests asserting that a crafted ticket_id (e.g. t1&status=eq.Closed) is percent-encoded before it reaches the Supabase query string, for both _fetch_ticket and _fetch_notes.
  • Ran the full backend suite: python3 -m pytest — 46 passed.
  • Ran ruff check on the changed files — no issues.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Hv295zWJQ6j3qxjCHcgWrX


Generated by Claude Code

…ai.py

_fetch_ticket and _fetch_notes built PostgREST filter strings from raw
ticket_id, which reaches them unescaped from the public POST /ai/suggest
body. This is the same PostgREST filter injection class fixed in main.py
(#18, #19) but the ai module was missed. Apply escape_filter_value() the
same way and add regression tests covering both helpers.

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

vercel Bot commented Sep 10, 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 10, 2026 6:37pm UTC

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