Cross-application partial export leaks private actions and JS collections by mixing an authorized applicationId with an unrelated pageId
Description
A Broken Object-Level Authorization (BOLA/IDOR) vulnerability exists in the Appsmith partial application export flow.
The endpoint:
POST /api/v1/applications/export/partial/{branchedApplicationId}/{branchedPageId}appears to authorize the supplied branchedApplicationId, but later uses the separately supplied branchedPageId without verifying that the page belongs to the authorized application.
As a result, an authenticated user with access to export or edit their own application may be able to export private page-scoped resources, such as actions and JS collections, from another application or workspace if the attacker knows the victim page/action/collection identifiers.
Affected Endpoint
POST /api/v1/applications/export/partial/{branchedApplicationId}/{branchedPageId}Affected Components
The issue appears to involve the following components:
app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationControllerCE.java
app/server/appsmith-server/src/main/java/com/appsmith/server/exports/internal/partial/PartialExportServiceCEImpl.java
app/server/appsmith-server/src/main/java/com/appsmith/server/newpages/base/NewPageServiceCEImpl.java
app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CustomNewPageRepositoryCEImpl.java
app/server/appsmith-server/src/main/java/com/appsmith/server/newactions/base/NewActionServiceCEImpl.java
app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CustomNewActionRepositoryCEImpl.java
app/server/appsmith-server/src/main/java/com/appsmith/server/actioncollections/base/ActionCollectionServiceCEImpl.java
app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/CustomActionCollectionRepositoryCEImpl.javaDetails
The partial export endpoint accepts both an application identifier and a page identifier:
POST /api/v1/applications/export/partial/{branchedApplicationId}/{branchedPageId}The vulnerable execution flow appears to be:
ApplicationControllerCE.exportApplicationPartially()
→ PartialExportServiceCEImpl.getPartialExportResources()
→ applicationService.findById(branchedApplicationId, MANAGE_APPLICATIONS)
→ newPageService.getNameByPageId(branchedPageId, false)
→ actionCollectionService.findByPageId(branchedPageId)
→ newActionService.findByPageId(branchedPageId)
→ repository-level reads by pageId without ACL validationThe application-level permission check is performed on branchedApplicationId. However, the code later uses the attacker-controlled branchedPageId to fetch page name, actions, and action collections.
The issue is that PartialExportServiceCEImpl does not appear to verify that the supplied branchedPageId belongs to the already-authorized branchedApplicationId.
This creates an object relationship validation failure:
Permission is checked on application A,
but export data may be fetched from page B.If page B belongs to another application or workspace, the partial export response may include resources that the caller should not be allowed to export.
Root Cause
The root cause is that authorization is enforced on one object, but later data access is performed using another independently supplied object ID.
Specifically:
- The caller-controlled
branchedApplicationIdis authorized. - The caller-controlled
branchedPageIdis then trusted. - The code does not appear to verify that the page belongs to the authorized application.
- Page-scoped resources are fetched through methods such as:
newPageService.getNameByPageId(...)
newActionService.findByPageId(...)
actionCollectionService.findByPageId(...)- These reads are not constrained to the authorized application context.
The endpoint should reject a request where branchedPageId does not belong to branchedApplicationId.
Security Impact
An authenticated attacker may be able to export private application logic from another application or workspace, provided they know or can obtain the relevant victim identifiers.
The confirmed impact is unauthorized read/export of page-scoped resources such as:
action definitions
query/action metadata
JS collection names and contents
page-scoped application logicI did not find code evidence that datasource credentials are exported through this path. Therefore, the impact should be limited to unauthorized disclosure of exportable page-scoped application resources unless further investigation shows otherwise.
Safe Reproduction Plan
A safe reproduction can be performed with two controlled users and two separate workspaces.
Setup
- Create User A with access to Workspace A.
- Create User B with access to Workspace B.
- User B creates a private application in Workspace B.
- In User B’s application, create:
- one page
- one action/query
- one JS collection
- Record User B’s:
branchedPageId- action ID
- action collection ID
- User A creates a separate application in Workspace A.
- Record User A’s
branchedApplicationId.
Test
As User A, send a partial export request using:
User A's branchedApplicationId
User B's branchedPageId
User B's action/actionCollection IDs in the request bodyExample structure:
POST /api/v1/applications/export/partial/{USER_A_BRANCHED_APPLICATION_ID}/{USER_B_BRANCHED_PAGE_ID}The request body should include the selected action or action collection identifiers from User B’s page.
Expected Secure Behavior
The server should reject the request because the supplied page does not belong to the authorized application.
Expected result:
403 Forbiddenor an application/page relationship validation error such as:
Page does not belong to the applicationVulnerable Behavior
The server returns a partial export response that includes User B’s page-scoped resources, such as action definitions or JS collection content, even though User A is only authorized on User A’s application.
Why This Is Distinct From My Previous Report
This finding is distinct from my previous accepted report:
Broken Object-Level Authorization in PUT /api/v1/pages/{pageId}/dependencyMap Allows Unauthorized Cross-Workspace ModificationThe previous report involved:
Unauthorized write/modification of a page dependencyMapThis report involves:
Unauthorized read/export through the partial application export flowThe affected endpoint, affected service flow, security impact, and vulnerable operation are different.
This issue is caused by mixing an authorized branchedApplicationId with an unchecked and unrelated branchedPageId, followed by page-scoped export reads.
Recommended Fix
After authorizing branchedApplicationId, Appsmith should verify that every supplied object ID belongs to the authorized application context.
Recommended changes:
- Resolve
branchedPageIdthrough an application-scoped and permission-checked lookup. - Reject the request if:
page.applicationId != branchedApplicationId- Validate that each requested action ID belongs to the authorized page/application.
- Validate that each requested action collection ID belongs to the authorized page/application.
- Avoid permissionless
findByPageIdandgetNameByPageIdcalls in the partial export path. - Reuse the safer full export pattern where pages and child resources are derived from the authorized application context.
- Add regression tests for:
- cross-workspace page ID mismatch
- cross-application page ID mismatch
- action ID from unrelated page
- action collection ID from unrelated page