Skip to content

Verifiers: a blank Stripe refund id is unverified, never verified - #14

Merged
dhonitheja merged 1 commit into
mainfrom
fix/blank-ids-unverified
Nov 23, 2026
Merged

dhonitheja merged 1 commit into
mainfrom
fix/blank-ids-unverified

Conversation

@dhonitheja

@dhonitheja dhonitheja commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Before: a Stripe refund whose id was "" or only whitespace passed the id check, became a snapshot key, and could make check() return verified for an otherwise matching refund claim.

After: a blank or whitespace-only refund id is a malformed read, so the verdict is unverified.

This is the Stripe twin of the whitespace-only Appointment id that CodeRabbit flagged on #11 (already fixed on main in 1ab2852). The empty actor list case from #10 was also already fixed (7e4b89e); this PR adds end-to-end regression cases for both FHIR shapes too.

How: stripe.py now rejects ids whose .strip() is empty. New tests: two malformed Stripe pages (empty and whitespace ids), an end-to-end check that a blank-id refund is unverified (it returned verified on main before the fix), and FHIR malformed bundles for empty id, whitespace id and an actor given as [{}]. CHANGELOG has an Unreleased entry. Suite: 181 passed, 11 skipped (optional LangGraph and MCP extras not installed).


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Stripe refund IDs that are empty or contain only whitespace are treated as malformed, so they cannot verify a matching claim. These cases return an unverified result with an unreachable finding.
  • Tests
    • Added regression coverage for malformed Stripe refund IDs and FHIR Appointment data, including empty or whitespace-only identifiers and malformed actor values.

A refund id of "" or whitespace passed the empty check, became a
snapshot key, and let an otherwise matching refund return verified.
FHIR Appointment ids were already rejected; this adds end-to-end
regression cases for blank FHIR ids and actor shapes too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T21:06:38.054907Z 864d9e7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Malformed identifier handling

Layer / File(s) Summary
Reject malformed verifier identifiers
agent_readback/verifiers/stripe.py, tests/test_stripe_sql_alerts.py, tests/test_fhir_verifier.py, CHANGELOG.md
Stripe refund parsing rejects whitespace-only IDs. Tests cover empty and whitespace-only Stripe refund IDs, the resulting UNVERIFIED finding for a matching refund page, and malformed FHIR response fixtures. The changelog records the Stripe fix and FHIR regression coverage.

Possibly related PRs

Change: Bug fix

Merge Risk: Minimal · up to 864d9

Stripe refund pages with blank or whitespace-only IDs now return an unverified result instead of possibly verifying. The change is small and covered by regression tests, and no merge-blocking risk was found.

Security architecture risk: Minimal · up to 864d9

The change prevents a refund with a whitespace-only ID from verifying a claim. It uses the existing unverified outcome for malformed responses and does not expand access or permissions.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3585102c-9ed1-44d3-ae1b-4a6bb8854cfe
Commits

Reviewing files that changed from the base of the PR and between 42c520b and 864d9e7.

Files selected for processing: 4

  • CHANGELOG.md
  • agent_readback/verifiers/stripe.py
  • tests/test_fhir_verifier.py
  • tests/test_stripe_sql_alerts.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

Please cover QA and security in this review:

  • QA: are the new regression tests sufficient for blank or whitespace-only ids on both the Stripe and FHIR paths, and is any similar case left uncovered?
  • Security: can any other malformed or hostile server response still make a verifier return verified when it should be unverified?

Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Action performed

Full review finished.

@dhonitheja
dhonitheja merged commit bbaeb6f into main Nov 23, 2026
10 checks passed
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