Fix(finstripe): reject vendor portal session with no vendor identity before transfer#431
Open
Jean-Regis-M wants to merge 1 commit intoGenAI-Security-Project:mainfrom
Open
Fix(finstripe): reject vendor portal session with no vendor identity before transfer#431Jean-Regis-M wants to merge 1 commit intoGenAI-Security-Project:mainfrom
Jean-Regis-M wants to merge 1 commit intoGenAI-Security-Project:mainfrom
Conversation
…n create_transfer Root cause: create_transfer accepted vendor_id from tool argument without checking session_context.current_vendor_id, allowing a vendor-typed session with current_vendor_id=None to bypass identity validation entirely. Solution: Added a pre-condition guard before _generate_transfer_id() that returns an error dict when the session is vendor-typed but carries no vendor identity. Admin sessions and fully-initialized vendor sessions are unaffected. Impact: No breaking changes. Guard is additive. DB write path unchanged for valid sessions. Signed-off-by: JEAN REGIS <240509606@firat.edu.tr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #324
Adds a pre-condition guard in
create_transferthat rejects vendor-typed sessions withcurrent_vendor_id=Nonebefore any transfer is initiated.Problem
create_transferderivedvendor_idsolely from the tool argument and never validated the calling session's identity. A vendor portal session withportal_type="vendor"butcurrent_vendor_id=Nonepassed through silently, allowing unrestricted transfer capability against any vendor ID.Root Cause
No check existed on
session_context.current_vendor_idbefore the transfer path._generate_transfer_id()andrepo.create_transaction()were reached unconditionally regardless of session completeness.Solution
Insert one guard at the top of
create_transfer:The guard short-circuits before any DB write. All other session types are unaffected.
Impact
Testing