Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jason Elkin 38 posts 351 karma points MVP 2x c-trib
    May 18, 2022 @ 14:16
    Jason Elkin
    0

    File Upload Security

    I have a question from a client (following a security scan) related to the file upload fields here:

    /AppPlugins/uSyncExporter/importDialog.html, line 26 /AppPlugins/uSyncSnapshots/dialog/importDialog.html, line 14

    The question is whether or not these uploads have some mechanism to validate/limit the types of files that might be uploaded.

    (other than the "accept" attribute).

    Thanks.

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    May 18, 2022 @ 15:30
    Kevin Jump
    100

    Hi Jason,

    yes internally - this will only work with the sync-pack (zip) files

    internally within the upload process the files are:

    • uploaded (with an internal random name, so we don't take the one submitted)
    • unzipped
    • deleted

    If any of the steps fail (e.g. the unzip) then the delete should fired - so the files do not actually persist on the disk and all of this occurs in a location that could not be calculated from the upload (e.g. random folder names, random filenames, etc).


    but you do have to exercise caution with these files anyway (which is why they are in the settings section and would be limited to accounts that can only do 'settings' things) as they can for example contain view files, (e.g. a .cshtml file) which can of course contain code that if imported would run on a site.

    I wouldn't say this this isn't a vulnerability as much as the function of the process. (e.g. you can do damage uploading code inside a snapshot/sync-pack - but you can also do damage by writing code into a template/partial in the same section).

    happy to discuss more via email ([email protected]) if you have more questions

  • Jason Elkin 38 posts 351 karma points MVP 2x c-trib
    May 18, 2022 @ 20:10
    Jason Elkin
    0

    Super, many thanks!

Please Sign in or register to post replies

Write your reply to:

Draft