Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8342449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:46:35+00:00 2026-06-09T05:46:35+00:00

I have a server that has some very sensitive information on it, so security

  • 0

I have a server that has some very sensitive information on it, so security is a big issue. The user needs to be able to upload a video. I know allowing users to upload files poses a security threat because there is no 100% way to keep them from uploading non-videos. But I obviously can choose which files the server will keep.

I know that checking the file-extension won’t suffice. Checking the MIME type is better but it can still be faked. So how do I go about checking if the file is a video?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T05:46:36+00:00Added an answer on June 9, 2026 at 5:46 am

    Play it!

    Only way to be sure is to have some code that decodes videos of the type in question, take a look at it (and check there’s sensible results, like a non-zero duration).

    Otherwise though, your risks are low:

    Non-malicious scenario:

    1. Uploader uploads video, with a video/* content-type.
    2. You store the octets and content-type.
    3. Downloader downloads video, and you use the content-type you received.
    4. Downloader watches video (or grumbles about codecs, etc.)

    Malicious scenario 1:

    1. Uploader uploads a nasty trojan, with a video/* content-type.
    2. You store the octets and content-type.
    3. Downloader downloads nasty trojan, and you use the content-type you received.
    4. Downloader opens nasty trojan in video player. Nasty trojan does nothing because it’s not a video. User grumbles about codecs. Worse case scenario is, they write rant on ubuntu forums about lack of support for proprietary formats, adds ill-spelt comments on your page about how the site sucks because the video didn’t work, etc.

    Malicious scenario 2:

    1. Uploader uploads nasty trojan that is written into a video that exploits some buffer-overflow issue with a popular video player.
    2. You store…
    3. Downloader…
    4. Could just be like one of the above, but it could also be that they get hit by the exploit (if they’re using the affected player).

    Three things to note about scenario 2 though:

    1. Testing it’s a video won’t guarantee safety, as it could well have also work fine in some players.
    2. Testing it’s a video could make your server vulnerable to the exploit, if the vulnerability is in ffmpeg!
    3. Exploits of this type are both rare, and hard to do. The general risk is the same as uploading and downloading jpegs or pngs. Indeed it’s a bit smaller (there was indeed an exploit of this type affecting commonly-used jpeg libraries for a while).

    In all, just make sure you only output with the content-types you accept, and force file-extensions to match them; if the user uploads a video/mpeg called hahaha.exe, then rename it hahaha.mpg

    Edit: Oh, also:

    Malicious scenario 3:

    Uploader uploads video that exploits some players in a way that uses a lot of resources. In this case a downloader will just kill-9/ctrl-alt-delete/your-OSs-kill-them-all-of-choice, but if your server is testing it’s a video, then it could end up in trouble as there’s no one on hand to step in and kill the 200 (and growing as the script-kiddies’s script keeps uploading more) “videos” it’s trying to interpret.

    Just doing normal video-processing could be enough to introduce the ability to DoS you (video processing is relatively heavy after all), so testing the file could introduce more dangers than it saves you from.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very weird issue. I have a UserControl that has some controls
I have a server that has several virtual machines running on it. I'm trying
I have an express server that has a button that issues a POST which
I have a remote server that has win2003 installed I can connect to the
We have a dev server that has managed to become indexed by Google. Page
I have a SQL Server DB that has a table of products, and another
I have a folder on my remote server that has a few .png files
I have a folder on my web server that has hundreds of mp3 files
I have a SQL Server 2005 database that has been deleted, and I need
I have an SQL Server 2005 table that has a varchar(250) field which contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.