Skip to main content
Menu
Advisories

Path traversal in file system blob provider and Blogging file endpoints

GHSA-4X2H-F4F8-XJR6Published Updated GitHub

Description

Impact

DefaultBlobFilePathCalculator in Volo.Abp.BlobStoring.FileSystem combines the container name and blob name with the base path without checking the result. If an application passes a user controlled value as a blob name, it can read, write or delete files outside the container folder, including another tenant's blobs, within the permissions of the application process.

The Blogging module (HTTP endpoints in Volo.Blogging.HttpApi, implementation in Volo.Blogging.Application) passes the route value of GET api/blogging/files/{name} and GET api/blogging/files/www/{name} to the file storage without validation, and these endpoints don't require login. On Windows, an anonymous user can use them to read any file the application process can read. Since 3.3.0 this applies when the Blogging files use the file system blob provider. Versions before 3.3.0 read the files from a local folder directly, so they are affected regardless of the blob provider.

The Blogging image upload endpoint also had no permission check, so anonymous users could upload images.

Patches

Fixed in 10.7.0. The file system provider now rejects rooted paths and ./.. segments in blob names and container names, and checks that the final path stays inside the container folder. Blogging validates file names, and image upload requires the post create or update permission.

Upgrade all ABP packages to the same patched version, including Volo.Abp.BlobStoring.FileSystem and Volo.Blogging.Application.

Workarounds

If you can't upgrade yet:

  • Before passing a user controlled value to IBlobContainer, reject names that are rooted paths or contain . or .. path segments. Do the same for container names if they come from user input.
  • For the Blogging module, replace FileAppService to reject file names that contain /, \, or are . or .., and to check the post create or update permission in CreateAsync. Or disable the api/blogging/files endpoints, which breaks blog images.

References

Affected versions

References

GitHub · abpframework/abp