You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tree:
e411bbf2fb
2.9
3.0
3.1
3.2
3.3
4.0
4.1
4.2
4.3
4.4
4.4.1
4.4.2
4.4.3
5.0.0
5.0.0-rc.1
5.0.0-rc.2
5.1.1
5.1.3
5.1.4
5.2.0
5.2.1
5.2.2
6.0
6.0.0
6.0.0.1
aspire-integration
dependabot/npm_and_yarn/apps/vue/tests/server/follow-redirects-1.16.0
dependabot/npm_and_yarn/apps/vue/tests/server/lodash-4.18.1
dependabot/npm_and_yarn/apps/vue/tests/server/picomatch-2.3.2
dependabot/npm_and_yarn/apps/vue/tests/server/systeminformation-5.31.6
dependabot/npm_and_yarn/apps/vue/tests/server/vm2-3.11.5
dev
elsa-3.0
flutter
main
master
rel-10.0.2
rel-10.2.0
rel-10.4.0
rel-10.6.0
rel-10.7.0
rel-7.0.2
rel-7.0.3
rel-7.1.0
rel-7.1.1
rel-7.2.1
rel-7.3.2
rel-7.3.3
rel-7.4.0
rel-8.0.0
rel-8.0.3
rel-8.1.0
rel-8.1.1
rel-8.1.2
rel-8.1.3
rel-8.2.0
rel-8.2.1
rel-8.2.2
rel-8.3.0
rel-8.3.4
rel-9.1.1
rel-9.1.3
rel-9.2.0
rel-9.2.3
rel-9.3.1
rel-9.3.5
rel-9.3.6
upt-5.3.2
upt-5.3.4
upt-5.3.5
upt-6.0.1
upt-6.0.2
upt-7.0.0
upt-7.0.1
upt-7.2.1
upt-7.2.2
upt-7.4.0
upt-8.2.0
vben-5-7-0
10.0.2
10.2.0
10.4.0
10.6.0
10.7.0
3.2.1
3.2.2
3.2.3
3.3.0
3.3.1
3.3.2
4.0.0
4.4.0
4.4.3
5.0.0
5.0.0-rc.2
5.1.1
5.1.3
5.1.4
5.2.0
5.2.1
5.2.2
5.3.0
5.3.2
5.3.4
6.0.0
6.0.1
6.0.2
7.0.0
7.0.1
7.0.2
7.0.3
7.1.0
7.1.1
7.2.1
7.3.2
7.3.3
7.4.0
8.0.0
8.0.3
8.1.0
8.1.1
8.1.2
8.1.3
8.2.0
8.2.1
8.2.2
8.3.0
8.3.4
9.0.4
9.1.1
9.1.3
9.2.0
9.2.1
9.2.3
9.3.5
9.3.6
${ noResults }
abp-next-admin2/aspnet-core/tests/LINGYUN.Abp.BlobManagement....
The FileSystem provider combined the user controlled blob name (and container name)
into the storage path without any validation, so an authenticated user holding the
BlobManagement permissions could read, overwrite or delete arbitrary files - and, with
the PublicAccess feature enabled, do it anonymously through the public download endpoint.
Fix (defence in depth):
- CalculateBlobName now resolves the path with Path.GetFullPath and asserts it is still
inside the current tenant directory (host or tenants/{id}); this also stops absolute
path injection, because Path.Combine discards its prefix when the second argument is
rooted. The prefix comparison adds a directory separator to avoid the classic
"blobs-evil" prefix bypass, and uses Ordinal on case sensitive file systems (Linux)
and OrdinalIgnoreCase on Windows/macOS
- new BlobManagementNameValidator (Domain.Shared) with a cross platform rule set shared by
the entities and the provider: rejects path separators, . and .. segments, the union of
invalid characters (\0 / \ : * ? " < > |), trailing dots/spaces and reserved device names
(CON/PRN/AUX/NUL/COM1-9/LPT1-9); CheckName validates a single segment, CheckPath validates
a path segment by segment
- container names are validated too: a name such as "x/../abp-c" stays inside the base path
(so the containment check cannot catch it) but resolves to another container directory,
which broke container isolation (e.g. writing into the private "users" container)
- BlobContainer.Name, Blob.Name and Blob.FullName are validated in the domain as well, so
invalid names are rejected before they are persisted
- new error codes BlobManagement:001005 (container name) and BlobManagement:002008 (blob name)
with zh-Hans/en texts
Tests:
- LINGYUN.Abp.BlobManagement.Domain.Tests (76 tests) for Blob / BlobContainer / the validator
- LINGYUN.Abp.BlobManagement.FileSystem.Tests (54 tests) drives the provider resolved from DI
(the test module enables BlobManagement:Provider=FileSystem with a temporary BasePath and
removes it on shutdown), covering traversal, absolute paths, NTFS alternate data streams,
Windows normalization collisions, container names/aliases, tenant isolation and legitimate
names
|
1 month ago | |
|---|---|---|
| .. | ||
| LINGYUN/Abp/BlobManagement/FileSystem | fix(blobmanagement): Prevent path traversal in the FileSystem blob provider | 1 month ago |
| LINGYUN.Abp.BlobManagement.FileSystem.Tests.csproj | fix(blobmanagement): Prevent path traversal in the FileSystem blob provider | 1 month ago |