Skip to content
Snippets Groups Projects
  1. Mar 09, 2021
  2. Mar 05, 2021
  3. Mar 03, 2021
  4. Mar 01, 2021
  5. Feb 17, 2021
  6. Feb 16, 2021
  7. Feb 10, 2021
  8. Jan 21, 2021
  9. Jan 19, 2021
  10. Jan 11, 2021
  11. Jan 05, 2021
  12. Dec 09, 2020
  13. Nov 26, 2020
  14. Nov 20, 2020
  15. Nov 13, 2020
  16. Nov 02, 2020
  17. Oct 21, 2020
  18. Oct 15, 2020
  19. Oct 02, 2020
  20. Oct 01, 2020
  21. Sep 28, 2020
  22. Sep 21, 2020
  23. Sep 05, 2020
  24. Sep 03, 2020
  25. Sep 01, 2020
  26. Aug 20, 2020
  27. Aug 12, 2020
  28. Aug 11, 2020
  29. Jul 15, 2020
  30. Jun 17, 2020
  31. Jun 04, 2020
  32. Jun 01, 2020
  33. May 28, 2020
  34. May 26, 2020
  35. May 22, 2020
  36. May 08, 2020
  37. Apr 10, 2020
    • Stan Hu's avatar
      Prevent filename bypass on artifact upload · 96857bf2
      Stan Hu authored
      The attack is outlined in
      gitlab-org/gitlab#213139. It exploits the
      fact that the artifacts endpoint reads `file.path` directly using
      `UploadedFile.from_params`.
      
      `file.path` can be given by the user and pass through workhorse. As
      such, it's an untrusted source and could contain the path of any file in
      `Dir.tmpdir`. This results in creating a `Ci::JobArtifact` pointing to
      an arbitrary temporary file.
      
      To counter this, this commit relies on the fact that the upload endpoint
      deals with a multipart upload. This type of uploads are handled by
      `Gitlab::Middleware::Multipart` which will read the upload file from a
      trusted source (the workhorse JWT token) and build a `UploadedFile`
      object out of it. Thus, in the Grape endpoint, we can simply read the
      param directly and validate that it's an `UploadedFile`.
      96857bf2
  38. Apr 06, 2020
Loading