Skip to content

Commit cc09c93

Browse files
committed
fix(security): remove fileSize > 0 quota bypass gate; exempt logs context from quota
1 parent 1469ba1 commit cc09c93

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

apps/sim/app/api/files/multipart/route.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
138138
// Apply storage quota to all user-driven upload contexts (not system/metadata contexts)
139139
if (
140140
!QUOTA_EXEMPT_STORAGE_CONTEXTS.has(context as StorageContext) &&
141-
typeof fileSize === 'number' &&
142-
fileSize > 0
141+
typeof fileSize === 'number'
143142
) {
144143
const { checkStorageQuota } = await import('@/lib/billing/storage')
145144
const quotaCheck = await checkStorageQuota(userId, fileSize)

apps/sim/lib/uploads/shared/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export const QUOTA_EXEMPT_STORAGE_CONTEXTS = new Set<StorageContext>([
3232
'profile-pictures',
3333
'workspace-logos',
3434
'og-images',
35+
'logs',
3536
])
3637

3738
export interface FileInfo {

0 commit comments

Comments
 (0)