Vulnerability GHSA-rw26-wwfc-9wvm
Summary
ApostropheCMS: Missing Authentication in `cleanExport` Route
Details
1. Summary
The API endpoint POST /api/v1/@apostrophecms/import-export/clean-export in @apostrophecms/import-export lacks authentication and authorization checks. Any client—including unauthenticated anonymous users who have obtained the standard CSRF cookie from visiting the site—can directly invoke this route and trigger the underlying self.cleanExport(req) method.
3. Root Cause Analysis
In packages/import-export/lib/apiRoutes.js, the get.related handler explicitly validates that the caller is logged in:
get: {
async related(req) {
if (!req.user) {
throw self.apos.error('forbidden');
}
// ...
}
}
In contrast, post.cleanExport (as well as post.overrideDuplicates) lacks any verification of req.user:
post: {
async overrideDuplicates(req) {
return self.overrideDuplicates(req);
},
async cleanExport(req) {
return self.cleanExport(req); // <-- No authentication check
}
}
Because ApostropheCMS does not enforce authentication globally on all apiRoutes, omitting an explicit if (!req.user) guard allows anonymous requests to pass directly through to the business logic layer.
5. Impact
- Broken Access Control: Unauthenticated users can invoke cleanup operations and delete temporary export files and artifacts stored on the server.
- Unauthorized State Mutation: The endpoint allows modifying job records in the database via
req.body.jobId(forcing them toended: true, status: 'completed') and dismissing notifications viareq.body.notificationIdwithout verifying whether the resources belong to the requesting caller.
Related Vulnerabilities
Other vulnerabilities affecting the same packages