Review fixes: opaque page_token cursor, raw-next has_more, FAQ citation
Round-1 review blocker: the path-shaped page_token with a
startsWith("/matters.json") guard was traversal-bypassable because
buildUrl's new URL() normalises ".." segments (DURABLE_LESSONS
2026-07-28 class). Redesigned to an opaque cursor:
matterPageTokenFromNext now parses meta.paging.next, requires the exact
Manage API origin and exact <apiBase>/matters.json pathname, and
extracts only the page_token query-param value; the continuation
request is rebuilt from named parts (hardcoded path, our fields+limit,
repeated query/status per the schema) so a model-supplied string never
becomes a request path. has_more now derives from the raw presence of
meta.paging.next, never from cursor extraction success. Status-filter
citation pinned to docs.developers.clio.com/faq/ (case sensitivity
undocumented; lowercase literals enforced); at-least-one-argument rule
stated in the function description. Tests: traversal/suffix-path/
off-host/protocol-relative next URLs rejected, traversal-shaped
page_token asserted to never reach the path, continuation rebuild
asserted to carry fields+limit+cursor. 620/620 tests, tsc + prettier
clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| Repository | Sloth-ninja/JessicaOSS |
|---|---|
| Author | sloth-ninja <ezanahaddis@gmail.com> |
| Authored | |
| Parents | faaf5a6b |
| Stats | 3 files changed , +183 , -80 |
| Part of | Clio connector: per-user OAuth, chat tools, and matter search |
Capture this commit into my fork
Download a Markdown prompt that tells Claude how to port this
exact commit into your working tree. Run it via
claude -p < capture-commit-11373e51.md
from inside the repo you want the change in.