jira/apps/api/plane/space/views
sriram veeraghanta 25c6843fce
fix: enforce FILE_SIZE_LIMIT on published Space asset upload (#9242)
* fix(api): enforce FILE_SIZE_LIMIT on published Space asset upload

The public Space asset upload endpoint
(POST /api/public/assets/v2/anchor/{anchor}/) trusted the client-supplied
`size` value end-to-end: it was stored on the FileAsset and passed straight
to generate_presigned_post(), which uses it as the S3/MinIO policy bound
(["content-length-range", 1, file_size]). This let an authenticated user
obtain a signed upload policy exceeding the instance's FILE_SIZE_LIMIT.

Cap the value with `size_limit = min(size, settings.FILE_SIZE_LIMIT)` and use
it consistently for the stored asset metadata and the presigned POST policy,
matching every other asset upload endpoint.

* fix(api): clamp Space asset size to a valid lower bound

Address review feedback: reject malformed (non-integer) `size` with 400 and
clamp the value to [1, FILE_SIZE_LIMIT] via max(1, min(...)) so the presigned
content-length-range is always valid and no non-positive size is persisted.
2026-08-04 20:10:03 +05:30
..
__init__.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
asset.py fix: enforce FILE_SIZE_LIMIT on published Space asset upload (#9242) 2026-08-04 20:10:03 +05:30
base.py [GIT-213] fix: return HTTP response from dispatch() exception handler (#9179) 2026-06-01 15:03:22 +05:30
cycle.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
intake.py [WEB-7774] fix(security): sanitize comment_html and intake description_html with nh3 (#9287) 2026-06-23 17:52:31 +05:30
issue.py fix: cast avatar_asset to CharField to resolve mixed type errors in URL concatenation (#9512) 2026-07-30 20:29:41 +05:30
label.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
meta.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
module.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
project.py fix: Member Information Disclosure via Public Endpoint #8646 2026-02-20 18:33:45 +05:30
state.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30