1. 07 12月, 2019 2 次提交
  2. 12 10月, 2019 1 次提交
    • P
      Permanent URLs for public storage blobs · feab7031
      Peter Zhu 提交于
      Services can be configured in `config/storage.yml` with a new key
      `public: true | false` to indicate whether a service holds public
      blobs or private blobs. Public services will always return a
      permanent URL.
      
      Deprecates `Blob#service_url` in favor of `Blob#url`.
      feab7031
  3. 06 9月, 2019 1 次提交
  4. 10 7月, 2019 1 次提交
  5. 21 12月, 2018 1 次提交
  6. 28 11月, 2018 1 次提交
    • R
      Prevent content type and disposition bypass in storage service URLs · 06ab7b27
      Rosa Gutierrez 提交于
      * Force content-type to binary on service urls for relevant content types
      
      We have a list of content types that must be forcibly served as binary,
      but in practice this only means to serve them as attachment always. We
      should also set the Content-Type to the configured binary type.
      
      As a bonus: add text/cache-manifest to the list of content types to be
      served as binary by default.
      
      * Store content-disposition and content-type in GCS
      
      Forcing these in the service_url when serving the file works fine for S3
      and Azure, since these services include params in the signature.
      However, GCS specifically excludes response-content-disposition and
      response-content-type from the signature, which means an attacker can
      modify these and have files that should be served as text/plain attachments
      served as inline HTML for example. This makes our attempt to force
      specific files to be served as binary and as attachment can be easily
      bypassed.
      
      The only way this can be forced in GCS is by storing
      content-disposition and content-type in the object metadata.
      
      * Update GCS object metadata after identifying blob
      
      In some cases we create the blob and upload the data before identifying
      the content-type, which means we can't store that in GCS right when
      uploading. In these, after creating the attachment, we enqueue a job to
      identify the blob, and set the content-type.
      
      In other cases, files are uploaded to the storage service via direct
      upload link. We create the blob before the direct upload, which happens
      independently from the blob creation itself. We then mark the blob as
      identified, but we have already the content-type we need without having
      put it in the service.
      
      In these two cases, then, we need to update the metadata in the GCS
      service.
      
      * Include content-type and disposition in the verified key for disk service
      
      This prevents an attacker from modifying these params in the service
      signed URL, which is particularly important when we want to force them
      to have specific values for security reasons.
      
      * Allow only a list of specific content types to be served inline
      
      This is different from the content types that must be served as binary
      in the sense that any content type not in this list will be always
      served as attachment but with its original content type. Only types in
      this list are allowed to be served either inline or as attachment.
      
      Apart from forcing this in the service URL, for GCS we need to store the
      disposition in the metadata.
      
      Fix CVE-2018-16477.
      06ab7b27
  7. 22 8月, 2018 1 次提交
    • C
      Translate service-specific missing object exceptions into a generic one · 5cd2d07b
      Cameron Bothner 提交于
      `ActiveStorage::Blob#download` and `ActiveStorage::Blob#open` raise
      `ActiveStorage::FileNotFoundError` when the corresponding file is missing
      from the storage service. Services translate service-specific missing
      object exceptions (e.g. `Google::Cloud::NotFoundError` for the GCS service
      and `Errno::ENOENT` for the disk service) into
      `ActiveStorage::FileNotFoundError`.
      5cd2d07b
  8. 16 7月, 2018 1 次提交
  9. 29 4月, 2018 1 次提交
  10. 07 4月, 2018 1 次提交
    • A
      Use a current model to provide the host for service urls · 9436c22e
      Andrew White 提交于
      Trying to pass the current request down to the service so that it can
      create full urls instead of paths makes the API messy so use a model
      based on ActiveSupport::CurrentAttributes to provide the current host
      to services that need it (primarily the disk service).
      9436c22e
  11. 06 3月, 2018 1 次提交
  12. 17 1月, 2018 1 次提交
  13. 16 1月, 2018 1 次提交
  14. 03 12月, 2017 1 次提交
  15. 29 9月, 2017 1 次提交
  16. 26 8月, 2017 1 次提交
  17. 21 8月, 2017 1 次提交
  18. 16 8月, 2017 2 次提交
  19. 12 8月, 2017 1 次提交
  20. 11 8月, 2017 1 次提交
  21. 09 8月, 2017 1 次提交
  22. 05 8月, 2017 1 次提交
  23. 04 8月, 2017 2 次提交