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

  • SEARCH
  • Home
  • 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 192923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:28:00+00:00 2026-05-11T16:28:00+00:00

I was wondering what security issues appear when the end user of a website

  • 0

I was wondering what security issues appear when the end user of a website can upload files to the server.

For instance if my website allows the users to upload a profile picture, and one user uploads something harmful instead, what could happen? What kind of security should I set up to prevent attacks like this? I’m talking here about images, but what about the case where a user can upload anything into a file-vault kind of application?

It’s more a general question than a question about a specific situation, so what are the best practices in that situation? What do you usually do?

I suppose: type validation on upload, different permissions for uploaded files… what else?

EDIT: To clear up the context, I am thinking about a web application where a user can upload any kind of file and then display it in the browser. The file would be stored on the server. The users are whoever uses the website, so there is no trust involved.

I am looking for general answers that could apply for different languages/framework and production environments.

  • 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-05-11T16:28:01+00:00Added an answer on May 11, 2026 at 4:28 pm

    Your first line of defense will be to limit the size of uploaded files, and kill any transfer that is larger than that amount.

    File extension validation is probably a good second line of defense. Type validation can be done later… as long as you aren’t relying on the (user-supplied) mime-type for said validation.

    Why file extension validation? Because that’s what most web servers use to identify which files are executable. If your executables aren’t locked down to a specific directory (and most likely, they aren’t), files with certain extensions will execute anywhere under the site’s document root.

    File extension checking is best done with a whitelist of the file types you want to accept.

    Once you validate the file extension, you can then check to verify that said file is the type its extension claims, either by checking for magic bytes or using the unix file command.

    I’m sure there are other concerns that I missed, but hopefully this helps.

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

Sidebar

Related Questions

I'm wondering if $_POST & $_GET can have issues with security. Let's say i
Possible Duplicate: Where can I find a web-project “security checklist?” i was just wondering
I am wondering how Spring MVC handles SQL injections (and other security issues: XSS,
Am wondering if there would be any security flaw in this approach. I am
I am wondering if it is possible to use Code Access Security, and a
This is a security best practice and I'm wondering if I should even be
Wondering if anyone can help me with this annoying but trivial (in terms of
I'm wondering if I can have multiple public keys for a private key. Can
If we were to use server1 for all files (file server), server2 for mysql
I was wondering if it was possible to generate security credentials per individual Amazon

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.