Skip to content

Commit 1c96d64

Browse files
authored
🐛(backend) fix s3 version_id validation
The regex used on the version_detail endpoint path is not fully compatible with the S3 spec. In the S3 specs, Version IDs are Unicode, UTF-8 encoded, URL-ready, opaque strings that are no more than 1,024 bytes long. We don't accept all unicode characters but enough to be compliant.
1 parent 2f010cf commit 1c96d64

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to
2323
- 🐛(backend) fix trashbin list
2424
- ♿(frontend) improve accessibility:
2525
- ♿(frontend) remove empty alt on logo due to Axe a11y error #1516
26+
- 🐛(backend) fix s3 version_id validation
2627

2728
## [3.8.2] - 2025-10-17
2829

src/backend/core/api/viewsets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ def versions_list(self, request, *args, **kwargs):
11051105
@drf.decorators.action(
11061106
detail=True,
11071107
methods=["get", "delete"],
1108-
url_path="versions/(?P<version_id>[0-9a-z-]+)",
1108+
url_path=r"versions/(?P<version_id>[A-Za-z0-9._+\-=~]{1,1024})",
11091109
)
11101110
# pylint: disable=unused-argument
11111111
def versions_detail(self, request, pk, version_id, *args, **kwargs):

0 commit comments

Comments
 (0)