Skip to content

fix(mcp): persist vendor_account on FinStripe transfers - #563

Open
Deez-Automations wants to merge 1 commit into
GenAI-Security-Project:mainfrom
Deez-Automations:fix/finstripe-vendor-account-persist-328
Open

fix(mcp): persist vendor_account on FinStripe transfers#563
Deez-Automations wants to merge 1 commit into
GenAI-Security-Project:mainfrom
Deez-Automations:fix/finstripe-vendor-account-persist-328

Conversation

@Deez-Automations

Copy link
Copy Markdown

Summary

Fixes #328.

create_transfer echoed vendor_account back in its own response, but PaymentTransaction had no column for it at all — the value was never actually stored anywhere. get_transfer and list_transfers (both looking the same transaction back up) always returned nothing for it. The real destination bank account was only ever visible in the immediate tool-call response, making it unrecoverable from the audit trail — a genuine forensic gap for investigating a misdirected payment.

Fix

  • Added the missing vendor_account column to PaymentTransaction
  • PaymentTransactionRepository.create_transaction now accepts and persists it
  • create_transfer passes it through
  • to_dict() now includes it, so get_transfer and list_transfers return the real, persisted value
  • Included a proper Alembic migration, chained after the current head (a3f7c2d91e04)

Checked that create_transaction has exactly one call site in the whole codebase, and it already uses keyword arguments exclusively — inserting the new parameter mid-signature carries no risk of silently misaligning a positional caller.

Test plan

  • New test file tests/unit/mcp/test_finstripe.py — reproduces the exact issue repro steps (create a transfer, look it back up, confirm the account is missing) against the unfixed code first, then confirms the fix
  • Also covers list_transfers returning the persisted account
  • Migration independently verified: applied cleanly end-to-end against a real (throwaway) copy of the database, confirmed the column lands correctly with the right type/nullability, then discarded the copy
  • pytest tests/unit/mcp/test_finstripe.py — 2/2 passing

…ty-Project#328)

create_transfer echoed vendor_account back in its own response, but
PaymentTransaction had no column for it at all -- the value was never
actually stored. get_transfer and list_transfers always returned nothing
for it. The real destination bank account was only ever visible in the
immediate tool-call response, making it unrecoverable from the audit
trail for investigating a misdirected payment.

Adds the missing column, persists it in create_transaction, and includes
a proper Alembic migration (verified applying cleanly against a real
schema, chained after the current head). Only one call site exists for
create_transaction in the whole codebase and it already uses keyword
arguments exclusively, so inserting the new parameter mid-signature is
safe.

Fixes GenAI-Security-Project#328
Copilot AI lite review requested due to automatic review settings August 11, 2026 15:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a FinStripe MCP audit gap where vendor_account was returned by create_transfer but never persisted, causing get_transfer and list_transfers to omit the destination account when retrieving transfers later.

Changes:

  • Add vendor_account column to the PaymentTransaction model and include it in to_dict().
  • Persist vendor_account via PaymentTransactionRepository.create_transaction and pass it through from create_transfer.
  • Add an Alembic migration and new unit tests covering get_transfer and list_transfers behavior.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/unit/mcp/test_finstripe.py Adds unit tests that reproduce the persistence bug and verify vendor_account is retrievable via get_transfer and list_transfers.
migrations/versions/2026_08_11_add_vendor_account_to_payment_transactions.py Adds Alembic migration to create the vendor_account column on payment_transactions.
finbot/mcp/servers/finstripe/server.py Passes vendor_account into transaction creation during create_transfer.
finbot/mcp/servers/finstripe/repositories.py Updates create_transaction to accept and persist vendor_account.
finbot/mcp/servers/finstripe/models.py Adds vendor_account column and includes it in serialized transfer output.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

Bug_119_MUST_FIX: Test Case MCP-CREATE-012: vendor_account not persisted — destination account unrecoverable from audit trail

2 participants