You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[$175] Workspace admin can view card transactions from a different workspace (Y) in a shared Expensify Card program despite not being a member/admin there #104221
Version Number: Reproducible in staging?: Needs Reproduction (Reproduction blocked) Reproducible in production?: Needs Reproduction If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@sofiainteriano Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Sign in as admin of Workspace X.
Open the card transaction feed.
Review the visible transactions.
Observe that transactions from Workspace Y are displayed, even though the user is not part of that workspace.
Expected Result:
The user should only be able to view card transactions from Workspace X, the workspace where they are an admin.
Actual Result:
The user can also view card transactions associated with Workspace Y.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Medium confidence. I couldn't reproduce this. The test account has no Expensify Card program, and the screenshots are only in Slack. Product also needs to confirm the intended behavior first (see below).
What is the root cause of that problem?
When an Expensify Card feed is linked to several workspaces, they all share one fundID. The View transactions link under Current balance searches the whole feed and doesn't filter by workspace:
The query has no workspace: filter, so Search returns every transaction on the shared feed. That includes Workspace Y's transactions.
The card list behaves differently. It already shows only the current workspace's members (WorkspaceExpensifyCardListPage.tsx:138-142, via getCardsByCardholderName). The help article also says: "Each workspace shows only its own members in the card list, but all workspaces share the same card feed and settlement account." So Workspace X's admin can't see Workspace Y's cards, but can see their transactions.
What changes do you think we should make in order to solve the problem?
First, product needs to decide whether shared-feed admins should see transactions from every linked workspace.
If they should not: in handleViewTransactionsPress, add the current policyID as a workspace filter to the Search query. This matches how the card list is already scoped.
If they should: this is expected behavior, and you can close the issue. Add View transactions shortcut under Current balance added this link to list the transactions that count toward the feed's Current balance. That balance covers the whole shared feed.
The App change only changes this one link. Workspace X's admin could still type a feed: search by hand. Real access control belongs on the server, which decides what a feed: search returns. If product wants it enforced, that is a separate change outside the App repo.
What alternative solutions did you explore? (Optional)
Keep the feed-wide query, but label it clearly. For example, show "Transactions on this shared feed (all linked workspaces)". This keeps the totals consistent with Current balance.
Investigation details
useDefaultFundID resolves a workspace to its fund in this order: last-selected feed, then preferredPolicy, then linkedPolicyIDs (ExpensifyCardSettings.ts:50-53), then workspaceAccountID. Linked workspaces end up with the same fundID.
I found no App-side filtering of Search results by workspace or membership. The results come only from the backend.
I haven't confirmed that the reporter used the View transactions link. A typed Search with a feed:/card: filter would show the same thing. Either way, the reporter's Workspace X must be linked to a feed that Workspace Y also uses.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/104221) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
changed the title [-]Workspace admin can view card transactions from a different workspace (Y) in a shared Expensify Card program despite not being a member/admin there[/-][+][$175] Workspace admin can view card transactions from a different workspace (Y) in a shared Expensify Card program despite not being a member/admin there[/+]on Oct 16, 2026
Please re-state the problem that we are trying to solve in this issue.
In a shared Expensify Card program linked across multiple workspaces, an admin of Workspace X can view card transactions originating from Workspace Y by tapping "View transactions" under Current balance, even though they are neither an admin nor a member of Workspace Y.
What is the root cause of that problem?
When an Expensify Card program is shared across multiple workspaces, all linked workspaces share a single underlying fundID (useDefaultFundID.ts).
Missing Policy Scoping in WorkspaceCardsListLabel.tsx:
In src/pages/workspace/expensifyCard/WorkspaceCardsListLabel.tsx (lines 185–194), the handleViewTransactionsPress callback generates the following search query:
Notice that this search query filters strictly by the feed/fund identifier and omits the workspace/policy constraint.
Inconsistent Scoping Between Cards List and Transactions Shortcut:
In contrast, the card list on the same page (WorkspaceExpensifyCardListPage.tsx:138-142) already correctly restricts cards to current workspace members via getCardsByCardholderName (CardUtils.ts:820-829). However, because the "View transactions" shortcut queries the entire shared feed without workspace:${policyID}, Search returns every transaction on the feed across all linked workspaces.
What changes do you think we should make in order to solve the problem?
Scope Search Query to the Current Workspace:
In src/pages/workspace/expensifyCard/WorkspaceCardsListLabel.tsx:
Server-Side Authorization Alignment:
Ensure backend Search endpoint permissions enforce that users cannot bypass the UI shortcut by manually executing a feed:<fundID> search query to read transaction details belonging to workspaces they do not have permissions for.
What alternative solutions did you explore? (Optional)
We explored keeping the feed-wide search query and adding an in-app banner explaining that "Current balance reflects the entire shared feed across all linked workspaces". However, from a privacy and security standpoint, admins should not have visibility into itemized expense data of unassociated workspaces. Scoping the query with workspace:${policy?.id} ensures consistency with the card list view and protects workspace data boundaries.
Tests
Automated Tests:
Add unit test in tests/unit/WorkspaceCardsListLabelTest.ts:
Render WorkspaceCardsListLabel with mock policy (id: 'POL_X') and mock fundID.
Simulate clicking the "View transactions" shortcut.
Verify that Navigation.navigate is called with ROUTES.SEARCH_CENTRAL_PANE containing workspace:POL_X.
Manual Verification:
Create or access a setup with a shared Expensify Card program linked to Workspace X and Workspace Y.
Sign in as an admin of Workspace X (ensure this user is NOT a member or admin of Workspace Y).
Open Workspace Settings > Expensify Card.
Click View transactions under Current balance.
Verify: Search opens and displays ONLY transactions belonging to Workspace X.
Verify: Transactions from Workspace Y are NOT displayed.
Please re-state the problem that we are trying to solve in this issue.
In a shared Expensify Card program linked across multiple workspaces, an admin of Workspace X can view card transactions originating from Workspace Y by clicking "View transactions" under Current balance, even if they are not an admin or member of Workspace Y.
What is the root cause of that problem?
In src/pages/workspace/expensifyCard/WorkspaceCardsListLabel.tsx (lines 185–194):
When an Expensify Card program is shared across workspaces, all linked workspaces share the same underlying fundID.
When the admin clicks "View transactions", buildQueryStringFromFilterFormValues specifies feed: [feedKey] and withdrawalStatus, but omits policyID.
While the card list itself in WorkspaceExpensifyCardListPage.tsx scopes displayed cards to the current workspace's members via CardUtils.getCardsByCardholderName, omitting policyID in buildQueryStringFromFilterFormValues causes Search to query all transactions across the entire shared feed without workspace boundaries, displaying transactions from Workspace Y to Workspace X admins.
What changes do you think we should make in order to solve the problem?
In src/pages/workspace/expensifyCard/WorkspaceCardsListLabel.tsx:
Add policyID: [policyID] (already extracted from route params at line 61) to buildQueryStringFromFilterFormValues:
This ensures that the generated Search query includes policyID:<policyID> (or workspace:<policyID>), restricting results strictly to card expenses belonging to the workspace currently being viewed.
Admins of Workspace X will only see transactions belonging to Workspace X, cleanly enforcing workspace data isolation.
What alternative solutions did you explore? (Optional)
Constructing raw query strings manually. Using buildQueryStringFromFilterFormValues({ policyID: [policyID], ... }) is the official, type-safe API used by the component and guarantees consistent URL formatting, encoding, and filter preservation across Search views.
@abdulrahuman5196workspace: only matches expenses on a report, so this would also hide the workspace's own unreported card expenses. Y's expenses still show in Spend with feed: anyway. linked workspaces share one feed and settlement account, so isn't this expected ?
Please re-state the problem that we are trying to solve in this issue.
When multiple workspaces (Workspace X and Workspace Y) share the same Expensify Card program / settlement account (fundID), an admin of Workspace X (who is neither a member nor an admin of Workspace Y) sees card transactions from Workspace Y when clicking "View transactions" under Current balance on Workspace X's Expensify Card page.
When workspaces share an Expensify Card settlement account, they share a single defaultFundID (domain_<fundID>).
On Workspace X's Expensify Card page, the card table itself (WorkspaceExpensifyCardListPage.tsx:147-149) scopes the visible cards to Workspace X's members:
However, in WorkspaceCardsListLabel.tsx:186-195, clicking "View transactions" builds a Search query filtered only by feed: [feedKey] and withdrawalStatus:
Because feedKey is keyed by the shared defaultFundID, Search returns every unsettled/pending transaction across the entire shared settlement feed, including transactions from Workspace Y.
Why simply adding policyID: [policyID] (workspace:) alone has a subtle pitfall (as noted in the thread):
In Search, policyID: [policyID] (workspace:<policyID>) only matches transactions that are attached to a report belonging to policyID.
Unreported Expensify Card transactions (reportID === '0' / CONST.REPORT.UNREPORTED_REPORT_ID) do not belong to a workspace report yet, so filtering solely by policyID: [policyID] hides unreported Expensify Card transactions belonging to Workspace X's own cardholders.
Conversely, scoping by Workspace X's member card IDs (derived the exact same way WorkspaceExpensifyCardListPage.tsx:147-149 scopes the workspace's cards via getCardsByCardholderName(cardsList, policyMembersAccountIDs))—or passing policyID: [policyID] when Product intends strictly workspace-reported transactions—scopes the view to Workspace X.
What changes do you think we should make in order to solve the problem?
Depending on whether Product wants "View transactions" under Current balance to show (A) all unsettled transactions for cards issued to Workspace X's members (matching the cards table on the same page, including unreported card transactions) or (B) strictly transactions on Workspace X reports:
Option A (Recommended — matches the workspace's card list and preserves unreported card expenses for Workspace X's members):
In src/pages/workspace/expensifyCard/WorkspaceCardsListLabel.tsx (or by passing the workspace's scoped cardIDs down from WorkspaceExpensifyCardListPage / WorkspaceExpensifyCardPage):
This ensures that every card shown in Workspace X's Expensify Card table has its unsettled transactions (both reported and unreported) included in "View transactions", while excluding cards belonging to non-members in Workspace Y.
Option B (If Product prefers strict workspace: report-level scoping):
Include policyID: policyID ? [policyID] : undefined in buildQueryStringFromFilterFormValues in WorkspaceCardsListLabel.tsx:189-193:
What alternative solutions did you explore? (Optional)
Filtering by from: policyMembersAccountIDs instead of cardID: If a workspace member is in both Workspace X and Workspace Y and holds separate cards in each, cardID (from allCards on the workspace's card list) is more precise because it scopes directly to the cards managed in Workspace X.
Activity
MelvinBot commentedon Oct 16, 2026
Proposal
What is the root cause of that problem?
When an Expensify Card feed is linked to several workspaces, they all share one
fundID. The View transactions link under Current balance searches the whole feed and doesn't filter by workspace:WorkspaceCardsListLabel.tsx:185-194buildstype:expense feed:<fundID>_Expensify Card withdrawal-status:never,pending.workspace:filter, so Search returns every transaction on the shared feed. That includes Workspace Y's transactions.The card list behaves differently. It already shows only the current workspace's members (
WorkspaceExpensifyCardListPage.tsx:138-142, viagetCardsByCardholderName). The help article also says: "Each workspace shows only its own members in the card list, but all workspaces share the same card feed and settlement account." So Workspace X's admin can't see Workspace Y's cards, but can see their transactions.What changes do you think we should make in order to solve the problem?
First, product needs to decide whether shared-feed admins should see transactions from every linked workspace.
handleViewTransactionsPress, add the currentpolicyIDas a workspace filter to the Search query. This matches how the card list is already scoped.The App change only changes this one link. Workspace X's admin could still type a
feed:search by hand. Real access control belongs on the server, which decides what afeed:search returns. If product wants it enforced, that is a separate change outside the App repo.What alternative solutions did you explore? (Optional)
Keep the feed-wide query, but label it clearly. For example, show "Transactions on this shared feed (all linked workspaces)". This keeps the totals consistent with Current balance.
Investigation details
useDefaultFundIDresolves a workspace to its fund in this order: last-selected feed, thenpreferredPolicy, thenlinkedPolicyIDs(ExpensifyCardSettings.ts:50-53), thenworkspaceAccountID. Linked workspaces end up with the samefundID.feed:/card:filter would show the same thing. Either way, the reporter's Workspace X must be linked to a feed that Workspace Y also uses.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/104221)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Oct 16, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (
External)[-]Workspace admin can view card transactions from a different workspace (Y) in a shared Expensify Card program despite not being a member/admin there[/-][+][$175] Workspace admin can view card transactions from a different workspace (Y) in a shared Expensify Card program despite not being a member/admin there[/+]melvin-bot commentedon Oct 16, 2026
Job added to Upwork: https://www.upwork.com/jobs/~022111073873591100700
camesenin commentedon Oct 16, 2026
melvin-bot commentedon Oct 16, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
janiya2 commentedon Oct 16, 2026
Contributor details
Your Expensify account email: janithad2@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/janithad
Proposal
Please re-state the problem that we are trying to solve in this issue.
In a shared Expensify Card program linked across multiple workspaces, an admin of Workspace X can view card transactions originating from Workspace Y by tapping "View transactions" under Current balance, even though they are neither an admin nor a member of Workspace Y.
What is the root cause of that problem?
When an Expensify Card program is shared across multiple workspaces, all linked workspaces share a single underlying
fundID(useDefaultFundID.ts).Missing Policy Scoping in
WorkspaceCardsListLabel.tsx:In
src/pages/workspace/expensifyCard/WorkspaceCardsListLabel.tsx(lines 185–194), thehandleViewTransactionsPresscallback generates the following search query:Notice that this search query filters strictly by the feed/fund identifier and omits the workspace/policy constraint.
Inconsistent Scoping Between Cards List and Transactions Shortcut:
In contrast, the card list on the same page (
WorkspaceExpensifyCardListPage.tsx:138-142) already correctly restricts cards to current workspace members viagetCardsByCardholderName(CardUtils.ts:820-829). However, because the "View transactions" shortcut queries the entire shared feed withoutworkspace:${policyID}, Search returns every transaction on the feed across all linked workspaces.What changes do you think we should make in order to solve the problem?
In
src/pages/workspace/expensifyCard/WorkspaceCardsListLabel.tsx:Ensure backend
Searchendpoint permissions enforce that users cannot bypass the UI shortcut by manually executing afeed:<fundID>search query to read transaction details belonging to workspaces they do not have permissions for.What alternative solutions did you explore? (Optional)
We explored keeping the feed-wide search query and adding an in-app banner explaining that "Current balance reflects the entire shared feed across all linked workspaces". However, from a privacy and security standpoint, admins should not have visibility into itemized expense data of unassociated workspaces. Scoping the query with
workspace:${policy?.id}ensures consistency with the card list view and protects workspace data boundaries.Tests
Automated Tests:
Add unit test in
tests/unit/WorkspaceCardsListLabelTest.ts:WorkspaceCardsListLabelwith mockpolicy(id: 'POL_X') and mockfundID.Navigation.navigateis called withROUTES.SEARCH_CENTRAL_PANEcontainingworkspace:POL_X.Manual Verification:
melvin-bot commentedon Oct 16, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
jloa-dev commentedon Oct 17, 2026
Contributor details
Your Expensify account email: jloa.dev@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~0163955a2ba22190aa
Proposal
Please re-state the problem that we are trying to solve in this issue.
In a shared Expensify Card program linked across multiple workspaces, an admin of Workspace X can view card transactions originating from Workspace Y by clicking "View transactions" under Current balance, even if they are not an admin or member of Workspace Y.
What is the root cause of that problem?
In
src/pages/workspace/expensifyCard/WorkspaceCardsListLabel.tsx(lines 185–194):fundID.buildQueryStringFromFilterFormValuesspecifiesfeed: [feedKey]andwithdrawalStatus, but omitspolicyID.WorkspaceExpensifyCardListPage.tsxscopes displayed cards to the current workspace's members viaCardUtils.getCardsByCardholderName, omittingpolicyIDinbuildQueryStringFromFilterFormValuescauses Search to query all transactions across the entire shared feed without workspace boundaries, displaying transactions from Workspace Y to Workspace X admins.What changes do you think we should make in order to solve the problem?
In
src/pages/workspace/expensifyCard/WorkspaceCardsListLabel.tsx:Add
policyID: [policyID](already extracted from route params at line 61) tobuildQueryStringFromFilterFormValues:policyID:<policyID>(orworkspace:<policyID>), restricting results strictly to card expenses belonging to the workspace currently being viewed.Pre-coded and tested in branch:
fix/104221-workspace-card-view-transactions-scope(https://github.com/jloa-dev/App/tree/fix/104221-workspace-card-view-transactions-scope).What alternative solutions did you explore? (Optional)
Constructing raw query strings manually. Using
buildQueryStringFromFilterFormValues({ policyID: [policyID], ... })is the official, type-safe API used by the component and guarantees consistent URL formatting, encoding, and filter preservation across Search views.melvin-bot commentedon Oct 17, 2026
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
13 remaining items
melvin-bot commentedon Nov 2, 2026
This issue has not been updated in over 14 days. @abdulrahuman5196 eroding to Weekly issue.
abdulrahuman5196 commentedon Nov 4, 2026
@MelvinBot Change this to Daily label
MelvinBot commentedon Nov 4, 2026
Changed the label from Weekly to Daily.
view run
jeffrey-graham commentedon Nov 7, 2026
melvin-bot commentedon Nov 7, 2026
melvin-bot commentedon Nov 9, 2026
@abdulrahuman5196 Eep! 4 days overdue now. Issues have feelings too...
allgandalf commentedon Nov 11, 2026
@abdulrahuman5196
workspace:only matches expenses on a report, so this would also hide the workspace's own unreported card expenses. Y's expenses still show in Spend withfeed:anyway. linked workspaces share one feed and settlement account, so isn't this expected ?melvin-bot commentedon Nov 11, 2026
@abdulrahuman5196 Still overdue 6 days?! Let's take care of this!
melvin-bot commentedon Nov 13, 2026
@abdulrahuman5196 this issue is now 4 weeks old, please consider:
Thanks!
cocvn157 commentedon Nov 14, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When multiple workspaces (Workspace X and Workspace Y) share the same Expensify Card program / settlement account (
fundID), an admin of Workspace X (who is neither a member nor an admin of Workspace Y) sees card transactions from Workspace Y when clicking "View transactions" under Current balance on Workspace X's Expensify Card page.What is the root cause of that problem?
Why
handleViewTransactionsPressinsrc/pages/workspace/expensifyCard/WorkspaceCardsListLabel.tsx:186-195returns transactions from other workspaces on the samefundID:defaultFundID(domain_<fundID>).WorkspaceExpensifyCardListPage.tsx:147-149) scopes the visible cards to Workspace X's members:WorkspaceCardsListLabel.tsx:186-195, clicking "View transactions" builds a Search query filtered only byfeed: [feedKey]andwithdrawalStatus:feedKeyis keyed by the shareddefaultFundID, Search returns every unsettled/pending transaction across the entire shared settlement feed, including transactions from Workspace Y.Why simply adding
policyID: [policyID](workspace:) alone has a subtle pitfall (as noted in the thread):policyID: [policyID](workspace:<policyID>) only matches transactions that are attached to a report belonging topolicyID.reportID === '0'/CONST.REPORT.UNREPORTED_REPORT_ID) do not belong to a workspace report yet, so filtering solely bypolicyID: [policyID]hides unreported Expensify Card transactions belonging to Workspace X's own cardholders.WorkspaceExpensifyCardListPage.tsx:147-149scopes the workspace's cards viagetCardsByCardholderName(cardsList, policyMembersAccountIDs))—or passingpolicyID: [policyID]when Product intends strictly workspace-reported transactions—scopes the view to Workspace X.What changes do you think we should make in order to solve the problem?
Depending on whether Product wants "View transactions" under Current balance to show (A) all unsettled transactions for cards issued to Workspace X's members (matching the cards table on the same page, including unreported card transactions) or (B) strictly transactions on Workspace X reports:
Option A (Recommended — matches the workspace's card list and preserves unreported card expenses for Workspace X's members):
In
src/pages/workspace/expensifyCard/WorkspaceCardsListLabel.tsx(or by passing the workspace's scopedcardIDsdown fromWorkspaceExpensifyCardListPage/WorkspaceExpensifyCardPage):Option B (If Product prefers strict
workspace:report-level scoping):Include
policyID: policyID ? [policyID] : undefinedinbuildQueryStringFromFilterFormValuesinWorkspaceCardsListLabel.tsx:189-193:What alternative solutions did you explore? (Optional)
from: policyMembersAccountIDsinstead ofcardID: If a workspace member is in both Workspace X and Workspace Y and holds separate cards in each,cardID(fromallCardson the workspace's card list) is more precise because it scopes directly to the cards managed in Workspace X.expensify-chore-bot commentedon Nov 17, 2026
@abdulrahuman5196 12 days overdue now... This issue's end is nigh!